3v4l.org

run code in 300+ PHP versions simultaneously
<?php class App { public static $classes = array(); public function register($name, $generator) { $this::$classes[$name] = $generator; } public function make() { $args = func_get_args(); $name = array_shift($args); if (!isset($this::$classes[$name])) { throw new Exception('Invalid class name'); } $classes =& $this::$classes; return call_user_func_array($classes[$name], $args); } } $app = new App; // Internal declaration class Foo { public static function bar() { return 'static'; } } $app->register('foo', function() { return new Foo; }); // Internal Usage class SomeController { public function view() { $app = new App; 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.0110.00418.20
8.3.50.0070.00922.05
8.3.40.0040.01118.70
8.3.30.0140.00319.18
8.3.20.0050.00220.02
8.3.10.0080.00021.91
8.3.00.0070.00022.46
8.2.180.0120.00316.63
8.2.170.0040.01122.96
8.2.160.0040.01120.94
8.2.150.0000.00824.18
8.2.140.0040.00424.66
8.2.130.0040.00426.16
8.2.120.0030.00519.24
8.2.110.0040.00422.09
8.2.100.0120.00017.84
8.2.90.0040.00418.03
8.2.80.0000.00917.97
8.2.70.0080.00017.75
8.2.60.0030.00617.93
8.2.50.0030.00918.07
8.2.40.0000.00818.09
8.2.30.0050.00318.02
8.2.20.0000.00817.79
8.2.10.0030.00519.42
8.2.00.0000.00717.76
8.1.280.0090.00925.92
8.1.270.0080.00022.12
8.1.260.0000.00826.35
8.1.250.0030.00528.09
8.1.240.0000.00920.77
8.1.230.0040.00721.04
8.1.220.0000.00817.74
8.1.210.0000.00918.92
8.1.200.0040.00417.25
8.1.190.0040.00417.40
8.1.180.0040.00418.10
8.1.170.0030.00618.71
8.1.160.0000.00721.95
8.1.150.0040.00418.53
8.1.140.0050.00217.47
8.1.130.0000.00717.79
8.1.120.0000.00717.41
8.1.110.0030.00617.35
8.1.100.0000.00817.35
8.1.90.0000.00817.42
8.1.80.0040.00417.46
8.1.70.0030.00317.36
8.1.60.0030.00517.57
8.1.50.0040.00417.56
8.1.40.0000.00817.58
8.1.30.0050.00317.67
8.1.20.0000.00817.55
8.1.10.0040.00417.55
8.1.00.0030.00517.44
8.0.300.0030.00519.87
8.0.290.0000.00717.18
8.0.280.0000.00718.50
8.0.270.0000.00717.22
8.0.260.0030.00316.84
8.0.250.0040.00417.01
8.0.240.0040.00417.03
8.0.230.0000.00716.93
8.0.220.0000.00716.86
8.0.210.0000.00716.86
8.0.200.0080.00017.00
8.0.190.0030.00316.96
8.0.180.0000.01016.89
8.0.170.0080.00016.93
8.0.160.0070.00016.89
8.0.150.0030.00416.80
8.0.140.0000.00716.90
8.0.130.0040.00413.38
8.0.120.0000.00816.95
8.0.110.0000.00716.75
8.0.100.0030.00516.77
8.0.90.0000.00716.92
8.0.80.0140.00016.87
8.0.70.0040.00416.75
8.0.60.0040.00416.90
8.0.50.0000.00816.70
8.0.30.0120.01017.07
8.0.20.0100.01017.40
8.0.10.0040.00417.02
8.0.00.0030.01316.83
7.4.330.0030.00315.09
7.4.320.0000.00616.61
7.4.300.0060.00016.53
7.4.290.0080.00016.50
7.4.280.0050.00316.42
7.4.270.0070.00016.60
7.4.260.0000.00716.64
7.4.250.0080.00016.43
7.4.240.0030.00416.59
7.4.230.0030.00316.71
7.4.220.0080.00816.69
7.4.210.0040.01016.50
7.4.200.0040.00516.54
7.4.190.0030.00316.76
7.4.160.0050.01116.36
7.4.150.0070.01017.40
7.4.140.0100.00917.86
7.4.130.0070.01016.54
7.4.120.0080.01016.60
7.4.110.0100.00716.63
7.4.100.0120.00616.59
7.4.90.0030.01616.66
7.4.80.0120.00619.39
7.4.70.0100.00616.45
7.4.60.0060.01016.54
7.4.50.0090.00016.40
7.4.40.0040.00822.77
7.4.30.0130.00916.60
7.4.00.0070.00715.00
7.3.330.0030.00313.15
7.3.320.0050.00013.25
7.3.310.0040.00416.28
7.3.300.0000.00716.25
7.3.290.0070.00716.30
7.3.280.0100.00716.33
7.3.270.0070.01017.40
7.3.260.0060.01516.41
7.3.250.0070.01016.43
7.3.240.0060.01216.69
7.3.230.0070.01016.45
7.3.210.0100.00716.54
7.3.200.0100.01019.39
7.3.190.0110.00516.47
7.3.180.0100.01316.39
7.3.170.0000.01916.73
7.3.160.0100.00716.46
7.3.120.0070.00415.16
7.2.330.0130.00316.79
7.2.320.0070.01416.69
7.2.310.0100.00616.71
7.2.300.0100.00716.57
7.2.290.0110.00616.61
7.2.00.0070.00719.01
7.1.100.0040.00718.04
7.1.70.0030.00917.13
7.1.60.0220.00419.82
7.1.50.0100.01016.98
7.1.00.0030.07722.29
7.0.200.0070.00016.62
7.0.140.0000.07321.95
7.0.60.0100.08319.98
7.0.50.0100.08017.88
7.0.40.0000.09320.27
7.0.30.0270.05320.06
7.0.20.0230.04320.07
7.0.10.0230.07020.17
7.0.00.0000.09020.22
5.6.280.0070.07021.08
5.6.210.0030.07020.66
5.6.200.0100.07718.16
5.6.190.0030.04320.51
5.6.180.3870.04720.64
5.6.170.0230.04720.63
5.6.160.0100.07720.54
5.6.150.0070.08318.15
5.6.140.0030.04018.18
5.6.130.0170.04018.23
5.6.120.0000.09721.13
5.6.110.0100.06721.02
5.6.100.0200.07020.98
5.6.90.0100.03321.00
5.6.80.0070.04020.52
5.6.70.4370.04320.44
5.5.350.0000.08320.43
5.5.340.0070.07718.09
5.5.330.0170.05020.37
5.5.320.0330.07720.36
5.5.310.0300.06320.24
5.5.300.0170.06317.98
5.5.290.0030.09017.94
5.5.280.0270.06720.91
5.5.270.0030.04320.80
5.5.260.0130.07320.89
5.5.250.0070.06720.68
5.5.240.0100.07020.16
5.4.450.0370.03719.55
5.4.440.0430.04719.57
5.4.430.0100.03719.19
5.4.420.0300.04719.56
5.4.410.0200.04018.73
5.4.400.0100.05318.91
5.4.390.0100.05018.75
5.4.380.0300.04318.63
5.4.370.0230.05318.75
5.4.360.0170.05318.75
5.4.350.0270.05018.51
5.4.340.0200.05718.80
5.4.320.0110.04912.52
5.4.310.0070.04312.51
5.4.300.0100.03512.52
5.4.290.0080.03912.52
5.4.280.0080.04412.41
5.4.270.0040.04312.38
5.4.260.0070.03812.37
5.4.250.0020.04212.38
5.4.240.0050.03812.38
5.4.230.0080.03912.37
5.4.220.0090.03612.36
5.4.210.0030.04112.37
5.4.200.0060.03812.36
5.4.190.0050.03712.36
5.4.180.0100.04012.36
5.4.170.0070.03512.38
5.4.160.0070.03512.37
5.4.150.0050.03712.37
5.4.140.0020.04012.05
5.4.130.0060.03412.04
5.4.120.0050.03612.00
5.4.110.0040.03611.99
5.4.100.0060.03512.00
5.4.90.0030.04011.99
5.4.80.0060.03811.99
5.4.70.0020.03811.98
5.4.60.0050.04111.99
5.4.50.0040.03711.99
5.4.40.0070.03411.97
5.4.30.0110.02911.97
5.4.20.0060.03811.97
5.4.10.0030.03611.97
5.4.00.0050.03611.46
5.3.290.0100.04212.80
5.3.280.0040.04112.71
5.3.270.0050.03912.72
5.3.260.0070.03812.72
5.3.250.0070.03612.72
5.3.240.0090.03412.72
5.3.230.0090.03512.71
5.3.220.0060.04112.68
5.3.210.0060.04512.68
5.3.200.0070.03512.68
5.3.190.0060.03712.68
5.3.180.0060.03512.67
5.3.170.0070.03912.67
5.3.160.0090.03312.67
5.3.150.0080.03712.67
5.3.140.0060.03712.66
5.3.130.0090.03712.66
5.3.120.0070.03712.66
5.3.110.0030.04312.65
5.3.100.0060.03812.12
5.3.90.0040.04012.09
5.3.80.0070.03512.08
5.3.70.0100.04412.08
5.3.60.0060.03612.06
5.3.50.0040.03812.01
5.3.40.0050.03712.01
5.3.30.0080.03611.97
5.3.20.0030.03711.75
5.3.10.0050.03511.71
5.3.00.0040.03811.70
5.2.170.0040.0319.18
5.2.160.0010.0339.18
5.2.150.0050.0309.18
5.2.140.0060.0299.18
5.2.130.0020.0319.14
5.2.120.0060.0279.14
5.2.110.0050.0289.14
5.2.100.0080.0289.15
5.2.90.0030.0309.14
5.2.80.0020.0329.14
5.2.70.0030.0329.14
5.2.60.0060.0289.09
5.2.50.0040.0359.06
5.2.40.0030.0309.03
5.2.30.0070.0289.01
5.2.20.0040.0299.01
5.2.10.0040.0288.92
5.2.00.0030.0308.77
5.1.60.0070.0218.05
5.1.50.0060.0228.05
5.1.40.0030.0268.04
5.1.30.0030.0278.39
5.1.20.0020.0298.41
5.1.10.0080.0248.13
5.1.00.0040.0258.13
5.0.50.0040.0216.61
5.0.40.0040.0196.47
5.0.30.0050.0326.29
5.0.20.0080.0236.25
5.0.10.0030.0246.23
5.0.00.0040.0316.22
4.4.90.0040.0204.78
4.4.80.0070.0214.76
4.4.70.0030.0164.75
4.4.60.0050.0144.75
4.4.50.0020.0174.77
4.4.40.0030.0244.71
4.4.30.0040.0144.76
4.4.20.0020.0174.84
4.4.10.0020.0184.85
4.4.00.0030.0254.76
4.3.110.0020.0184.67
4.3.100.0020.0164.67
4.3.90.0020.0164.63
4.3.80.0030.0244.59
4.3.70.0050.0124.63
4.3.60.0040.0184.63
4.3.50.0020.0204.63
4.3.40.0020.0324.54
4.3.30.0020.0213.28
4.3.20.0020.0173.26
4.3.10.0030.0153.23
4.3.00.0030.01315.08

preferences:
44.12 ms | 401 KiB | 5 Q