3v4l.org

run code in 300+ PHP versions simultaneously
<?php class App { public static $classes = array(); public function register($name, Callable $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.0070.00718.43
8.3.50.0090.01022.01
8.3.40.0070.00718.85
8.3.30.0080.00819.04
8.3.20.0000.00720.38
8.3.10.0000.00921.92
8.3.00.0050.00322.43
8.2.180.0110.00716.50
8.2.170.0110.00422.96
8.2.160.0090.00920.89
8.2.150.0050.00324.18
8.2.140.0090.00024.66
8.2.130.0080.00026.16
8.2.120.0000.00819.38
8.2.110.0060.00320.21
8.2.100.0060.00617.84
8.2.90.0080.00019.17
8.2.80.0030.00917.97
8.2.70.0030.00517.50
8.2.60.0080.00018.05
8.2.50.0090.00318.07
8.2.40.0000.00818.16
8.2.30.0040.00418.15
8.2.20.0000.00817.66
8.2.10.0000.00919.41
8.2.00.0000.00817.67
8.1.280.0100.01025.92
8.1.270.0060.00324.01
8.1.260.0050.00326.35
8.1.250.0050.00328.09
8.1.240.0060.00622.06
8.1.230.0090.00320.87
8.1.220.0000.00817.79
8.1.210.0040.00418.77
8.1.200.0080.00317.25
8.1.190.0000.00917.40
8.1.180.0030.00518.10
8.1.170.0050.00318.55
8.1.160.0040.00422.02
8.1.150.0040.00418.57
8.1.140.0000.00717.39
8.1.130.0030.00317.91
8.1.120.0000.00717.48
8.1.110.0000.00817.49
8.1.100.0000.00717.43
8.1.90.0070.00017.45
8.1.80.0000.00717.45
8.1.70.0070.00017.47
8.1.60.0050.00317.61
8.1.50.0000.00817.57
8.1.40.0050.00317.39
8.1.30.0040.00417.65
8.1.20.0080.00017.57
8.1.10.0000.00817.61
8.1.00.0080.00017.58
8.0.300.0000.00718.77
8.0.290.0000.00717.18
8.0.280.0000.00718.34
8.0.270.0040.00417.27
8.0.260.0000.00816.95
8.0.250.0040.00417.02
8.0.240.0080.00017.02
8.0.230.0000.00717.05
8.0.220.0070.00016.82
8.0.210.0000.00717.01
8.0.200.0030.00617.02
8.0.190.0000.00816.96
8.0.180.0030.00617.03
8.0.170.0040.00416.93
8.0.160.0000.00716.99
8.0.150.0000.00816.93
8.0.140.0040.00416.93
8.0.130.0000.00813.39
8.0.120.0040.00416.90
8.0.110.0040.00416.95
8.0.100.0020.00516.83
8.0.90.0070.00017.04
8.0.80.0120.00316.91
8.0.70.0070.00016.86
8.0.60.0000.00716.93
8.0.50.0040.00416.78
8.0.30.0120.00717.26
8.0.20.0080.01117.40
8.0.10.0060.00317.16
8.0.00.0130.00516.74
7.4.330.0050.00015.00
7.4.320.0030.00316.53
7.4.300.0000.00716.59
7.4.290.0070.00016.51
7.4.280.0030.00316.52
7.4.270.0060.00316.48
7.4.260.0030.00616.61
7.4.250.0040.00416.58
7.4.240.0050.00216.57
7.4.230.0070.00016.64
7.4.220.0140.00316.65
7.4.210.0070.00716.57
7.4.200.0000.00716.43
7.4.190.0030.00316.66
7.4.160.0060.00916.68
7.4.150.0090.00917.40
7.4.140.0120.00517.86
7.4.130.0120.00516.54
7.4.120.0130.01016.53
7.4.110.0060.01216.42
7.4.100.0060.01216.46
7.4.90.0070.01116.58
7.4.80.0000.01719.39
7.4.70.0070.01016.56
7.4.60.0070.01116.71
7.4.50.0000.00816.24
7.4.40.0060.00922.77
7.4.30.0120.00916.42
7.4.00.0040.01114.91
7.3.330.0050.00013.19
7.3.320.0000.00513.19
7.3.310.0080.00016.38
7.3.300.0070.00016.42
7.3.290.0040.01016.26
7.3.280.0070.00916.38
7.3.270.0100.00717.40
7.3.260.0120.00616.58
7.3.250.0080.01316.51
7.3.240.0040.01416.45
7.3.230.0140.00316.57
7.3.210.0080.00816.33
7.3.200.0120.00919.39
7.3.190.0090.01216.42
7.3.180.0100.00616.54
7.3.170.0030.01316.64
7.3.160.0100.01016.39
7.3.120.0070.01014.77
7.3.110.0130.00314.64
7.3.100.0110.00714.54
7.3.90.0040.01114.57
7.3.80.0040.00814.54
7.3.70.0030.01014.60
7.3.60.0030.00614.64
7.3.50.0130.00014.73
7.3.40.0030.01414.68
7.3.30.0050.00314.61
7.3.20.0030.01216.39
7.3.10.0050.00516.39
7.3.00.0030.01216.30
7.2.330.0110.00916.50
7.2.320.0130.00716.70
7.2.310.0030.01416.76
7.2.300.0160.00616.71
7.2.290.0150.00316.37
7.2.250.0090.00914.99
7.2.240.0100.01015.22
7.2.230.0060.00614.63
7.2.220.0060.01014.89
7.2.210.0000.01415.16
7.2.200.0060.00615.23
7.2.190.0050.00514.64
7.2.180.0090.00915.00
7.2.170.0000.01514.95
7.2.160.0040.00815.07
7.2.150.0120.00416.58
7.2.140.0120.00016.78
7.2.130.0040.01517.12
7.2.120.0100.00316.79
7.2.110.0060.00916.94
7.2.100.0060.00616.84
7.2.90.0090.00616.66
7.2.80.0070.00316.68
7.2.70.0000.01516.93
7.2.60.0060.00916.89
7.2.50.0100.00016.78
7.2.40.0070.00716.91
7.2.30.0080.01116.59
7.2.20.0070.00716.69
7.2.10.0030.00616.94
7.2.00.0070.01116.74
7.1.330.0040.00815.91
7.1.320.0100.00315.78
7.1.310.0090.00615.89
7.1.300.0040.00815.67
7.1.290.0030.01515.44
7.1.280.0040.00715.62
7.1.270.0030.00915.30
7.1.260.0090.00615.69
7.1.250.0060.01415.80
7.1.240.0030.00715.72
7.1.230.0090.00615.77
7.1.220.0070.00715.65
7.1.210.0000.01215.56
7.1.200.0070.00415.61
7.1.190.0040.00415.78
7.1.180.0090.00315.65
7.1.170.0000.01215.93
7.1.160.0000.01415.77
7.1.150.0120.00315.55
7.1.140.0060.00315.84
7.1.130.0040.01415.54
7.1.120.0030.01415.70
7.1.110.0090.00915.54
7.1.100.0090.00015.87
7.1.90.0060.00615.87
7.1.80.0040.01115.54
7.1.70.0040.00716.44
7.1.60.0050.01217.80
7.1.50.0040.01316.31
7.1.40.0070.00315.49
7.1.30.0070.00715.77
7.1.20.0090.00615.77
7.1.10.0080.00615.79
7.1.00.0020.04319.05
7.0.330.0090.00915.05
7.0.320.0060.00615.22
7.0.310.0060.00915.23
7.0.300.0040.01115.25
7.0.290.0050.00315.37
7.0.280.0070.00715.04
7.0.270.0110.00415.34
7.0.260.0080.00815.26
7.0.250.0080.00615.52
7.0.240.0080.00615.34
7.0.230.0000.01515.24
7.0.220.0070.00715.13
7.0.210.0060.00615.26
7.0.200.0030.00715.97
7.0.190.0060.00315.64
7.0.180.0070.00515.40
7.0.170.0110.00515.31
7.0.160.0070.00415.48
7.0.150.0030.01215.33
7.0.140.0060.03818.75
7.0.130.0120.00415.15
7.0.120.0070.01015.01
7.0.110.0070.01015.58
7.0.100.0030.01215.16
7.0.90.0000.01515.36
7.0.80.0000.01515.45
7.0.70.0090.00615.14
7.0.60.0070.04617.66
7.0.50.0120.03816.53
7.0.40.0050.03216.66
7.0.30.0170.03716.97
7.0.20.0280.03316.86
7.0.10.0180.03716.88
7.0.00.0100.02716.84
5.6.400.0090.00614.16
5.6.390.0100.00714.57
5.6.380.0050.00514.38
5.6.370.0060.00613.99
5.6.360.0030.01214.18
5.6.350.0000.01514.56
5.6.340.0080.00814.10
5.6.330.0090.00914.25
5.6.320.0030.01414.29
5.6.310.0070.01014.59
5.6.300.0030.01014.24
5.6.290.0030.01314.36
5.6.280.0010.04317.76
5.6.270.0150.00014.36
5.6.260.0030.01414.27
5.6.250.0000.00914.83
5.6.240.0040.01114.44
5.6.230.0070.00714.16
5.6.220.0030.01213.90
5.6.210.0100.04617.57
5.6.200.0040.02816.20
5.6.190.0060.02517.53
5.6.180.1780.02317.33
5.6.170.0240.03417.40
5.6.160.0030.05017.49
5.6.150.0030.04516.23
5.6.140.0090.02016.24
5.6.130.0050.02716.16
5.6.120.0060.04017.76
5.6.110.0070.02317.54
5.6.100.0060.03817.69
5.6.90.0080.02517.70
5.6.80.0070.04517.14
5.6.70.2250.02517.41
5.6.60.0000.01314.16
5.6.50.0040.01114.09
5.6.40.0000.01214.07
5.6.30.0000.01514.44
5.6.20.0070.01014.34
5.6.10.0110.00414.24
5.6.00.0070.01014.46
5.5.380.0090.00614.38
5.5.370.0070.01014.45
5.5.360.0080.01214.61
5.5.350.0070.04117.50
5.5.340.0080.04216.04
5.5.330.0090.03317.45
5.5.320.0180.04017.35
5.5.310.0150.02217.31
5.5.300.0080.04316.36
5.5.290.0100.02716.27
5.5.280.0030.04817.78
5.5.270.0060.02117.43
5.5.260.0070.04517.67
5.5.250.0070.04717.38
5.5.240.0120.04217.28
5.5.230.0100.00314.48
5.5.220.0030.00514.37
5.5.210.0100.00314.38
5.5.200.0030.01014.33
5.5.190.0030.01014.42
5.5.180.0040.01114.37
5.5.170.0060.00314.54
5.5.160.0030.00714.50
5.5.150.0090.00614.07
5.5.140.0110.00414.50
5.5.130.0000.01513.91
5.5.120.0080.00514.55
5.5.110.0040.00714.34
5.5.100.0070.00714.21
5.5.90.0030.01014.64
5.5.80.0080.00814.50
5.5.70.0090.00614.13
5.5.60.0030.01014.41
5.5.50.0070.00714.59
5.5.40.0060.00614.68
5.5.30.0060.00614.19
5.5.20.0110.00314.14
5.5.10.0070.01014.49
5.5.00.0070.00714.46
5.4.450.0160.02615.22
5.4.440.0170.02515.18
5.4.430.0030.02015.28
5.4.420.0930.01315.25
5.4.410.0050.03014.99
5.4.400.0120.02314.96
5.4.390.0020.03214.84
5.4.380.0130.03114.96
5.4.370.0070.03314.96
5.4.360.0180.03514.94
5.4.350.0120.02814.99
5.4.340.0100.02914.80
5.4.330.0080.00311.13
5.4.320.0060.02411.85
5.4.310.0040.02811.80
5.4.300.0060.02211.89
5.4.290.0050.02111.86
5.4.280.0090.01611.84
5.4.270.0020.02311.85
5.4.260.0060.02211.73
5.4.250.0040.02411.87
5.4.240.0040.02311.73
5.4.230.0060.01911.73
5.4.220.0070.02511.86
5.4.210.0050.02011.79
5.4.200.0060.02011.79
5.4.190.0050.02211.79
5.4.180.0040.02111.72
5.4.170.0040.02211.82
5.4.160.0050.02111.76
5.4.150.0060.02011.82
5.4.140.0070.01911.59
5.4.130.0050.01911.64
5.4.120.0080.01911.60
5.4.110.0080.01911.54
5.4.100.0030.02211.73
5.4.90.0070.02011.54
5.4.80.0080.02011.61
5.4.70.0070.02011.56
5.4.60.0070.02211.54
5.4.50.0070.02211.70
5.4.40.0020.02211.53
5.4.30.0060.02011.61
5.4.20.0020.02311.53
5.4.10.0020.02111.55
5.4.00.0050.02011.34
5.3.290.0050.02111.94
5.3.280.0060.02111.89
5.3.270.0040.02411.90
5.3.260.0040.02511.90
5.3.250.0040.02411.90
5.3.240.0030.02211.90
5.3.230.0050.02011.90
5.3.220.0040.02111.88
5.3.210.0070.02311.88
5.3.200.0040.02811.88
5.3.190.0040.02811.88
5.3.180.0060.02811.88
5.3.170.0070.02011.88
5.3.160.0050.02411.88
5.3.150.0050.02411.88
5.3.140.0080.01911.87
5.3.130.0050.02111.87
5.3.120.0040.02411.87
5.3.110.0060.02411.87
5.3.100.0070.02611.60
5.3.90.0070.01911.59
5.3.80.0050.01911.58
5.3.70.0090.01911.58
5.3.60.0050.02011.57
5.3.50.0060.02111.54
5.3.40.0050.02111.54
5.3.30.0040.02211.53
5.3.20.0060.02011.42
5.3.10.0030.02311.40
5.3.00.0040.02011.39
5.2.170.0090.0319.18
5.2.160.0030.0309.18
5.2.150.0120.0239.18
5.2.140.0040.0329.18
5.2.130.0040.0309.14
5.2.120.0040.0309.14
5.2.110.0040.0309.15
5.2.100.0040.0289.14
5.2.90.0050.0299.14
5.2.80.0080.0289.14
5.2.70.0060.0299.14
5.2.60.0030.0329.09
5.2.50.0040.0329.06
5.2.40.0030.0309.03
5.2.30.0060.0289.01
5.2.20.0020.0319.01
5.2.10.0030.0298.92
5.2.00.0040.0298.76
5.1.60.0030.0258.05
5.1.50.0010.0288.05
5.1.40.0040.0248.04
5.1.30.0010.0288.38
5.1.20.0020.0288.41
5.1.10.0060.0268.13
5.1.00.0070.0248.13
5.0.50.0010.0276.61
5.0.40.0030.0286.46
5.0.30.0060.0426.29
5.0.20.0040.0276.26
5.0.10.0060.0206.23
5.0.00.0080.0366.22
4.4.90.0060.0194.78
4.4.80.0020.0224.75
4.4.70.0030.0174.75
4.4.60.0030.0174.75
4.4.50.0040.0214.77
4.4.40.0040.0314.71
4.4.30.0040.0164.75
4.4.20.0030.0174.84
4.4.10.0030.0214.85
4.4.00.0040.0294.76
4.3.110.0030.0164.67
4.3.100.0020.0164.66
4.3.90.0040.0144.64
4.3.80.0020.0264.58
4.3.70.0020.0164.63
4.3.60.0030.0144.63
4.3.50.0040.0174.63
4.3.40.0030.0244.54
4.3.30.0020.0163.29
4.3.20.0020.0173.26
4.3.10.0020.0163.23
4.3.00.0030.01315.08

preferences:
52.08 ms | 401 KiB | 5 Q