3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Demo { } // An "autoload" handler creating an alias for the same class spl_autoload_register(function ($class) { echo "autoload $class\n"; class_alias('Demo', $class); }); // Create a Demo object using "A" // and pass that to function expecting "A" function success(A $test) { echo "Success ".get_class($test)."\n"; } echo "1\n"; success(new A()); // Create a Demo object using "B", // then create another Demo object using "C" // and pass that to function expecting "B" function also(B $test) { echo "Success ".get_class($test)."\n"; } echo "2\n"; new B(); echo "3\n"; also(new C()); // Create a Demo object using "X", // and pass that to function expecting "B" function fail(X $test) { echo "Success ".get_class($test)."\n"; } echo "4\n"; fail(new Y()); // Note that all of these names refer to the same class, // and all objects are of the same class

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)
8.3.60.0070.01416.50
8.3.50.0030.01718.24
8.3.40.0100.01020.20
8.3.30.0110.00418.84
8.3.20.0000.00824.18
8.3.10.0040.00424.66
8.3.00.0030.00626.16
8.2.180.0110.00725.92
8.2.170.0060.00918.89
8.2.160.0030.01022.96
8.2.150.0060.00325.66
8.2.140.0000.00824.66
8.2.130.0030.00526.16
8.2.120.0080.00026.16
8.2.110.0040.00420.41
8.2.100.0070.00417.91
8.2.90.0030.00617.63
8.2.80.0080.00018.91
8.2.70.0050.00317.75
8.2.60.0040.00418.03
8.2.50.0060.00318.07
8.2.40.0090.00020.07
8.2.30.0000.01018.03
8.2.20.0040.00419.32
8.2.10.0040.00418.77
8.2.00.0040.00419.13
8.1.280.0110.00725.92
8.1.270.0060.00322.14
8.1.260.0050.00326.35
8.1.250.0060.00328.09
8.1.240.0070.00423.73
8.1.230.0070.00422.11
8.1.220.0090.00017.74
8.1.210.0000.00818.77
8.1.200.0100.00017.23
8.1.190.0040.00417.23
8.1.180.0000.00818.10
8.1.170.0000.00818.59
8.1.160.0000.00818.88
8.1.150.0000.00718.60
8.1.140.0060.00317.39
8.1.130.0040.00419.16
8.1.120.0050.00217.38
8.1.110.0030.00617.31
8.1.100.0000.00717.44
8.1.90.0040.00417.40
8.1.80.0070.00317.39
8.1.70.0000.00717.34
8.1.60.0080.00017.55
8.1.50.0000.00917.36
8.1.40.0000.00717.36
8.1.30.0040.00417.50
8.1.20.0080.00017.53
8.1.10.0130.00017.43
8.1.00.0050.00317.38
8.0.300.0040.00418.77
8.0.290.0050.00216.75
8.0.280.0040.00418.51
8.0.270.0030.00317.98
8.0.260.0040.00418.58
8.0.250.0040.00316.96
8.0.240.0030.00616.89
8.0.230.0030.00317.04
8.0.220.0070.00016.97
8.0.210.0040.00416.87
8.0.200.0000.00617.02
8.0.190.0080.00016.93
8.0.180.0040.00416.88
8.0.170.0030.00616.97
8.0.160.0070.00016.95
8.0.150.0000.00816.79
8.0.140.0070.00016.91
8.0.130.0000.00513.35
8.0.120.0100.00016.94
8.0.110.0000.00717.02
8.0.100.0000.00816.85
8.0.90.0000.00716.87
8.0.80.0050.00216.87
8.0.70.0000.00816.97
8.0.60.0030.00316.95
8.0.50.0000.00716.82
8.0.30.0040.00416.86
8.0.20.0070.00017.00
8.0.10.0050.00316.94
8.0.00.0000.00816.97
7.4.330.0000.00515.55
7.4.320.0060.00016.47
7.4.300.0040.00416.57
7.4.290.0050.00216.40
7.4.280.0070.00016.36
7.4.270.0040.00416.54
7.4.260.0030.00313.18
7.4.250.0040.00416.27
7.4.240.0030.00316.43
7.4.230.0030.00516.53
7.4.220.0040.00416.45
7.4.210.0000.00816.34
7.4.200.0040.00416.45
7.4.190.0030.00316.52
7.4.180.0040.00416.65
7.4.160.0040.00216.47
7.4.150.0030.00316.48
7.4.140.0040.00416.54
7.4.130.0040.00416.52
7.4.120.0000.00716.29
7.4.110.0030.00516.35
7.4.100.0030.00616.45
7.4.90.0030.00316.44
7.4.80.0030.00316.50
7.4.70.0030.00316.46
7.4.60.0030.00316.42
7.4.50.0030.00316.28
7.4.40.0030.00316.33
7.4.30.0060.00316.41
7.4.20.0000.00816.41
7.4.10.0060.00316.33
7.4.00.0030.00316.39
7.3.330.0050.00216.29
7.3.320.0050.00013.35
7.3.310.0030.00416.38
7.3.300.0040.00416.46
7.3.290.0090.00016.38
7.3.280.0040.00416.23
7.3.270.0050.00316.35
7.3.260.0050.00216.35
7.3.250.0000.00716.34
7.3.240.0030.00316.25
7.3.230.0000.00716.46
7.3.220.0000.00716.41
7.3.210.0000.00716.45
7.3.200.0030.00316.46
7.3.190.0040.00416.22
7.3.180.0040.00416.35
7.3.170.0020.00516.21
7.3.160.0000.00616.46
7.3.150.0070.00016.46
7.3.140.0040.00416.34
7.3.130.0030.00316.41
7.3.120.0030.00316.17
7.3.110.0000.00616.20
7.3.100.0070.00016.13
7.3.90.0050.00216.66
7.3.80.0000.00716.35
7.3.70.0000.00716.45
7.3.60.0000.00716.57
7.3.50.0000.00716.50
7.3.40.0000.00816.29
7.3.30.0040.00416.36
7.3.20.0000.00718.24
7.3.10.0050.00318.10
7.3.00.0000.00718.11

preferences:
53.93 ms | 400 KiB | 5 Q