3v4l.org

run code in 300+ PHP versions simultaneously
<?php class App { public static $classes = array(); public static function register($name, Callable $generator) { $classes[$name] = $generator; } public static function make($name) { if (!isset($classes[$name])) { throw new Exception('Invalid class name'); } return ($classes[$name])(); } } // Internal declaration class Foo { public static function bar() { return 'static'; } } App::register('foo', function() { return new Foo; }); // Internal Usage class SomeController { public function view() { echo App::make('foo')->bar(); } } // Some extending application class MyFoo extends Foo { public static function bar() { return 'can\'t make internal methods use this.'; } } App::register('foo', function() { return new MyFoo; }); $c = new SomeController; $c->view();

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.0130.00318.81
8.3.50.0100.00922.05
8.3.40.0090.00618.68
8.3.30.0100.00719.22
8.3.20.0040.00420.21
8.3.10.0040.00421.99
8.3.00.0040.00422.34
8.2.180.0100.01316.88
8.2.170.0090.00622.96
8.2.160.0110.00720.90
8.2.150.0000.00724.18
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0080.00019.61
8.2.110.0070.00322.07
8.2.100.0110.00017.78
8.2.90.0030.00618.03
8.2.80.0060.00317.97
8.2.70.0080.00017.50
8.2.60.0090.00018.05
8.2.50.0050.00518.07
8.2.40.0080.00018.22
8.2.30.0070.00018.15
8.2.20.0040.00417.87
8.2.10.0050.00319.47
8.2.00.0000.00817.84
8.1.280.0150.00625.92
8.1.270.0040.00423.58
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0060.00322.59
8.1.230.0110.00020.87
8.1.220.0000.00817.75
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0060.00317.35
8.1.180.0000.00918.10
8.1.170.0080.00018.53
8.1.160.0040.00421.96
8.1.150.0070.00018.61
8.1.140.0040.00417.46
8.1.130.0070.00017.76
8.1.120.0030.00317.48
8.1.110.0000.00717.51
8.1.100.0000.00717.48
8.1.90.0030.00417.38
8.1.80.0000.00717.37
8.1.70.0030.00317.38
8.1.60.0040.00417.52
8.1.50.0050.00217.46
8.1.40.0050.00317.43
8.1.30.0030.00517.57
8.1.20.0000.00917.51
8.1.10.0000.00817.61
8.1.00.0040.00417.46
8.0.300.0000.00819.90
8.0.290.0060.00316.75
8.0.280.0000.00718.37
8.0.270.0060.00317.34
8.0.260.0030.00516.89
8.0.250.0070.00017.07
8.0.240.0040.00416.93
8.0.230.0050.00217.09
8.0.220.0040.00417.02
8.0.210.0030.00316.96
8.0.200.0070.00317.08
8.0.190.0060.00317.08
8.0.180.0030.00616.89
8.0.170.0060.00316.89
8.0.160.0040.00416.87
8.0.150.0000.00716.80
8.0.140.0000.00716.95
8.0.130.0000.00813.49
8.0.120.0040.00416.95
8.0.110.0020.00516.87
8.0.100.0000.00717.04
8.0.90.0040.00416.85
8.0.80.0060.00916.86
8.0.70.0040.00417.09
8.0.60.0070.00016.98
8.0.50.0070.00016.96
8.0.30.0090.00917.12
8.0.20.0110.00617.40
8.0.10.0040.00417.16
8.0.00.0080.00916.87
7.4.330.0020.00215.07
7.4.320.0000.00716.61
7.4.300.0000.00616.63
7.4.290.0030.00316.52
7.4.280.0000.00716.54
7.4.270.0030.00316.64
7.4.260.0040.00416.39
7.4.250.0020.00516.59
7.4.240.0050.00316.62
7.4.230.0000.00716.62
7.4.220.0120.00616.43
7.4.210.0100.00816.62
7.4.200.0000.00816.28
7.4.190.0030.00316.76
7.4.160.0040.01116.39
7.4.150.0100.00717.40
7.4.140.0090.00817.86
7.4.130.0090.00716.70
7.4.120.0100.00716.60
7.4.110.0080.00816.53
7.4.100.0150.00016.46
7.4.90.0170.00016.45
7.4.80.0080.00919.39
7.4.70.0200.00316.57
7.4.60.0070.01416.66
7.4.50.0040.00416.60
7.4.40.0100.00622.77
7.4.30.0130.00616.56
7.4.00.0000.00814.79
7.3.330.0000.00513.52
7.3.320.0000.00513.34
7.3.310.0000.00716.43
7.3.300.0000.00716.37
7.3.290.0070.00716.38
7.3.280.0090.00616.45
7.3.270.0030.01317.40
7.3.260.0180.00316.53
7.3.250.0080.01116.43
7.3.240.0110.01116.61
7.3.230.0150.00316.45
7.3.210.0090.00916.39
7.3.200.0070.01519.39
7.3.190.0090.00916.42
7.3.180.0100.01316.46
7.3.170.0120.00916.38
7.3.160.0060.00916.41
7.3.120.0040.01414.89
7.2.330.0140.00716.68
7.2.320.0130.00716.40
7.2.310.0030.01416.33
7.2.300.0090.00916.45
7.2.290.0090.00616.38
7.2.60.0190.00316.64
7.2.00.0000.01419.41
7.1.200.0080.00315.46
7.1.100.0000.01018.03
7.1.70.0050.00217.20
7.1.60.0030.02019.82
7.1.50.0090.00917.02
7.1.00.0000.08022.43
7.0.200.0090.00016.68
7.0.140.0130.06322.07
7.0.60.0070.06020.08
7.0.50.0100.05717.84
7.0.40.0070.05320.24
7.0.30.0200.05320.08
7.0.20.0200.08020.07
7.0.10.0170.07720.12
7.0.00.0100.08320.19
5.6.280.0100.06721.00
5.6.210.0170.07720.57
5.6.200.0000.09018.18
5.6.190.0130.06320.46
5.6.180.0230.04720.61
5.6.170.0230.08320.56
5.6.160.0000.05020.71
5.6.150.0130.07718.15
5.6.140.0030.04318.25
5.6.130.0070.08018.11
5.6.120.0130.04021.13
5.6.110.0230.06721.02
5.6.100.0070.04720.96
5.6.90.0100.03321.19
5.6.80.0100.04720.39
5.5.350.0100.06720.45
5.5.340.0030.05318.07
5.5.330.0100.07020.40
5.5.320.3470.04020.35
5.5.310.0370.07020.34
5.5.300.0070.05018.07
5.5.290.0030.07318.08
5.5.280.0030.05320.78
5.5.270.0170.04720.78
5.5.260.0030.07720.87
5.5.250.0100.04320.55
5.5.240.0000.08020.05
5.4.450.0270.05319.64
5.4.440.0500.04719.39
5.4.430.0730.04719.38
5.4.420.0630.04319.30
5.4.410.0200.04319.07
5.4.400.0100.05018.84
5.4.390.0130.05018.56
5.4.380.0270.04318.76
5.4.370.0430.05318.77
5.4.360.0100.06318.60
5.4.350.0300.05718.76
5.4.340.0330.05318.79
5.4.320.0070.03512.52
5.4.310.0060.03712.52
5.4.300.0070.04912.52
5.4.290.0080.03612.52
5.4.280.0010.03912.41
5.4.270.0110.04412.39
5.4.260.0070.05212.39
5.4.250.0060.03812.38
5.4.240.0040.03812.39
5.4.230.0060.03712.38
5.4.220.0060.03512.38
5.4.210.0050.04212.38
5.4.200.0060.03612.38
5.4.190.0070.04212.37
5.4.180.0050.04312.38
5.4.170.0070.03512.38
5.4.160.0050.03712.38
5.4.150.0050.03712.37
5.4.140.0050.03812.06
5.4.130.0070.03412.04
5.4.120.0080.03512.01
5.4.110.0050.03612.01
5.4.100.0080.03212.00
5.4.90.0080.03512.00
5.4.80.0040.04412.00
5.4.70.0050.03512.00
5.4.60.0050.04312.00
5.4.50.0050.03612.00
5.4.40.0100.04511.99
5.4.30.0070.04211.98
5.4.20.0030.03911.98
5.4.10.0090.04511.98
5.4.00.0060.04611.48
5.3.290.0050.04012.80
5.3.280.0040.04512.71
5.3.270.0090.04212.73
5.3.260.0100.03612.72
5.3.250.0040.04112.72
5.3.240.0040.04912.72
5.3.230.0120.03912.71
5.3.220.0080.03912.68
5.3.210.0090.04712.68
5.3.200.0080.03412.68
5.3.190.0080.03612.68
5.3.180.0070.05012.67
5.3.170.0090.04112.66
5.3.160.0100.03312.67
5.3.150.0060.03712.67
5.3.140.0040.03912.66
5.3.130.0050.04012.66
5.3.120.0060.03812.66
5.3.110.0070.03712.66
5.3.100.0070.03612.12
5.3.90.0050.03712.09
5.3.80.0070.03512.07
5.3.70.0060.03512.07
5.3.60.0070.03512.06
5.3.50.0050.03712.00
5.3.40.0060.03612.00
5.3.30.0050.03611.96
5.3.20.0030.03711.74
5.3.10.0060.03511.70
5.3.00.0070.03511.69
5.2.170.0070.0289.18
5.2.160.0080.0259.19
5.2.150.0070.0289.19
5.2.140.0060.0299.19
5.2.130.0040.0349.15
5.2.120.0110.0339.14
5.2.110.0070.0289.15
5.2.100.0040.0289.15
5.2.90.0080.0259.15
5.2.80.0060.0299.14
5.2.70.0070.0319.14
5.2.60.0070.0299.09
5.2.50.0060.0299.07
5.2.40.0060.0279.04
5.2.30.0050.0289.01
5.2.20.0070.0339.01
5.2.10.0030.0348.92
5.2.00.0030.0318.77
5.1.60.0070.0218.05
5.1.50.0030.0268.06
5.1.40.0030.0258.04
5.1.30.0060.0248.39
5.1.20.0030.0278.42
5.1.10.0030.0318.14
5.1.00.0050.0258.14
5.0.50.0040.0276.62
5.0.40.0050.0196.47
5.0.30.0040.0306.29
5.0.20.0040.0196.26
5.0.10.0030.0206.23
5.0.00.0020.0336.23
4.4.90.0030.0154.78
4.4.80.0030.0154.75
4.4.70.0040.0174.75
4.4.60.0010.0174.75
4.4.50.0030.0154.77
4.4.40.0010.0274.71
4.4.30.0030.0154.76
4.4.20.0010.0174.84
4.4.10.0040.0164.85
4.4.00.0020.0264.76
4.3.110.0020.0164.67
4.3.100.0060.0124.67
4.3.90.0020.0214.63
4.3.80.0030.0244.58
4.3.70.0030.0154.63
4.3.60.0030.0144.63
4.3.50.0040.0144.62
4.3.40.0030.0234.54
4.3.30.0010.0173.29
4.3.20.0030.0203.27
4.3.10.0010.0163.23
4.3.00.0100.01015.09

preferences:
36.16 ms | 401 KiB | 5 Q