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.0040.01118.39
8.3.50.0050.01221.86
8.3.40.0150.00018.69
8.3.30.0160.00319.15
8.3.20.0040.00420.20
8.3.10.0080.00021.95
8.3.00.0040.00422.39
8.2.180.0060.01316.50
8.2.170.0110.00322.96
8.2.160.0030.01420.90
8.2.150.0040.00424.18
8.2.140.0000.00724.66
8.2.130.0040.00426.16
8.2.120.0040.00419.23
8.2.110.0060.00320.52
8.2.100.0060.00617.91
8.2.90.0000.00819.20
8.2.80.0000.00817.97
8.2.70.0040.00419.35
8.2.60.0050.00318.03
8.2.50.0040.00418.10
8.2.40.0060.00320.64
8.2.30.0080.00018.10
8.2.20.0000.00817.61
8.2.10.0040.00419.63
8.2.00.0060.00317.82
8.1.280.0190.00325.92
8.1.270.0080.00021.96
8.1.260.0080.00026.35
8.1.250.0040.00428.09
8.1.240.0070.00322.20
8.1.230.0080.00417.83
8.1.220.0050.00317.74
8.1.210.0000.00818.77
8.1.200.0060.00317.50
8.1.190.0030.00617.36
8.1.180.0040.00418.10
8.1.170.0050.00318.60
8.1.160.0040.00422.04
8.1.150.0000.00718.56
8.1.140.0040.00417.53
8.1.130.0000.00717.88
8.1.120.0030.00317.50
8.1.110.0070.00017.44
8.1.100.0000.00717.49
8.1.90.0040.00417.40
8.1.80.0070.00017.36
8.1.70.0030.00317.45
8.1.60.0000.00817.63
8.1.50.0040.00417.59
8.1.40.0040.00417.57
8.1.30.0060.00317.70
8.1.20.0000.00817.64
8.1.10.0040.00417.63
8.1.00.0000.00817.45
8.0.300.0040.00418.77
8.0.290.0040.00416.88
8.0.280.0000.00818.40
8.0.270.0030.00317.31
8.0.260.0070.00016.73
8.0.250.0070.00016.86
8.0.240.0050.00316.86
8.0.230.0030.00316.84
8.0.220.0000.00716.89
8.0.210.0000.00716.82
8.0.200.0100.00017.00
8.0.190.0080.00016.85
8.0.180.0080.00316.99
8.0.170.0040.00416.92
8.0.160.0030.00416.89
8.0.150.0030.00316.80
8.0.140.0000.00816.86
8.0.130.0060.00313.31
8.0.120.0040.00416.86
8.0.110.0040.00416.95
8.0.100.0050.00216.91
8.0.90.0030.00516.89
8.0.80.0060.00916.92
8.0.70.0030.00516.78
8.0.60.0040.00416.80
8.0.50.0050.00217.02
8.0.30.0100.01217.27
8.0.20.0100.00917.40
8.0.10.0040.00417.00
8.0.00.0080.00916.72
7.4.330.0020.00215.03
7.4.320.0030.00316.66
7.4.300.0040.00416.62
7.4.290.0000.00716.58
7.4.280.0000.00716.45
7.4.270.0000.01016.54
7.4.260.0000.00816.61
7.4.250.0000.00716.48
7.4.240.0000.00716.54
7.4.230.0040.00416.70
7.4.220.0100.00716.38
7.4.210.0060.00916.57
7.4.200.0000.00816.32
7.4.190.0030.00316.50
7.4.160.0080.00816.34
7.4.150.0090.00917.40
7.4.140.0130.00517.86
7.4.130.0110.00916.51
7.4.120.0070.01016.58
7.4.110.0120.00416.37
7.4.100.0140.00416.50
7.4.90.0120.00616.35
7.4.80.0070.01119.39
7.4.70.0090.00616.35
7.4.60.0110.00516.57
7.4.50.0050.00316.19
7.4.40.0120.00622.77
7.4.30.0030.01316.68
7.4.00.0060.00914.92
7.3.330.0000.00513.34
7.3.320.0000.00513.17
7.3.310.0030.00516.33
7.3.300.0050.00216.25
7.3.290.0100.00316.35
7.3.280.0050.01116.33
7.3.270.0120.00617.40
7.3.260.0090.01516.34
7.3.250.0110.00716.48
7.3.240.0130.00316.66
7.3.230.0100.01416.54
7.3.210.0070.01016.24
7.3.200.0140.00719.39
7.3.190.0060.01016.46
7.3.180.0140.00316.62
7.3.170.0090.00916.27
7.3.160.0060.01116.41
7.3.120.0100.00514.80
7.3.110.0030.01414.68
7.3.100.0100.01014.94
7.3.90.0060.00914.94
7.3.80.0030.00914.82
7.3.70.0060.00614.97
7.3.60.0030.00914.87
7.3.50.0100.00314.76
7.3.40.0060.00914.88
7.3.30.0130.00014.70
7.3.20.0060.00616.66
7.3.10.0040.01216.46
7.3.00.0030.01616.52
7.2.330.0110.00816.51
7.2.320.0130.01016.73
7.2.310.0030.01316.82
7.2.300.0080.01216.77
7.2.290.0090.00916.80
7.2.250.0070.01014.87
7.2.240.0090.00914.84
7.2.230.0040.01415.33
7.2.220.0030.01015.17
7.2.210.0100.00314.80
7.2.200.0090.00015.19
7.2.190.0090.00614.88
7.2.180.0030.01015.10
7.2.170.0030.01215.09
7.2.160.0060.01214.98
7.2.150.0100.00716.77
7.2.140.0070.01116.86
7.2.130.0120.00317.03
7.2.120.0050.01316.77
7.2.110.0060.00617.13
7.2.100.0050.00516.78
7.2.90.0060.01016.86
7.2.80.0090.00317.13
7.2.70.0140.00017.15
7.2.60.0140.01016.72
7.2.50.0030.01216.81
7.2.40.0090.00616.91
7.2.30.0030.01017.16
7.2.20.0100.00016.94
7.2.10.0080.00417.09
7.2.00.0070.00618.34
7.1.330.0030.01415.98
7.1.320.0000.01415.76
7.1.310.0100.00315.72
7.1.300.0060.00615.84
7.1.290.0060.00316.02
7.1.280.0040.00415.87
7.1.270.0030.01415.85
7.1.260.0110.00415.79
7.1.250.0060.01015.94
7.1.240.0100.00015.87
7.1.230.0030.01015.93
7.1.220.0060.00615.79
7.1.210.0060.00615.71
7.1.200.0040.01115.62
7.1.190.0070.00715.80
7.1.180.0100.00315.96
7.1.170.0060.00315.75
7.1.160.0030.01015.61
7.1.150.0030.01015.68
7.1.140.0080.00415.86
7.1.130.0000.01115.73
7.1.120.0030.00615.59
7.1.110.0110.00315.87
7.1.100.0050.00917.12
7.1.90.0030.01015.79
7.1.80.0060.00615.93
7.1.70.0040.00716.51
7.1.60.0110.00717.87
7.1.50.0090.00516.52
7.1.40.0070.00715.71
7.1.30.0000.01215.71
7.1.20.0070.00715.61
7.1.10.0060.01015.53
7.1.00.0070.04018.95
7.0.330.0030.01015.27
7.0.320.0050.00515.41
7.0.310.0030.00915.42
7.0.300.0040.01115.61
7.0.290.0030.01015.45
7.0.280.0070.00715.42
7.0.270.0030.01015.22
7.0.260.0000.01115.43
7.0.250.0000.01315.64
7.0.240.0090.00315.52
7.0.230.0060.00615.35
7.0.220.0040.00715.43
7.0.210.0120.00315.57
7.0.200.0040.00715.98
7.0.190.0040.00815.40
7.0.180.0000.01415.60
7.0.170.0000.01415.36
7.0.160.0000.01415.50
7.0.150.0060.00615.45
7.0.140.0050.03818.79
7.0.130.0030.01015.64
7.0.120.0060.00915.26
7.0.110.0040.01415.56
7.0.100.0070.00415.30
7.0.90.0040.00415.31
7.0.80.0060.00615.59
7.0.70.0070.01015.32
7.0.60.0140.03617.75
7.0.50.0060.04516.62
7.0.40.0070.03116.97
7.0.30.0150.02916.88
7.0.20.0100.02516.92
7.0.10.0080.02816.85
7.0.00.0050.04716.79
5.6.400.0070.01114.43
5.6.390.0150.00314.72
5.6.380.0120.00314.29
5.6.370.0100.00314.76
5.6.360.0060.00914.49
5.6.350.0060.00614.47
5.6.340.0000.01114.39
5.6.330.0040.00814.54
5.6.320.0120.00314.69
5.6.310.0000.00914.69
5.6.300.0130.00314.64
5.6.290.0060.00614.29
5.6.280.0090.03717.71
5.6.270.0030.01414.39
5.6.260.0030.01014.56
5.6.250.0110.00714.42
5.6.240.0000.01114.23
5.6.230.0030.01014.43
5.6.220.0060.00614.58
5.6.210.0050.02417.43
5.6.200.0050.02516.43
5.6.190.0090.02017.44
5.6.180.2120.02717.60
5.6.170.0120.03217.42
5.6.160.0100.04317.47
5.6.150.0060.04616.40
5.6.140.0080.02616.30
5.6.130.0070.04716.29
5.6.120.0080.04417.81
5.6.110.0070.04017.75
5.6.100.0070.04817.67
5.6.90.0070.04717.80
5.6.80.0080.03717.37
5.6.70.1700.02217.36
5.6.60.0070.00714.53
5.6.50.0090.00314.38
5.6.40.0040.01414.16
5.6.30.0030.01314.46
5.6.20.0030.01014.48
5.6.10.0070.00714.16
5.6.00.0100.00714.32
5.5.380.0100.00314.10
5.5.370.0060.00614.08
5.5.360.0090.00614.53
5.5.350.0050.04417.38
5.5.340.0030.02316.33
5.5.330.0050.03017.34
5.5.320.0220.03017.30
5.5.310.0100.02517.50
5.5.300.0020.02716.10
5.5.290.0050.03516.14
5.5.280.0110.04017.77
5.5.270.0070.04617.63
5.5.260.0030.02617.60
5.5.250.0050.02917.59
5.5.240.0250.03217.21
5.5.230.0040.01114.25
5.5.220.0090.00614.49
5.5.210.0000.01514.35
5.5.200.0070.01014.00
5.5.190.0080.00814.36
5.5.180.0000.01314.25
5.5.170.0070.00714.70
5.5.160.0070.01114.41
5.5.150.0100.00614.57
5.5.140.0120.00314.17
5.5.130.0040.00414.39
5.5.120.0060.00914.55
5.5.110.0070.00714.49
5.5.100.0060.00914.43
5.5.90.0030.00614.34
5.5.80.0040.01114.41
5.5.70.0030.00714.32
5.5.60.0000.01314.44
5.5.50.0040.00814.20
5.5.40.0030.00614.44
5.5.30.0060.00314.34
5.5.20.0030.01214.50
5.5.10.0060.00914.45
5.5.00.0030.00914.18
5.4.450.0100.03416.13
5.4.440.0300.02016.12
5.4.430.0180.02716.12
5.4.420.0170.02116.13
5.4.410.0070.02915.84
5.4.400.0050.03015.63
5.4.390.0040.03115.65
5.4.380.0130.03415.62
5.4.370.0140.03015.74
5.4.360.0220.02515.65
5.4.350.0070.03515.73
5.4.340.0110.03115.78
5.4.330.0040.00412.72
5.4.320.0060.02112.62
5.4.310.0050.02712.62
5.4.300.0060.02212.62
5.4.290.0020.02312.62
5.4.280.0080.02312.57
5.4.270.0050.02112.55
5.4.260.0080.02012.55
5.4.250.0050.02312.55
5.4.240.0040.02512.55
5.4.230.0040.02412.54
5.4.220.0080.02212.55
5.4.210.0040.02412.55
5.4.200.0060.02112.54
5.4.190.0090.01812.54
5.4.180.0020.02212.55
5.4.170.0040.02312.55
5.4.160.0030.02112.55
5.4.150.0060.02112.55
5.4.140.0040.02412.39
5.4.130.0070.01912.38
5.4.120.0050.02212.36
5.4.110.0060.02012.36
5.4.100.0060.02412.36
5.4.90.0060.02112.36
5.4.80.0060.02412.36
5.4.70.0060.02112.36
5.4.60.0040.02212.36
5.4.50.0050.02412.36
5.4.40.0090.01912.35
5.4.30.0050.02212.35
5.4.20.0050.02012.35
5.4.10.0060.01812.35
5.4.00.0060.02112.09
5.3.290.0100.02412.76
5.3.280.0040.02312.72
5.3.270.0050.02312.72
5.3.260.0080.01912.72
5.3.250.0060.02312.72
5.3.240.0040.02512.72
5.3.230.0060.02212.71
5.3.220.0080.01812.70
5.3.210.0030.02412.70
5.3.200.0040.02312.70
5.3.190.0020.02612.70
5.3.180.0080.01912.70
5.3.170.0070.02012.70
5.3.160.0070.02112.70
5.3.150.0080.01912.70
5.3.140.0030.02412.69
5.3.130.0040.02512.69
5.3.120.0050.02212.69
5.3.110.0090.01912.69
5.3.100.0060.02112.42
5.3.90.0050.02212.41
5.3.80.0040.02312.40
5.3.70.0050.01912.40
5.3.60.0020.02412.39
5.3.50.0040.02312.37
5.3.40.0050.02412.37
5.3.30.0060.02212.35
5.3.20.0040.02112.24
5.3.10.0020.02112.22
5.3.00.0020.02412.21
5.2.170.0050.0319.18
5.2.160.0040.0309.18
5.2.150.0020.0339.18
5.2.140.0100.0269.18
5.2.130.0050.0299.14
5.2.120.0060.0329.14
5.2.110.0050.0289.15
5.2.100.0080.0269.14
5.2.90.0060.0279.14
5.2.80.0100.0339.14
5.2.70.0050.0329.14
5.2.60.0070.0329.09
5.2.50.0010.0349.06
5.2.40.0010.0339.03
5.2.30.0060.0289.01
5.2.20.0030.0309.01
5.2.10.0050.0278.92
5.2.00.0050.0298.76
5.1.60.0050.0278.05
5.1.50.0040.0318.05
5.1.40.0040.0258.04
5.1.30.0050.0258.38
5.1.20.0040.0268.41
5.1.10.0100.0198.13
5.1.00.0060.0238.13
5.0.50.0010.0226.61
5.0.40.0020.0206.46
5.0.30.0060.0296.29
5.0.20.0070.0176.25
5.0.10.0050.0266.23
5.0.00.0040.0306.22
4.4.90.0020.0164.78
4.4.80.0050.0134.76
4.4.70.0020.0184.75
4.4.60.0050.0154.75
4.4.50.0010.0174.77
4.4.40.0030.0244.71
4.4.30.0030.0154.76
4.4.20.0030.0154.85
4.4.10.0040.0154.85
4.4.00.0010.0274.76
4.3.110.0040.0154.67
4.3.100.0030.0174.66
4.3.90.0020.0164.63
4.3.80.0030.0254.58
4.3.70.0020.0154.63
4.3.60.0030.0154.63
4.3.50.0030.0214.63
4.3.40.0050.0284.54
4.3.30.0020.0173.28
4.3.20.0020.0163.27
4.3.10.0020.0193.23
4.3.00.0000.01315.08

preferences:
87.88 ms | 401 KiB | 5 Q