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++ < 10000) 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++ < 10000) 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.4.00.0120.10922.13
7.3.120.0070.05116.25
7.3.110.0080.05716.27
7.3.100.0100.03716.26
7.3.90.0020.05016.14
7.3.80.0060.04916.29
7.3.70.0030.04016.08
7.3.60.0060.03916.04
7.3.50.0030.04416.27
7.3.40.0080.04016.29
7.3.30.0070.04415.98
7.3.20.0080.03516.72
7.3.10.0050.03716.63
7.3.00.0060.03616.83
7.2.250.0080.05816.21
7.2.240.0100.05016.20
7.2.230.0100.03616.42
7.2.220.0070.04216.36
7.2.210.0050.04116.46
7.2.200.0030.04316.46
7.2.190.0030.05316.23
7.2.180.0030.04216.35
7.2.170.0020.04216.37
7.2.00.0060.02419.41
7.1.330.0080.03615.85
7.1.320.0030.05315.80
7.1.310.0030.04315.80
7.1.300.0030.04515.77
7.1.290.0050.04215.78
7.1.280.0020.05015.65
7.1.270.0070.04115.84
7.1.260.0050.04615.79
7.1.70.0060.02317.18
7.1.60.0000.02816.97
7.1.50.0070.05416.95
7.1.00.0000.10722.46
7.0.200.0100.04616.70
7.0.140.0100.10021.91
7.0.70.0070.08021.19
7.0.60.0030.10721.26
7.0.50.0170.11021.61
7.0.40.0100.11320.00
7.0.30.0070.08320.18
7.0.20.0030.11020.18
7.0.10.0070.10720.17
7.0.00.0100.09020.05
5.6.280.0030.10722.36
5.6.220.0070.11321.90
5.6.210.0130.11021.81
5.6.200.0030.07022.36
5.6.190.0200.11322.33
5.6.180.0100.07722.38
5.6.170.0130.10725.53
5.6.160.0100.08722.34
5.6.150.0100.12022.37
5.6.140.0100.10322.37
5.6.130.0030.13322.43
5.6.120.0070.12022.36
5.6.110.0130.12025.73
5.6.100.0130.11322.38
5.6.90.0030.09322.46
5.6.80.0030.13021.81
5.6.70.0100.10321.86
5.6.60.0100.12321.75
5.6.50.0170.09024.71
5.6.40.0170.12021.76
5.6.30.0070.12021.79
5.6.20.0030.09724.70
5.6.10.0130.11721.72
5.6.00.0000.06021.68
5.5.360.0170.11021.71
5.5.350.0030.12321.77
5.5.340.0130.09322.24
5.5.330.0100.11022.11
5.5.320.0230.11322.22
5.5.310.0070.07321.92
5.5.300.0100.08322.07
5.5.290.0170.10022.05
5.5.280.0130.10722.25
5.5.270.0030.12722.20
5.5.260.0070.12022.04
5.5.250.0130.12321.75
5.5.240.0130.12721.48
5.5.230.0170.11021.56
5.5.220.0170.11721.62
5.5.210.0070.12721.41
5.5.200.0030.11021.45
5.5.190.0100.10721.52
5.5.180.0070.11721.43
5.5.160.0030.09021.43
5.5.150.0130.05021.59
5.5.140.0100.05721.47
5.5.130.0030.09324.58
5.5.120.0030.09321.39
5.5.110.0000.11721.56
5.5.100.0130.11321.41
5.5.90.0070.06721.23
5.5.80.0070.07721.48
5.5.70.0100.06021.32
5.5.60.0000.07021.47
5.5.50.0030.07021.32
5.5.40.0070.06021.37
5.5.30.0100.05721.43
5.5.20.0070.09321.46
5.5.10.0070.06321.43
5.5.00.0070.06721.38
5.4.450.0100.12720.53
5.4.440.0130.11720.66
5.4.430.0070.11720.45
5.4.420.0070.12324.30
5.4.410.0100.10720.55
5.4.400.0070.11020.16
5.4.390.0070.12320.56
5.4.380.0130.11720.21
5.4.370.0170.11020.49
5.4.360.0100.11720.48
5.4.350.0130.10320.52
5.4.340.0100.11320.43
5.4.320.0070.06720.43
5.4.310.0000.06720.21
5.4.300.0000.06720.48
5.4.290.0070.05023.79
5.4.280.0030.07720.21
5.4.270.0070.06020.51
5.4.260.0070.12320.20
5.4.250.0100.10020.40
5.4.240.0070.06320.22
5.4.230.0130.05320.43
5.4.220.0030.06323.56
5.4.210.0100.05720.33
5.4.200.0000.06320.35
5.4.190.0070.06020.24
5.4.180.0000.07020.20
5.4.170.0000.07720.20
5.4.160.0130.06320.16
5.4.150.0030.12720.54
5.4.140.0030.06317.70
5.4.130.0030.06017.69
5.4.120.0030.06017.73
5.4.110.0100.06717.84
5.4.100.0070.11017.79
5.4.90.0070.11317.77
5.4.80.0100.08717.84
5.4.70.0070.10717.85
5.4.60.0100.07317.67
5.4.50.0100.11320.77
5.4.40.0000.09017.73
5.4.30.0030.09017.65
5.4.20.0030.09017.60
5.4.10.0130.10717.66
5.4.00.0030.07317.26
5.3.290.0030.05316.15
5.3.280.0000.07016.06
5.3.270.0070.06316.04
5.3.260.0000.07016.10
5.3.250.0070.06316.15
5.3.240.0030.06716.04
5.3.230.0030.06716.20
5.3.220.0100.11316.10
5.3.210.0000.08316.00
5.3.200.0070.11715.96
5.3.190.0030.13016.14
5.3.180.0070.10016.04
5.3.170.0030.12016.11
5.3.160.0100.08315.99
5.3.150.0170.06016.17
5.3.140.0130.09016.11
5.3.130.0100.11715.95
5.3.120.0070.13016.04
5.3.110.0030.08316.13
5.3.100.0070.09015.52
5.3.90.0130.12015.41
5.3.80.0130.07715.51
5.3.70.0100.12315.49
5.3.60.0100.11315.50
5.3.50.0100.12015.53
5.3.40.0070.12015.45
5.3.30.0070.11715.27
5.3.20.0130.11315.16
5.3.10.0070.10715.15
5.3.00.0100.11315.10
5.2.170.0070.10712.70
5.2.160.0130.12315.98
5.2.150.0000.06312.70
5.2.140.0030.10712.70
5.2.130.0070.05712.70
5.2.120.0000.11012.70
5.2.110.0030.11312.70
5.2.100.0070.06712.70
5.2.90.0100.06312.70
5.2.80.0000.09712.70
5.2.70.0070.10712.70
5.2.60.0030.09312.70
5.2.50.0100.11012.70
5.2.40.0000.11312.70
5.2.30.0100.07312.70
5.2.20.0030.09712.70
5.2.10.0070.10312.70
5.2.00.0030.07012.70
5.1.60.0100.09012.70
5.1.50.0130.06012.70
5.1.40.0030.09012.70
5.1.30.0070.10712.70
5.1.20.0030.09012.70
5.1.10.0030.10012.70
5.1.00.0070.05312.70
5.0.50.0130.08712.70
5.0.40.0030.10012.70
5.0.30.0030.09712.70
5.0.20.0030.10012.70
5.0.10.0000.09712.70
5.0.00.0000.11312.70
4.4.90.0030.02312.70
4.4.80.0000.03712.70
4.4.70.0000.03012.70
4.4.60.0070.03012.70
4.4.50.0030.02712.70
4.4.40.0030.05312.70
4.4.30.0100.03012.70
4.4.20.0130.02312.70
4.4.10.0030.02712.70
4.4.00.0030.05012.70
4.3.110.0070.03312.70
4.3.100.0000.03012.70
4.3.90.0000.03712.70
4.3.80.0030.05712.70
4.3.70.0000.02712.70
4.3.60.0000.03712.70
4.3.50.0070.03312.70
4.3.40.0070.03712.70
4.3.30.0000.03712.70
4.3.20.0030.03312.70
4.3.10.0030.03312.70
4.3.00.0000.02012.70

preferences:
42.04 ms | 401 KiB | 5 Q