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 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 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.0060.00918.43
8.3.50.0230.00921.95
8.3.40.0120.00318.79
8.3.30.0180.00019.21
8.3.20.0070.00020.19
8.3.10.0000.00822.09
8.3.00.0000.00822.40
8.2.180.0130.00716.63
8.2.170.0150.00622.96
8.2.160.0060.01220.93
8.2.150.0080.00024.18
8.2.140.0050.00324.66
8.2.130.0080.00026.16
8.2.120.0040.00419.48
8.2.110.0080.00322.24
8.2.100.0060.00617.90
8.2.90.0060.00317.84
8.2.80.0070.00317.97
8.2.70.0060.00317.63
8.2.60.0000.00817.93
8.2.50.0040.00818.07
8.2.40.0040.00418.16
8.2.30.0000.00718.07
8.2.20.0020.00517.64
8.2.10.0040.00419.44
8.2.00.0030.00517.77
8.1.280.0130.00325.92
8.1.270.0040.00422.20
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0030.00720.67
8.1.230.0040.00720.84
8.1.220.0000.00817.79
8.1.210.0060.00318.85
8.1.200.0060.00317.35
8.1.190.0080.00017.53
8.1.180.0060.00318.10
8.1.170.0060.00318.51
8.1.160.0070.00022.00
8.1.150.0020.00518.73
8.1.140.0040.00417.39
8.1.130.0000.00717.82
8.1.120.0000.00717.53
8.1.110.0040.00417.46
8.1.100.0070.00017.51
8.1.90.0000.00717.34
8.1.80.0050.00217.52
8.1.70.0040.00417.38
8.1.60.0030.00517.59
8.1.50.0040.00417.43
8.1.40.0080.00017.50
8.1.30.0050.00317.67
8.1.20.0000.00817.57
8.1.10.0040.00417.59
8.1.00.0030.00617.53
8.0.300.0040.00419.98
8.0.290.0050.00217.05
8.0.280.0040.00418.48
8.0.270.0030.00317.28
8.0.260.0040.00416.83
8.0.250.0050.00216.93
8.0.240.0040.00416.88
8.0.230.0000.00716.98
8.0.220.0000.00716.83
8.0.210.0030.00316.96
8.0.200.0050.00316.88
8.0.190.0070.00017.00
8.0.180.0040.00416.95
8.0.170.0070.00016.90
8.0.160.0040.00416.78
8.0.150.0070.00016.90
8.0.140.0040.00416.84
8.0.130.0000.00713.38
8.0.120.0040.00416.84
8.0.110.0070.00016.83
8.0.100.0040.00416.96
8.0.90.0000.00716.76
8.0.80.0090.01216.79
8.0.70.0050.00317.02
8.0.60.0030.00516.96
8.0.50.0000.00816.78
8.0.30.0110.00817.07
8.0.20.0120.01017.40
8.0.10.0000.00817.05
8.0.00.0060.01016.77
7.4.330.0020.00215.00
7.4.320.0000.00616.53
7.4.300.0060.00016.70
7.4.290.0030.00516.51
7.4.280.0070.00016.52
7.4.270.0000.00916.54
7.4.260.0080.00316.44
7.4.250.0000.00716.46
7.4.240.0020.00516.53
7.4.230.0070.00016.60
7.4.220.0090.00916.72
7.4.210.0030.01116.66
7.4.200.0080.00016.61
7.4.190.0070.00016.56
7.4.160.0100.01016.38
7.4.150.0070.01117.40
7.4.140.0130.00817.86
7.4.130.0160.00616.56
7.4.120.0130.00316.47
7.4.110.0130.01016.63
7.4.100.0140.00316.58
7.4.90.0120.00616.68
7.4.80.0100.01019.39
7.4.70.0100.01416.67
7.4.60.0100.00616.41
7.4.50.0050.00316.57
7.4.40.0090.00622.77
7.4.30.0110.00616.36
7.4.00.0050.01014.91
7.3.330.0050.00013.19
7.3.320.0030.00313.30
7.3.310.0070.00016.18
7.3.300.0000.00716.42
7.3.290.0040.01016.38
7.3.280.0060.01116.38
7.3.270.0180.00617.40
7.3.260.0190.00016.57
7.3.250.0080.01116.64
7.3.240.0090.00916.49
7.3.230.0110.00916.46
7.3.210.0110.00616.51
7.3.200.0090.00919.39
7.3.190.0150.00616.68
7.3.180.0110.00516.39
7.3.170.0090.00916.52
7.3.160.0090.00616.66
7.3.120.0060.01014.82
7.3.110.0030.01215.06
7.3.100.0070.00714.84
7.3.90.0070.00414.96
7.3.80.0110.00214.97
7.3.70.0030.00914.72
7.3.60.0040.00814.65
7.3.50.0070.00714.88
7.3.40.0040.00914.67
7.3.30.0050.00714.71
7.3.20.0040.00516.64
7.3.10.0060.00816.48
7.3.00.0030.00916.82
7.2.330.0070.01116.50
7.2.320.0180.00316.36
7.2.310.0030.01316.40
7.2.300.0080.01516.66
7.2.290.0150.00316.80
7.2.250.0060.01214.88
7.2.240.0080.01115.05
7.2.230.0040.00914.88
7.2.220.0060.00715.29
7.2.210.0070.00715.03
7.2.200.0060.00914.99
7.2.190.0090.00215.20
7.2.180.0060.00715.13
7.2.170.0060.00915.08
7.2.60.0030.01016.80
7.2.50.0050.00317.02
7.2.00.0060.00919.54
7.1.330.0030.01015.69
7.1.320.0040.01115.94
7.1.310.0030.01116.01
7.1.300.0060.00515.82
7.1.290.0050.00915.69
7.1.280.0030.01315.82
7.1.270.0050.00715.73
7.1.260.0110.00315.82
7.1.200.0060.00616.02
7.1.100.0030.01018.13
7.1.70.0030.00617.07
7.1.60.0140.01019.82
7.1.50.0070.01116.84
7.1.00.0000.07722.40
7.0.200.0000.00716.73
7.0.140.0000.07721.95
7.0.100.0200.06019.95
7.0.90.0100.03719.98
7.0.80.0130.06719.93
7.0.70.0030.05720.02
7.0.60.0130.08019.99
7.0.50.0030.08320.26
7.0.40.0030.04319.95
7.0.30.0100.08320.06
7.0.20.0070.08720.07
7.0.10.0130.07719.99
7.0.00.0070.06320.18
5.6.280.0030.07020.91
5.6.250.0100.05020.65
5.6.240.0100.04320.65
5.6.230.0070.04020.70
5.6.220.0100.07320.61
5.6.210.0100.08020.67
5.6.200.0070.08021.04
5.6.190.0130.07020.92
5.6.180.0070.08021.10
5.6.170.0070.08321.07
5.6.160.0070.07021.07
5.6.150.0100.07721.04
5.6.140.0070.07720.97
5.6.130.0030.05320.98
5.6.120.0130.05021.04
5.6.110.0100.07321.03
5.6.100.0130.06320.94
5.6.90.0070.05021.02
5.6.80.0030.07320.50
5.6.70.0070.08020.31
5.6.60.0100.08020.35
5.6.50.0070.08320.34
5.6.40.0070.07020.46
5.6.30.0070.07720.42
5.6.20.0130.04320.42
5.6.10.0070.05720.39
5.6.00.0070.06720.42
5.5.380.0070.06720.43
5.5.370.0130.07320.59
5.5.360.0100.07320.45
5.5.350.0070.06720.44
5.5.340.0130.03320.84
5.5.330.0130.07720.78
5.5.320.0030.05320.95
5.5.310.0100.07720.94
5.5.300.0000.06720.82
5.5.290.0130.04320.88
5.5.280.0030.04320.89
5.5.270.0100.07320.82
5.5.260.0100.09020.90
5.5.250.0130.05720.75
5.5.240.0130.07020.32
5.5.230.0170.04020.27
5.5.220.0170.06020.30
5.5.210.0130.06320.23
5.5.200.0100.04020.30
5.5.190.0100.06720.14
5.5.180.0100.08020.11
5.5.160.0070.04320.28
5.5.150.0000.08720.00
5.5.140.0100.07320.14
5.5.130.0130.04320.17
5.5.120.0000.08020.25
5.5.110.0030.07720.25
5.5.100.0000.08020.04
5.5.90.0100.07019.96
5.5.80.0170.07019.92
5.5.70.0100.04019.97
5.5.60.0070.06720.18
5.5.50.0100.06719.95
5.5.40.0030.07320.16
5.5.30.0170.04020.16
5.5.20.0130.07320.16
5.5.10.0100.07720.08
5.5.00.0170.07320.15
5.4.450.0030.04319.38
5.4.440.0100.06719.40
5.4.430.0030.08719.20
5.4.420.0130.07319.20
5.4.410.0100.07019.29
5.4.400.0130.06719.13
5.4.390.0000.07719.13
5.4.380.0070.04319.13
5.4.370.0030.07019.16
5.4.360.0100.07319.13
5.4.350.0000.07319.14
5.4.340.0070.07718.86
5.4.320.0130.04019.19
5.4.310.0030.07318.90
5.4.300.0070.07319.14
5.4.290.0100.06719.13
5.4.280.0030.07719.05
5.4.270.0130.03719.24
5.4.260.0000.04718.87
5.4.250.0070.07719.16
5.4.240.0100.06318.94
5.4.230.0070.06319.10
5.4.220.0070.04319.02
5.4.210.0070.04719.23
5.4.200.0100.07019.13
5.4.190.0030.06718.89
5.4.180.0100.07019.14
5.4.170.0070.07019.17
5.4.160.0000.08019.09
5.4.150.0200.06018.88
5.4.140.0170.05316.50
5.4.130.0100.03716.45
5.4.120.0070.05716.46
5.4.110.0100.07316.42
5.4.100.0070.05016.51
5.4.90.0100.03716.49
5.4.80.0170.06316.38
5.4.70.0070.07016.43
5.4.60.0000.04716.30
5.4.50.0070.07316.26
5.4.40.0070.07716.42
5.4.30.0100.06716.46
5.4.20.0030.04316.45
5.4.10.0030.06316.48
5.4.00.0070.07015.86
5.3.290.0070.06714.75
5.3.280.0070.04314.54
5.3.270.0070.04314.56
5.3.260.0070.03714.60
5.3.250.0030.07714.75
5.3.240.0070.07014.55
5.3.230.0100.07014.71
5.3.220.0070.07714.59
5.3.210.0030.07014.52
5.3.200.0070.06014.71
5.3.190.0070.07714.73
5.3.180.0000.07014.64
5.3.170.0030.04014.68
5.3.160.0130.07014.66
5.3.150.0100.06014.64
5.3.140.0170.05014.50
5.3.130.0030.08314.63
5.3.120.0200.06314.71
5.3.110.0030.06314.59
5.3.100.0100.07714.00
5.3.90.0070.07014.02
5.3.80.0070.06713.93
5.3.70.0030.06714.17
5.3.60.0100.05714.03
5.3.50.0030.07713.86
5.3.40.0000.06313.90
5.3.30.0130.06713.91
5.3.20.0100.07713.71
5.3.10.0130.06013.61
5.3.00.0070.06013.66
5.2.170.0070.05011.04
5.2.160.0070.05711.17
5.2.150.0030.06711.06
5.2.140.0030.05711.06
5.2.130.0070.03711.04
5.2.120.0030.06011.11
5.2.110.0070.05711.17
5.2.100.0070.05711.23
5.2.90.0030.05711.13
5.2.80.0030.06011.12
5.2.70.0130.05011.13
5.2.60.0030.05711.16
5.2.50.0070.05311.05
5.2.40.0070.05011.00
5.2.30.0000.04711.08
5.2.20.0030.04010.88
5.2.10.0070.04710.85
5.2.00.0070.04710.64
5.1.60.0030.05010.12
5.1.50.0070.05010.08
5.1.40.0030.02310.04
5.1.30.0000.05310.27
5.1.20.0030.04710.42
5.1.10.0030.03010.08
5.1.00.0030.02310.09
5.0.50.0000.0378.54
5.0.40.0030.0208.25
5.0.30.0000.0608.11
5.0.20.0000.0278.27
5.0.10.0070.0338.26
5.0.00.0030.0708.11
4.4.90.0030.0338.11
4.4.80.0000.0208.11
4.4.70.0000.0308.11
4.4.60.0030.0178.11
4.4.50.0070.0308.11
4.4.40.0030.0508.11
4.4.30.0030.0238.11
4.4.20.0070.0138.11
4.4.10.0070.0308.11
4.4.00.0030.0478.11
4.3.110.0030.0308.11
4.3.100.0000.0308.11
4.3.90.0030.0338.11
4.3.80.0000.0508.11
4.3.70.0070.0238.11
4.3.60.0030.0308.11
4.3.50.0070.0178.11
4.3.40.0000.0538.11
4.3.30.0030.0208.11
4.3.20.0030.0378.11
4.3.10.0000.0208.11
4.3.00.0030.0238.11

preferences:
36.21 ms | 401 KiB | 5 Q