3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($var){ echo "test $var\n"; } class bla { public $foo = "test"; public function bar($str) { echo $this->foo($str),"\n"; // php5 fails w/o method below specified } public function bar_none($str) { echo ($this->foo)($str),"\n"; // php7 works } public function foo($val){ test($val); } } $objBla = new bla(); $objBla->bar("someval"); if (phpversion() >= "7.0.0"){ $objBla->bar_none("nother val"); }

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.10.0190.00616.45
7.3.00.0080.00816.52
7.2.130.0110.00816.27
7.2.120.0180.01016.56
7.2.110.0190.00216.56
7.2.100.0060.01016.65
7.2.90.0080.01016.61
7.2.80.0110.00916.30
7.2.70.0150.01016.54
7.2.60.0120.01016.69
7.2.50.0100.01016.69
7.2.40.0100.00816.56
7.2.30.0100.00516.75
7.2.20.0270.00317.01
7.2.10.0110.00316.82
7.2.00.0140.00717.61
7.1.250.0180.01115.04
7.1.240.0030.00615.86
7.1.230.0000.01115.94
7.1.220.0140.00015.71
7.1.210.0070.00715.44
7.1.200.0080.00515.79
7.1.190.0080.00415.98
7.1.180.0060.00615.71
7.1.170.0090.00415.92
7.1.160.0030.01015.83
7.1.150.0000.01415.79
7.1.140.0070.00715.71
7.1.130.0040.00415.75
7.1.120.0000.01415.81
7.1.110.0030.00715.90
7.1.100.0030.00717.15
7.1.90.0030.00915.88
7.1.80.0110.00415.84
7.1.70.0010.01016.56
7.1.60.0020.00917.50
7.1.50.0090.00916.25
7.1.40.0000.00915.64
7.1.30.0060.00615.85
7.1.20.0100.00315.57
7.1.10.0070.00715.86
7.1.00.0060.03919.03
7.0.320.0140.00015.20
7.0.310.0060.00615.32
7.0.300.0030.00615.55
7.0.290.0060.00315.55
7.0.280.0090.00615.21
7.0.270.0000.01315.27
7.0.260.0030.01015.50
7.0.250.0060.00615.48
7.0.240.0090.00615.43
7.0.230.0060.00315.42
7.0.220.0040.00715.39
7.0.210.0000.01515.32
7.0.200.0030.00916.07
7.0.190.0030.00715.51
7.0.180.0040.01115.30
7.0.170.0030.01015.51
7.0.160.0040.00415.57
7.0.150.0090.00015.61
7.0.140.0060.00915.50
7.0.130.0000.01215.52
7.0.120.0080.00515.39
7.0.110.0070.00715.38
7.0.100.0070.00415.44
7.0.90.0030.00615.22
7.0.80.0080.00815.45
7.0.70.0040.01215.16
7.0.60.0120.04218.65
7.0.50.0080.02016.75
7.0.40.0080.04016.71
7.0.30.0200.02716.82
7.0.20.0150.03416.78
7.0.10.0070.03716.66
7.0.00.0070.02716.65
5.6.380.0060.00314.41
5.6.370.0030.00614.02
5.6.360.0060.00614.00
5.6.350.0040.01114.27
5.6.340.0040.00414.25
5.6.330.0110.00414.13
5.6.320.0090.00614.13
5.6.310.0060.00914.18
5.6.300.0030.01014.00
5.6.290.0070.00714.38
5.6.280.0060.01817.62
5.6.270.0100.00614.25
5.6.260.0100.00314.35
5.6.250.0060.00614.11
5.6.240.0030.01014.21
5.6.230.0000.01414.32
5.6.220.0030.00514.36
5.6.210.0050.04817.34
5.6.200.0050.04216.26
5.6.190.0080.04617.22
5.6.180.0240.03517.27
5.6.170.0110.02417.23
5.6.160.0070.04517.36
5.6.150.0030.04616.03
5.6.140.0050.02416.29
5.6.130.0060.02216.26
5.6.120.0050.02717.65
5.6.110.0070.04717.62
5.6.100.0050.02317.53
5.6.90.0050.04417.50
5.6.80.0070.03017.30
5.6.70.0120.00014.07
5.6.60.0070.00614.11
5.6.50.0000.01414.16
5.6.40.0030.00913.91
5.6.30.0070.00713.96
5.6.20.0030.01014.10
5.6.10.0030.01013.98
5.6.00.0060.00914.09
5.5.380.0030.00710.89
5.5.370.0040.00810.83
5.5.360.0030.00610.75
5.5.350.0160.03315.66
5.5.340.0080.04014.26
5.5.330.0050.02215.82
5.5.320.0270.03415.51
5.5.310.0130.04515.51
5.5.300.0060.01814.51
5.5.290.0060.02714.42
5.5.280.0100.02615.88
5.5.270.0060.04715.97
5.5.260.0050.02615.84
5.5.250.0030.02315.76
5.5.240.0100.03415.56
5.5.230.0040.00710.95
5.5.220.0090.00010.92
5.5.210.0000.00610.99
5.5.200.0080.00311.03
5.5.190.0030.00710.88
5.5.180.0000.01110.63
5.5.170.0040.00414.23
5.5.160.0000.00511.02
5.5.150.0000.01111.13
5.5.140.0070.00410.60
5.5.130.0030.00710.69
5.5.120.0040.00810.95
5.5.110.0090.00010.81
5.5.100.0020.00910.98
5.5.90.0070.00310.86
5.5.80.0030.00610.84
5.5.70.0060.00011.06
5.5.60.0060.00310.69
5.5.50.0000.01110.95
5.5.40.0000.01110.66
5.5.30.0030.00510.71
5.5.20.0090.00311.04
5.5.10.0070.00410.92
5.5.00.0000.00610.93

preferences:
39.28 ms | 401 KiB | 5 Q