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.40.0120.00319.02
8.3.30.0040.01119.07
8.3.20.0040.00419.99
8.3.10.0080.00022.13
8.3.00.0030.00622.45
8.2.170.0070.01422.96
8.2.160.0070.01020.98
8.2.150.0080.00024.18
8.2.140.0090.00024.66
8.2.130.0050.00326.16
8.2.120.0080.00019.24
8.2.110.0060.00322.11
8.2.100.0060.00617.84
8.2.90.0040.00419.17
8.2.80.0060.00317.97
8.2.70.0030.00617.63
8.2.60.0050.00317.93
8.2.50.0030.00618.07
8.2.40.0040.00418.16
8.2.30.0040.00418.02
8.2.20.0070.00017.65
8.2.10.0050.00319.64
8.2.00.0040.00417.76
8.1.270.0030.00623.71
8.1.260.0030.00526.35
8.1.250.0080.00028.09
8.1.240.0030.00623.83
8.1.230.0080.00318.98
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0000.00817.66
8.1.180.0030.00518.10
8.1.170.0000.00818.50
8.1.160.0080.00021.91
8.1.150.0030.00518.62
8.1.140.0040.00417.52
8.1.130.0000.00717.87
8.1.120.0040.00417.46
8.1.110.0050.00317.51
8.1.100.0040.00417.51
8.1.90.0040.00417.46
8.1.80.0000.00817.48
8.1.70.0040.00417.43
8.1.60.0040.00417.62
8.1.50.0040.00417.58
8.1.40.0040.00417.43
8.1.30.0080.00017.54
8.1.20.0080.00017.67
8.1.10.0060.00317.60
8.1.00.0000.00717.42
8.0.300.0000.00818.77
8.0.290.0040.00416.93
8.0.280.0040.00418.46
8.0.270.0000.00717.18
8.0.260.0030.00316.83
8.0.250.0000.00716.89
8.0.240.0030.00616.81
8.0.230.0000.00716.95
8.0.220.0000.00716.90
8.0.210.0030.00316.86
8.0.200.0050.00516.87
8.0.190.0030.00416.90
8.0.180.0030.00616.82
8.0.170.0000.00716.93
8.0.160.0060.00317.00
8.0.150.0000.00716.93
8.0.140.0040.00416.83
8.0.130.0030.00413.29
8.0.120.0050.00316.95
8.0.110.0080.00016.81
8.0.100.0000.00716.90
8.0.90.0000.00716.78
8.0.80.0120.00916.93
8.0.70.0030.00516.93
8.0.60.0080.00016.73
8.0.50.0040.00416.70
8.0.30.0080.01117.23
8.0.20.0120.00917.40
8.0.10.0000.00816.91
8.0.00.0100.00716.86
7.4.330.0020.00215.00
7.4.320.0000.00616.67
7.4.300.0050.00316.64
7.4.290.0030.00316.61
7.4.280.0000.00716.60
7.4.270.0000.00716.64
7.4.260.0050.00516.52
7.4.250.0050.00316.47
7.4.240.0010.00616.58
7.4.230.0040.00416.57
7.4.220.0140.00416.68
7.4.210.0070.00916.63
7.4.200.0040.00416.55
7.4.190.0030.00316.34
7.4.160.0100.00716.39
7.4.150.0150.00317.40
7.4.140.0090.01017.86
7.4.130.0130.00316.47
7.4.120.0100.00816.48
7.4.110.0090.00916.37
7.4.100.0060.01216.45
7.4.90.0120.01216.39
7.4.80.0100.01319.39
7.4.70.0040.01216.55
7.4.60.0110.00716.52
7.4.50.0030.00616.29
7.4.40.0050.00822.77
7.4.30.0060.01116.67
7.4.10.0090.00914.96
7.4.00.0070.00915.12
7.3.330.0060.00013.45
7.3.320.0020.00213.39
7.3.310.0000.00716.38
7.3.300.0040.00416.23
7.3.290.0050.00816.38
7.3.280.0100.00816.35
7.3.270.0140.00417.40
7.3.260.0040.01516.35
7.3.250.0140.00816.54
7.3.240.0100.00716.58
7.3.230.0060.01416.44
7.3.210.0140.00316.67
7.3.200.0120.00919.39
7.3.190.0150.00316.35
7.3.180.0000.01716.48
7.3.170.0110.01116.40
7.3.160.0060.01016.48
7.3.130.0060.01114.80
7.3.120.0070.00814.88
7.3.110.0130.00615.09
7.3.100.0030.01014.78
7.3.90.0000.01514.89
7.3.80.0100.00714.76
7.3.70.0030.00614.84
7.3.60.0000.01814.80
7.3.50.0000.01115.03
7.3.40.0080.00814.82
7.3.30.0070.00714.48
7.3.20.0100.00316.70
7.3.10.0070.00716.84
7.3.00.0100.00316.81
7.2.330.0060.01216.66
7.2.320.0060.01216.77
7.2.310.0110.01116.39
7.2.300.0100.00716.61
7.2.290.0060.01716.89
7.2.260.0040.01415.20
7.2.250.0100.00715.27
7.2.240.0000.01415.13
7.2.230.0030.01015.03
7.2.220.0090.00615.17
7.2.210.0030.01314.92
7.2.200.0070.00715.06
7.2.190.0030.00614.98
7.2.180.0030.01015.26
7.2.170.0070.00715.18
7.2.160.0030.01014.95
7.2.150.0000.01417.13
7.2.140.0130.00316.95
7.2.130.0070.01017.11
7.2.120.0100.00016.97
7.2.110.0030.01416.73
7.2.100.0070.00716.96
7.2.90.0000.01516.80
7.2.80.0100.00717.13
7.2.70.0030.01517.09
7.2.60.0050.01017.01
7.2.50.0030.00916.82
7.2.40.0070.01117.05
7.2.30.0040.01116.97
7.2.20.0070.00717.14
7.2.10.0060.00916.96
7.2.00.0020.00918.23
7.1.330.0040.01115.63
7.1.320.0040.00716.05
7.1.310.0110.00415.84
7.1.300.0030.01015.78
7.1.290.0060.00615.94
7.1.280.0040.00415.69
7.1.270.0030.00615.76
7.1.260.0050.00515.82
7.1.250.0000.01315.61
7.1.240.0030.00915.73
7.1.230.0000.01415.91
7.1.220.0000.01115.84
7.1.210.0000.01415.91
7.1.200.0020.01015.80
7.1.190.0000.01015.93
7.1.180.0070.00715.90
7.1.170.0080.00415.80
7.1.160.0120.00315.92
7.1.150.0070.00715.79
7.1.140.0030.01015.99
7.1.130.0110.00715.84
7.1.120.0030.01315.79
7.1.110.0030.00915.89
7.1.100.0030.01117.11
7.1.90.0130.00015.54
7.1.80.0060.00615.87
7.1.70.0040.00616.46
7.1.60.0050.01317.78
7.1.50.0030.01316.38
7.1.40.0040.00816.01
7.1.30.0080.00415.88
7.1.20.0030.01315.88
7.1.10.0070.00715.77
7.1.00.0050.04219.20
7.0.330.0000.01015.14
7.0.320.0030.01015.47
7.0.310.0100.00715.34
7.0.300.0070.00715.52
7.0.290.0110.00315.27
7.0.280.0090.00315.24
7.0.270.0050.00515.60
7.0.260.0080.00315.32
7.0.250.0070.00715.34
7.0.240.0000.01515.62
7.0.230.0000.01415.45
7.0.220.0070.00715.61
7.0.210.0030.01015.54
7.0.200.0050.00516.04
7.0.190.0060.00315.55
7.0.180.0040.00815.30
7.0.170.0090.00015.26
7.0.160.0070.00715.38
7.0.150.0100.00315.57
7.0.140.0030.03818.76
7.0.130.0060.00615.54
7.0.120.0030.01315.35
7.0.110.0100.00715.38
7.0.100.0000.00915.22
7.0.90.0090.00315.46
7.0.80.0030.00915.45
7.0.70.0030.01015.46
7.0.60.0050.02917.75
7.0.50.0060.03316.60
7.0.40.0100.02316.90
7.0.30.0150.02616.89
7.0.20.0130.02816.86
7.0.10.0130.04016.83
7.0.00.0070.04516.84
5.6.400.0070.00414.15
5.6.390.0070.00313.93
5.6.380.0030.00613.98
5.6.370.0060.00914.27
5.6.360.0000.01413.79
5.6.350.0100.00614.18
5.6.340.0030.00614.21
5.6.330.0030.00614.23
5.6.320.0030.01014.15
5.6.310.0040.01114.35
5.6.300.0030.00614.11
5.6.290.0080.00313.99
5.6.280.0060.04017.66
5.6.270.0080.00814.28
5.6.260.0130.00314.15
5.6.250.0070.01014.01
5.6.240.0070.00714.27
5.6.230.0030.00614.32
5.6.220.0030.00914.37
5.6.210.0100.04017.29
5.6.200.0050.02516.15
5.6.190.0090.04717.31
5.6.180.0220.02317.34
5.6.170.0180.04017.39
5.6.160.0100.04817.34
5.6.150.0070.03516.08
5.6.140.0070.03316.15
5.6.130.0100.04316.07
5.6.120.0030.04817.57
5.6.110.0070.04217.51
5.6.100.0050.02917.57
5.6.90.0080.03517.60
5.6.80.0000.04517.26
5.6.70.0000.00914.16
5.6.60.0040.01114.17
5.6.50.0090.00014.25
5.6.40.0070.00713.98
5.6.30.0030.00713.91
5.6.20.0000.01314.00
5.6.10.0000.01113.96
5.6.00.0030.01214.14
5.5.380.0000.01114.15
5.5.370.0050.00513.93
5.5.360.0030.00714.20
5.5.350.0020.05117.12
5.5.340.0050.04515.96
5.5.330.0110.04517.32
5.5.320.0880.02517.09
5.5.310.0180.04016.97
5.5.300.0070.03816.08
5.5.290.0100.04315.86
5.5.280.0070.03417.45
5.5.270.0160.03717.53
5.5.260.0110.03317.33
5.5.250.0090.04217.30
5.5.240.0050.03717.14
5.5.230.0030.01013.91
5.5.220.0000.01113.74
5.5.210.0030.00913.72
5.5.200.0040.00413.92
5.5.190.0000.01613.94
5.5.180.0040.00813.98
5.5.170.0040.01114.10
5.5.160.0030.01014.27
5.5.150.0040.00713.68
5.5.140.0030.00913.89
5.5.130.0070.00714.07
5.5.120.0080.00313.95
5.5.110.0080.00814.13
5.5.100.0060.00613.72
5.5.90.0080.00414.00
5.5.80.0040.01114.07
5.5.70.0000.01113.81
5.5.60.0000.00813.91
5.5.50.0070.00713.88
5.5.40.0000.01413.78
5.5.30.0070.00713.79
5.5.20.0090.00613.73
5.5.10.0040.01213.77
5.5.00.0030.00713.63
5.4.450.0180.02915.26
5.4.440.0320.02515.42
5.4.430.0150.02815.41
5.4.420.0420.02415.25
5.4.410.0120.02515.19
5.4.400.0030.03114.91
5.4.390.0090.02714.96
5.4.380.0100.03115.04
5.4.370.0120.02915.04
5.4.360.0170.02515.06
5.4.350.0130.03115.05
5.4.340.0120.03215.06
5.4.330.0090.00311.34
5.4.320.0040.02411.94
5.4.310.0080.02211.93
5.4.300.0060.02211.93
5.4.290.0040.02211.93
5.4.280.0070.02011.88
5.4.270.0050.02211.87
5.4.260.0030.02111.87
5.4.250.0040.02111.87
5.4.240.0040.02011.87
5.4.230.0040.02311.86
5.4.220.0060.02011.86
5.4.210.0050.01911.86
5.4.200.0020.02411.86
5.4.190.0050.02111.86
5.4.180.0080.01911.86
5.4.170.0040.02211.86
5.4.160.0070.01811.86
5.4.150.0040.02411.86
5.4.140.0030.02411.71
5.4.130.0040.02211.70
5.4.120.0060.02111.68
5.4.110.0050.02111.68
5.4.100.0040.02311.68
5.4.90.0060.01911.68
5.4.80.0100.01911.68
5.4.70.0030.02211.68
5.4.60.0010.02411.67
5.4.50.0040.02111.68
5.4.40.0050.02111.67
5.4.30.0080.01811.66
5.4.20.0050.02111.66
5.4.10.0050.02211.67
5.4.00.0060.01911.41
5.3.290.0030.02412.07
5.3.280.0020.02712.03
5.3.270.0040.02212.04
5.3.260.0080.02112.03
5.3.250.0030.02312.03
5.3.240.0070.02312.03
5.3.230.0070.02312.03
5.3.220.0020.02212.01
5.3.210.0050.02212.01
5.3.200.0060.01812.01
5.3.190.0050.02112.01
5.3.180.0050.02212.01
5.3.170.0020.02412.01
5.3.160.0020.02312.01
5.3.150.0060.02112.01
5.3.140.0040.02112.00
5.3.130.0060.02112.00
5.3.120.0040.02412.00
5.3.110.0030.02512.00
5.3.100.0040.02211.73
5.3.90.0070.02011.71
5.3.80.0050.02011.71
5.3.70.0060.02011.71
5.3.60.0070.02311.70
5.3.50.0060.01911.67
5.3.40.0010.02811.67
5.3.30.0020.02111.66
5.3.20.0030.02211.54
5.3.10.0020.02511.53
5.3.00.0070.02011.52
5.2.170.0030.0319.18
5.2.160.0050.0329.18
5.2.150.0040.0319.18
5.2.140.0040.0309.18
5.2.130.0020.0349.14
5.2.120.0040.0299.14
5.2.110.0060.0289.15
5.2.100.0040.0289.14
5.2.90.0040.0319.14
5.2.80.0050.0319.14
5.2.70.0030.0329.13
5.2.60.0040.0299.09
5.2.50.0120.0249.06
5.2.40.0050.0319.03
5.2.30.0050.0319.01
5.2.20.0060.0279.02
5.2.10.0060.0268.92
5.2.00.0050.0288.77
5.1.60.0020.0268.05
5.1.50.0030.0268.05
5.1.40.0050.0258.04
5.1.30.0030.0378.38
5.1.20.0040.0288.42
5.1.10.0040.0268.13
5.1.00.0050.0248.13
5.0.50.0040.0206.61
5.0.40.0060.0236.46
5.0.30.0060.0366.29
5.0.20.0020.0236.26
5.0.10.0030.0236.23
5.0.00.0030.0336.22
4.4.90.0020.0214.78
4.4.80.0030.0154.75
4.4.70.0040.0164.76
4.4.60.0050.0154.76
4.4.50.0030.0154.77
4.4.40.0030.0284.71
4.4.30.0010.0174.76
4.4.20.0060.0174.84
4.4.10.0040.0194.85
4.4.00.0050.0304.76
4.3.110.0030.0224.67
4.3.100.0030.0214.66
4.3.90.0040.0164.64
4.3.80.0020.0264.58
4.3.70.0010.0164.63
4.3.60.0030.0194.63
4.3.50.0030.0154.63
4.3.40.0010.0264.54
4.3.30.0020.0163.29
4.3.20.0020.0163.27
4.3.10.0020.0163.23
4.3.00.0030.01315.08

preferences:
43.24 ms | 400 KiB | 5 Q