3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Orig1 { public static function test() { echo "ok1\n"; } } class Orig2 { public static function test() { echo "ok2\n"; } } class Delegator { public static function delegate(object $orig) { static $cache = []; $origClass = get_class($orig); if (!isset($cache[$origClass])) { $className = 'Delegate__' . count($cache); $cache[$origClass] = $className; eval(" class $className { public static function __callStatic(\$name, \$args) { return $origClass::\$name(...\$args); } } "); } return new $cache[$origClass]($orig); } } $o1 = new Orig1(); $d1 = Delegator::delegate($o1); $o2 = new Orig2(); $d2 = Delegator::delegate($o2); $d1::test(); $d2::test(); $d1::test();

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.5.30.0050.00419.53
8.5.20.0090.00919.45
8.5.10.0120.00620.01
8.5.00.0100.01120.08
8.4.180.0110.01119.65
8.4.170.0110.01023.82
8.4.160.0130.00919.72
8.4.150.0090.00416.90
8.4.140.0100.01217.46
8.4.130.0110.01017.74
8.4.120.0120.00920.68
8.4.110.0040.00422.33
8.4.100.0120.00818.83
8.4.90.0100.01122.20
8.4.80.0110.00918.78
8.4.70.0060.00218.68
8.4.60.0110.00918.94
8.4.50.0070.01118.65
8.4.40.0040.01119.64
8.4.30.0120.00920.59
8.4.20.0130.00617.81
8.4.10.0050.00523.71
8.3.300.0100.00921.00
8.3.290.0100.00920.91
8.3.280.0120.00718.41
8.3.270.0140.00616.55
8.3.260.0120.00816.55
8.3.250.0140.00619.05
8.3.240.0040.00516.78
8.3.230.0110.00716.81
8.3.220.0110.00818.83
8.3.210.0100.00816.56
8.3.200.0080.00116.92
8.3.190.0080.00517.34
8.3.180.0080.01118.98
8.3.170.0150.00316.59
8.3.160.0150.00319.00
8.3.150.0030.00617.27
8.3.140.0150.00319.01
8.3.130.0080.00016.50
8.3.120.0000.01019.02
8.3.110.0100.00020.94
8.3.100.0060.00316.66
8.3.90.0080.00026.77
8.3.80.0040.00416.75
8.3.70.0110.01116.61
8.3.60.0090.01216.50
8.3.50.0130.00720.12
8.3.40.0070.00721.89
8.3.30.0060.00918.79
8.3.20.0000.00724.18
8.3.10.0080.00024.66
8.3.00.0030.00526.16
8.2.300.0130.00720.38
8.2.290.0100.01116.39
8.2.280.0090.00618.14
8.2.270.0030.01516.74
8.2.260.0110.00716.55
8.2.250.0030.00616.82
8.2.240.0150.00416.69
8.2.230.0090.00022.58
8.2.220.0030.00624.06
8.2.210.0180.00326.77
8.2.200.0090.00018.16
8.2.190.0090.00618.16
8.2.180.0100.01025.92
8.2.170.0030.01422.96
8.2.160.0120.00322.96
8.2.150.0050.00225.66
8.2.140.0080.00024.66
8.2.130.0030.00526.16
8.2.120.0040.00426.16
8.2.110.0060.00322.02
8.2.100.0090.00617.72
8.2.90.0050.00317.88
8.2.80.0060.00318.73
8.2.70.0030.00617.50
8.2.60.0030.00517.93
8.2.50.0040.00418.07
8.2.40.0000.00718.16
8.2.30.0000.00718.14
8.2.20.0040.00419.34
8.2.10.0040.00418.13
8.2.00.0040.00419.31
8.1.340.0080.01121.77
8.1.330.0090.00920.22
8.1.320.0160.00716.07
8.1.310.0060.00316.34
8.1.300.0060.00320.31
8.1.290.0070.00330.84
8.1.280.0000.01425.92
8.1.270.0130.00720.69
8.1.260.0080.00026.35
8.1.250.0030.00628.09
8.1.240.0070.00320.51
8.1.230.0110.00017.70
8.1.220.0030.00517.79
8.1.210.0000.00818.77
8.1.200.0040.00417.36
8.1.190.0000.00817.36
8.1.180.0000.00818.10
8.1.170.0050.00318.43
8.1.160.0040.00418.95
8.1.150.0030.00518.61
8.1.140.0070.00017.47
8.1.130.0070.00020.55
8.1.120.0050.00317.37
8.1.110.0120.00417.46
8.1.100.0110.00417.43
8.1.90.0110.00517.45
8.1.80.0100.00717.32
8.1.70.0110.00617.50
8.1.60.0090.00917.48
8.1.50.0160.00317.52
8.1.40.0070.01117.54
8.1.30.0150.00317.63
8.1.20.0110.00817.64
8.1.10.0180.00217.66
8.1.00.0150.00017.41
8.0.300.0070.00018.77
8.0.290.0080.00016.63
8.0.280.0070.00018.45
8.0.270.0000.00717.20
8.0.260.0030.00318.44
8.0.250.0070.01016.86
8.0.240.0120.00316.81
8.0.230.0090.00616.94
8.0.220.0070.00716.80
8.0.210.0060.00916.95
8.0.200.0100.00516.90
8.0.190.0060.01016.99
8.0.180.0060.00916.81
8.0.170.0110.00416.92
8.0.160.0090.00916.87
8.0.150.0120.00416.90
8.0.140.0140.00316.91
8.0.130.0070.01116.81
8.0.120.0080.00516.92
8.0.110.0050.01016.78
8.0.100.0090.00516.87
8.0.90.0130.00316.83
8.0.80.0120.00016.80
8.0.70.0030.00516.86
8.0.60.0060.00216.83
8.0.50.0050.00516.91
8.0.30.0050.00616.82
8.0.20.0130.00216.91
8.0.10.0040.01117.05
7.4.330.0020.00215.55
7.4.320.0080.00916.59
7.4.300.0180.00016.55
7.4.290.0140.00316.52
7.4.280.0180.00016.56
7.4.270.0120.00316.48
7.4.260.0160.00016.54
7.4.250.0110.00416.48
7.4.240.0120.00416.57
7.4.230.0150.00016.57
7.4.220.0140.00016.45
7.4.210.0120.00316.38
7.4.200.0070.00616.65
7.4.190.0050.00616.53
7.4.180.0000.01116.35
7.4.160.0040.00716.39
7.4.150.0090.00316.61
7.4.140.0090.00416.39
7.4.130.0120.00316.49
7.4.120.0110.00516.46
7.4.110.0100.00316.30
7.4.100.0040.00616.55
7.4.90.0130.00016.33
7.4.80.0050.00916.43
7.4.70.0100.00516.52
7.4.60.0050.00916.33
7.4.50.0050.01016.34
7.4.40.0100.00516.38
7.4.30.0100.00316.39
7.4.20.0110.00016.36
7.4.10.0100.00016.32
7.4.00.0070.00516.56

preferences:
65.33 ms | 1233 KiB | 5 Q