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 dot"; 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 commas";

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.10.0100.11522.16
7.4.00.0070.09422.20
7.3.130.0070.04416.01
7.3.120.0160.05216.27
7.3.110.0130.05316.36
7.3.100.0030.04516.15
7.3.90.0030.04116.29
7.3.80.0100.03815.97
7.3.70.0100.03616.27
7.3.60.0100.03616.11
7.3.50.0070.04416.00
7.3.40.0060.04516.18
7.3.30.0070.04316.21
7.3.20.0070.04316.80
7.3.10.0110.04116.64
7.3.00.0090.04016.44
7.2.260.0130.05416.13
7.2.250.0030.06316.45
7.2.240.0000.04116.49
7.2.230.0070.04516.30
7.2.220.0000.04616.47
7.2.210.0030.04716.50
7.2.200.0030.04516.36
7.2.190.0030.04216.29
7.2.180.0130.03316.49
7.2.170.0070.04016.29
7.2.160.0070.04016.31
7.2.150.0030.04216.91
7.2.140.0000.04316.87
7.2.130.0120.04216.89
7.2.120.0100.04116.88
7.2.110.0140.04516.73
7.2.100.0070.04116.83
7.2.90.0130.04016.78
7.2.80.0170.04216.85
7.2.70.0070.04416.82
7.2.60.0130.04116.78
7.2.50.0110.04216.82
7.2.40.0080.03816.77
7.2.30.0100.04316.83
7.2.20.0080.04416.85
7.2.10.0080.04016.81
7.2.00.0090.04017.35
7.1.330.0000.05015.82
7.1.320.0070.03915.77
7.1.310.0000.06915.55
7.1.300.0030.04715.79
7.1.290.0030.04315.55
7.1.280.0070.03715.59
7.1.270.0040.03915.54
7.1.260.0060.04415.78
7.1.250.0090.04815.67
7.1.240.0080.04115.76
7.1.230.0050.04315.82
7.1.220.0060.04015.60
7.1.210.0050.04415.67
7.1.200.0100.04915.72
7.1.190.0150.04815.69
7.1.180.0110.04315.92
7.1.170.0100.04315.70
7.1.160.0050.04415.62
7.1.150.0100.04416.02
7.1.140.0080.04515.87
7.1.130.0110.03715.79
7.1.120.0070.05015.66
7.1.110.0100.05415.85
7.1.100.0140.04515.67
7.1.90.0070.04515.80
7.1.80.0090.04415.84
7.1.70.0060.04216.19
7.1.60.0060.04016.22
7.1.50.0100.04516.05
7.1.40.0170.04315.75
7.1.30.0100.04515.51
7.1.20.0100.04715.54
7.1.10.0080.05015.70
7.1.00.0070.06817.96
7.0.330.0080.04815.21
7.0.320.0100.04115.34
7.0.310.0110.03615.14
7.0.300.0070.04215.31
7.0.290.0100.03815.39
7.0.280.0110.03615.33
7.0.270.0080.04215.18
7.0.260.0070.04515.46
7.0.250.0070.04815.51
7.0.240.0100.03715.46
7.0.230.0120.03815.40
7.0.220.0070.04515.35
7.0.210.0050.04215.47
7.0.200.0070.04115.78
7.0.190.0030.04215.53
7.0.180.0080.04215.55
7.0.170.0100.03915.40
7.0.160.0060.04015.32
7.0.150.0070.04315.45
7.0.140.0100.06017.57
7.0.130.0080.04315.36
7.0.120.0070.04115.52
7.0.110.0050.04515.40
7.0.100.0080.06617.40
7.0.90.0090.06117.33
7.0.80.0120.06117.36
7.0.70.0100.05917.46
7.0.60.0060.06617.33
7.0.50.0030.07117.42
7.0.40.0080.06315.65
7.0.30.0100.06115.70
7.0.20.0080.06215.59
7.0.10.0100.06815.60
7.0.00.0100.05515.57
5.6.400.0060.04915.72
5.6.390.0030.05115.76
5.6.380.0050.05316.07
5.6.370.0100.04515.74
5.6.360.0020.05115.72
5.6.350.0030.05116.09
5.6.340.0100.04615.58
5.6.330.0030.05416.06
5.6.320.0050.05115.48
5.6.310.0050.05115.98
5.6.300.0020.05615.78
5.6.290.0120.04415.96
5.6.280.0090.06717.93
5.6.270.0030.05715.84
5.6.260.0080.05015.76
5.6.250.0090.06117.85
5.6.240.0080.07217.95
5.6.230.0080.06917.74
5.6.220.0100.06817.83
5.6.210.0090.06617.80
5.6.200.0090.06917.88
5.6.190.0100.06917.81
5.6.180.0090.06917.99
5.6.170.0050.06217.91
5.6.160.0060.07918.01
5.6.150.0130.06217.94
5.6.140.0090.05818.05
5.6.130.0080.07317.90
5.6.120.0090.07119.30
5.6.110.0050.07717.86
5.6.100.0040.07517.97
5.6.90.0090.05718.10
5.6.80.0090.06817.72
5.6.70.0120.06717.66
5.6.60.0120.06717.63
5.6.50.0060.06917.65
5.6.40.0080.06917.69
5.6.30.0090.06917.57
5.6.20.0090.06917.65
5.6.10.0020.07717.54
5.6.00.0040.07217.71
5.5.380.0080.06516.64
5.5.370.0050.07316.75
5.5.360.0080.06616.63
5.5.350.0090.07216.51
5.5.340.0090.07316.85
5.5.330.0030.08016.89
5.5.320.0080.06816.78
5.5.310.0070.07316.77
5.5.300.0070.07616.83
5.5.290.0080.07216.80
5.5.280.0080.07416.91
5.5.270.0060.06516.75
5.5.260.0110.07516.79
5.5.250.0040.07016.54
5.5.240.0090.07416.63
5.5.230.0080.07316.49
5.5.220.0070.06416.55
5.5.210.0080.07316.67
5.5.200.0100.06216.48
5.5.190.0070.07016.64
5.5.180.0070.07316.55
5.5.170.0070.05314.07
5.5.160.0040.07316.48
5.5.150.0060.06816.43
5.5.140.0070.06916.28
5.5.130.0110.07016.52
5.5.120.0090.06416.34
5.5.110.0050.05416.50
5.5.100.0110.06416.49
5.5.90.0080.06416.50
5.5.80.0060.05516.41
5.5.70.0040.05316.34
5.5.60.0090.05516.52
5.5.50.0020.05816.56
5.5.40.0040.05916.51
5.5.30.0090.05116.49
5.5.20.0020.05816.59
5.5.10.0030.05616.50
5.5.00.0100.05316.49
5.4.450.0040.07915.40
5.4.440.0070.06515.32
5.4.430.0110.07015.39
5.4.420.0100.07515.32
5.4.410.0100.06415.26
5.4.400.0100.06115.29
5.4.390.0070.06615.42
5.4.380.0010.07115.42
5.4.370.0070.07215.40
5.4.360.0150.06515.41
5.4.350.0050.06615.45
5.4.340.0090.05915.40
5.4.330.0050.05012.84
5.4.320.0090.07715.45
5.4.310.0070.06915.41
5.4.300.0060.07315.37
5.4.290.0080.06615.42
5.4.280.0070.06915.41
5.4.270.0020.06415.37
5.4.260.0130.05115.31
5.4.250.0080.05615.23
5.4.240.0050.05715.44
5.4.230.0100.05015.25
5.4.220.0050.06115.43
5.4.210.0110.07115.35
5.4.200.0050.06015.43
5.4.190.0110.05615.37
5.4.180.0030.05915.42
5.4.170.0040.05515.20
5.4.160.0030.05715.49
5.4.150.0070.05315.34
5.4.140.0050.07114.48
5.4.130.0040.05714.53
5.4.120.0060.07314.55
5.4.110.0080.05814.49
5.4.100.0030.05814.54
5.4.90.0070.05115.55
5.4.80.0080.06014.54
5.4.70.0090.06514.49
5.4.60.0100.05714.47
5.4.50.0020.05814.53
5.4.40.0110.05814.40
5.4.30.0060.05814.48
5.4.20.0090.07114.51
5.4.10.0100.06814.43
5.4.00.0100.06314.33
5.3.290.0110.07413.83
5.3.280.0070.05713.78
5.3.270.0040.06213.79
5.3.260.0080.06213.84
5.3.250.0040.06513.84
5.3.240.0090.05413.80
5.3.230.0040.06913.77
5.3.220.0080.06213.80
5.3.210.0040.06113.72
5.3.200.0100.05313.79
5.3.190.0160.05813.80
5.3.180.0060.05913.83
5.3.170.0040.06113.75
5.3.160.0030.06213.77
5.3.150.0070.07113.90
5.3.140.0070.06613.81
5.3.130.0020.08113.86
5.3.120.0070.07413.85
5.3.110.0070.07313.85
5.3.100.0070.07313.69
5.3.90.0100.05313.67
5.3.80.0060.07613.61
5.3.70.0110.06713.46
5.3.60.0070.07313.51
5.3.50.0100.07313.61
5.3.40.0060.07313.59
5.3.30.0110.07013.62
5.3.20.0130.06813.40
5.3.10.0100.07013.34
5.3.00.0080.07313.25
5.2.170.0100.07811.67
5.2.160.0070.07911.70
5.2.150.0080.07811.93
5.2.140.0070.06111.83
5.2.130.0100.07411.66
5.2.120.0070.07411.79
5.2.110.0080.07011.71
5.2.100.0120.07011.73
5.2.90.0130.07311.86
5.2.80.0150.07311.70
5.2.70.0050.08111.80
5.2.60.0020.06911.83
5.2.50.0080.08511.63
5.2.40.0080.07711.55
5.2.30.0050.07413.43
5.2.20.0030.09111.57
5.2.10.0070.07711.55
5.2.00.0070.06711.38
5.1.60.0050.07811.06
5.1.50.0100.05311.05
5.1.40.0100.06611.04
5.1.30.0050.07511.14
5.1.20.0100.07211.14
5.1.10.0130.06811.07
5.1.00.0120.06112.77
5.0.50.0070.07810.80
5.0.40.0080.08210.80
5.0.30.0050.08510.80
5.0.20.0030.07910.80
5.0.10.0050.08010.80
5.0.00.0070.08110.80
4.4.90.0060.01510.80
4.4.80.0030.01610.80
4.4.70.0030.01910.80
4.4.60.0030.01710.80
4.4.50.0030.01810.80
4.4.40.0030.02710.80
4.4.30.0050.01810.80
4.4.20.0040.01810.80
4.4.10.0030.02010.80
4.4.00.0030.02010.80
4.3.110.0070.01710.80
4.3.100.0050.01710.80
4.3.90.0070.01710.80
4.3.80.0030.02810.80
4.3.70.0030.01810.80
4.3.60.0040.01810.80
4.3.50.0080.01310.80
4.3.40.0000.02510.80
4.3.30.0000.02010.80
4.3.20.0030.01610.80
4.3.10.0020.02010.80
4.3.00.0000.01810.80

preferences:
37.16 ms | 401 KiB | 5 Q