3v4l.org

run code in 300+ PHP versions simultaneously
<?php class TextTest { public function entities($str) { return substr($str,0); } } $answerset = array('answers'=>array(50=>array('answerlong'=>'somestring'))); $text = new TextTest(); ob_start(); $time = microtime(1); $i = 0; while($i++ < 100000) echo'<td>',$text->entities($answerSet['answers'][$questionId]['answerLong']),'</td>'; ob_end_clean(); echo (microtime(1)-$time)." seconds for commas"; echo "\n"; ob_start(); $time = microtime(1); $i = 0; while($i++ < 100000) echo'<td>'.$text->entities($answerSet['answers'][$questionId]['answerLong']).'</td>'; ob_end_clean(); echo (microtime(1)-$time)." seconds for dot";

Here you find the average performance (time & memory) of each version. A grayed out version indicates it didn't complete successfully (based on exit-code).

VersionSystem time (s)User time (s)Memory (MiB)
7.3.120.0300.50831.13
7.3.110.0300.37431.43
7.3.100.0270.39431.32
7.3.90.0230.36231.21
7.3.80.0400.40631.10
7.3.70.0370.39431.32
7.3.60.0270.34831.27
7.3.50.0230.39431.26
7.3.40.0070.34231.16
7.3.30.0360.32931.29
7.3.20.0300.48531.22
7.3.10.0200.33831.69
7.3.00.0170.34331.73
7.2.240.0430.47931.66
7.2.230.0370.31231.65
7.2.220.0200.49031.66
7.2.210.0270.37331.46
7.2.200.0130.35731.32
7.2.190.0470.38231.45
7.2.180.0370.30631.49
7.2.170.0330.33331.06
7.2.160.0300.29531.21
7.2.150.0330.48131.63
7.2.140.0200.33731.74
7.2.130.0130.33831.63
7.2.120.0200.35431.55
7.2.110.0230.29932.00
7.2.100.0230.42131.67
7.2.90.0230.35031.79
7.2.80.0170.45531.86
7.2.70.0300.33231.84
7.2.60.0270.44231.66
7.2.50.0200.44331.91
7.2.40.0130.34532.01
7.2.30.0130.30632.02
7.2.20.0100.31731.60
7.2.10.0130.34031.80
7.2.00.0180.25133.29
7.1.330.0130.44030.80
7.1.320.0070.49630.80
7.1.310.0330.37730.54
7.1.300.0130.47730.68
7.1.290.0230.47530.54
7.1.280.0070.39030.80
7.1.270.0100.35630.69
7.1.260.0170.34630.75
7.1.250.0130.40330.78
7.1.70.0100.18632.17
7.1.60.0200.24732.27
7.1.50.0430.24432.08
7.1.00.0100.32737.15
7.0.200.0270.21231.80
7.0.140.0170.29736.95
7.0.60.0300.28736.46
7.0.50.0200.23734.26
7.0.40.0100.29732.82
7.0.30.0630.27732.77
7.0.20.0530.26332.87
7.0.10.0500.27732.77
7.0.00.0270.30032.84
5.6.280.0000.36334.43
5.6.210.0100.30733.53
5.6.200.0100.34031.18
5.6.190.0130.27333.59
5.6.180.0400.31033.74
5.6.170.0430.27333.54
5.6.160.0030.32733.43
5.6.150.0130.37331.13
5.6.140.0100.27031.25
5.6.130.0230.34031.21
5.6.120.0230.28033.88
5.6.110.0200.31334.00
5.6.100.0100.30334.10
5.6.90.0130.26734.00
5.6.80.0170.28333.32
5.5.350.0030.36033.63
5.5.340.0070.32330.93
5.5.330.0070.30333.24
5.5.320.0130.34334.93
5.5.310.0500.32733.33
5.5.300.0100.34030.96
5.5.290.0070.31730.95
5.5.280.0300.34733.64
5.5.270.0200.34733.86
5.5.260.0570.31733.86
5.5.250.0170.32733.60
5.5.240.0130.33333.25
5.4.450.0470.39732.54
5.4.440.0330.28032.44
5.4.430.0470.31732.55
5.4.420.0430.25732.29
5.4.410.0300.26732.33
5.4.400.0500.31732.23
5.4.390.0530.26032.16
5.4.380.5500.353362.93
5.4.370.0670.38732.05
5.4.360.0500.32032.07
5.4.350.0470.27731.86
5.4.340.0470.25032.29
5.4.320.0470.29032.18
5.4.310.0430.27032.16
5.4.300.0400.32032.20
5.4.290.0570.31032.21
5.4.280.0500.30331.96
5.4.270.0300.31031.92
5.4.260.0430.31332.20
5.4.250.0400.26032.17
5.4.240.0430.33332.05
5.4.230.0500.30731.92
5.4.220.0470.32032.07
5.4.210.0570.29332.19
5.4.200.0500.30031.85
5.4.190.0470.25332.20
5.4.180.0600.29731.96
5.4.170.0570.29732.19
5.4.160.0500.28732.16
5.4.150.0430.31331.81
5.4.140.0370.30329.54
5.4.130.0500.31729.35
5.4.120.0370.25729.53
5.4.110.0500.25029.61
5.4.100.0330.26329.48
5.4.90.0300.38029.48
5.4.80.0370.25029.61
5.4.70.0530.23329.57
5.4.60.0400.24029.29
5.4.50.0430.23729.20
5.4.40.0330.26329.29
5.4.30.0430.31329.39
5.4.20.0300.28729.54
5.4.10.0430.30729.56
5.4.00.0400.33029.20
5.3.290.0430.26327.89
5.3.280.0470.31027.61
5.3.270.0400.28727.74
5.3.260.0500.29027.63
5.3.250.0470.28727.80
5.3.240.0530.28327.81
5.3.230.0900.29727.70
5.3.220.0370.26027.68
5.3.210.0370.28027.70
5.3.200.0400.29327.68
5.3.190.0270.26727.61
5.3.180.0330.30027.70
5.3.170.0370.26727.69
5.3.160.0300.26027.59
5.3.150.0270.33027.70
5.3.140.0330.26027.79
5.3.130.0230.27727.59
5.3.120.0530.30027.57
5.3.110.0530.31327.66
5.3.100.0300.29327.07
5.3.90.0300.37027.36
5.3.80.0370.32027.18
5.3.70.0570.30027.30
5.3.60.0470.32727.05
5.3.50.0330.32027.12
5.3.40.0500.33026.97
5.3.30.0530.29727.10
5.3.20.0370.29326.89
5.3.10.1230.27727.00
5.3.00.0530.31726.92
5.2.170.0400.32724.19
5.2.160.0500.31324.21
5.2.150.0600.30324.20
5.2.140.0400.33024.21
5.2.130.0470.32024.16
5.2.120.0330.33724.33
5.2.110.0330.40324.32
5.2.100.0400.31724.36
5.2.90.0330.32724.15
5.2.80.0400.25724.14
5.2.70.0430.25724.16
5.2.60.0500.29024.12
5.2.50.0470.37024.17
5.2.40.0230.33724.19
5.2.30.0330.26724.19
5.2.20.0570.29724.01
5.2.10.0800.28323.89
5.2.00.0400.33323.87
5.1.60.0230.31322.90
5.1.50.0430.29323.05
5.1.40.0370.28023.19
5.1.30.0270.30323.43
5.1.20.0400.36023.45
5.1.10.0370.31322.94
5.1.00.0330.24323.03
5.0.50.0330.35021.45
5.0.40.0270.30721.48
5.0.30.0230.36321.33
5.0.20.0230.33721.43
5.0.10.0170.32321.33
5.0.00.0270.35721.41
4.4.90.0070.03712.10
4.4.80.0100.03712.10
4.4.70.0100.03312.10
4.4.60.0100.03312.10
4.4.50.0100.02312.10
4.4.40.0100.05312.10
4.4.30.0030.02012.10
4.4.20.0170.02712.10
4.4.10.0100.02712.10
4.4.00.0100.05012.10
4.3.110.0070.03712.10
4.3.100.0070.03712.10
4.3.90.0030.03312.10
4.3.80.0100.05012.10
4.3.70.0070.02712.10
4.3.60.0100.02712.10
4.3.50.0100.02012.10
4.3.40.0130.04712.10
4.3.30.0030.03312.10
4.3.20.0000.04012.10
4.3.10.0030.02312.10
4.3.00.0100.03012.10

preferences:
37.78 ms | 401 KiB | 5 Q