3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { function fuu() {} } function bar() { static $i = 0; return ++$i; } function baz() { static $i = 0; return ++$i; } $foo = new Foo(bar()); try { $foo2 = (new ReflectionClass('Foo'))->newInstanceArgs([baz()]); } catch(ReflectionException $ex) { echo $ex->getMessage() . "\n" } echo "Did call bar " . bar() . " times\n"; echo "Did call baz " . baz() . " times\n";

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)
5.4.350.0120.05312.04
5.4.340.0100.05112.03
5.4.320.0070.05412.52
5.4.310.0100.03812.52
5.4.300.0050.04012.52
5.4.290.0060.04612.51
5.4.280.0100.04712.41
5.4.270.0070.04812.41
5.4.260.0060.04712.41
5.4.250.0050.06012.41
5.4.240.0090.03812.41
5.4.230.0070.04212.40
5.4.220.0060.04112.40
5.4.210.0080.03612.40
5.4.200.0070.05012.41
5.4.190.0080.03812.40
5.4.180.0070.03812.40
5.4.170.0120.04112.41
5.4.160.0150.05712.40
5.4.150.0210.10412.39
5.4.140.0090.07112.09
5.4.130.0190.07412.07
5.4.120.0130.07512.03
5.4.110.0120.03812.03
5.4.100.0100.04212.03
5.4.90.0080.04212.03
5.4.80.0090.07912.03
5.4.70.0050.03612.03
5.4.60.0080.03612.03
5.4.50.0050.04312.02
5.4.40.0060.03912.02
5.4.30.0060.03912.01
5.4.20.0090.04712.01
5.4.10.0110.03912.02
5.4.00.0110.03911.50
5.3.290.0050.05012.80
5.3.280.0120.04412.71
5.3.270.0080.05412.72
5.3.260.0140.06512.72
5.3.250.0130.05812.72
5.3.240.0120.04012.72
5.3.230.0130.05012.71
5.3.220.0330.10912.68
5.3.210.0100.05912.68
5.3.200.0130.06212.68
5.3.190.0060.05012.68
5.3.180.0220.06012.67
5.3.170.0130.06212.67
5.3.160.0100.05612.68
5.3.150.0120.04812.67
5.3.140.0140.04412.66
5.3.130.0190.04512.66
5.3.120.0060.05512.66
5.3.110.0110.05012.66
5.3.100.0090.05012.13
5.3.90.0080.04312.11
5.3.80.0130.04512.10
5.3.70.0080.04012.10
5.3.60.0070.05012.08
5.3.50.0080.04612.04
5.3.40.0120.04312.03
5.3.30.0060.05011.98
5.3.20.0060.04711.78
5.3.10.0100.05811.74
5.3.00.0080.04811.73
5.2.170.0050.0369.23
5.2.160.0090.0399.23
5.2.150.0070.0369.23
5.2.140.0050.0369.23
5.2.130.0050.0379.19
5.2.120.0080.0319.18
5.2.110.0080.0339.19
5.2.100.0070.0369.18
5.2.90.0060.0399.18
5.2.80.0080.0439.18
5.2.70.0070.0409.18
5.2.60.0080.0319.14
5.2.50.0070.0349.11
5.2.40.0060.0319.09
5.2.30.0070.0369.05
5.2.20.0030.0349.04
5.2.10.0040.0318.95
5.2.00.0030.0348.81
5.1.60.0060.0268.11
5.1.50.0050.0328.10
5.1.40.0050.0328.07
5.1.30.0000.0448.42
5.1.20.0080.0348.45
5.1.10.0070.0308.18
5.1.00.0070.0298.18
5.0.50.0050.0236.65
5.0.40.0040.0296.51
5.0.30.0030.0366.32
5.0.20.0050.0246.29
5.0.10.0080.0216.27
5.0.00.0040.0406.26
4.4.90.0080.0184.78
4.4.80.0060.0194.75
4.4.70.0030.0224.76
4.4.60.0010.0224.75
4.4.50.0080.0174.77
4.4.40.0020.0334.70
4.4.30.0040.0194.76
4.4.20.0070.0194.84
4.4.10.0070.0184.85
4.4.00.0040.0274.76
4.3.110.0050.0164.67
4.3.100.0020.0184.67
4.3.90.0020.0164.64
4.3.80.0010.0264.58
4.3.70.0030.0184.63
4.3.60.0040.0154.63
4.3.50.0020.0214.63
4.3.40.0030.0284.54
4.3.30.0050.0143.30
4.3.20.0030.0213.28
4.3.10.0020.0193.25
4.3.00.0130.0207.66

preferences:
147.81 ms | 1394 KiB | 7 Q