3v4l.org

run code in 300+ PHP versions simultaneously
<?php class App { public static $classes = array(); public static function register($name, Callable $generator) { App::$classes[$name] = $generator; } public static function make($name) { if (!isset(App::$classes[$name])) { throw new Exception('Invalid class name'); } return App::$classes[$name](); } } // Internal declaration class Foo { public static function bar() { return 'static'; } } App::register('foo', function() { return new Foo; }); // Internal Usage class SomeController { public function view() { 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.0120.00318.18
8.3.50.0120.00521.93
8.3.40.0110.00418.62
8.3.30.0090.00619.22
8.3.20.0040.00420.21
8.3.10.0080.00022.04
8.3.00.0080.00022.52
8.2.180.0140.00416.75
8.2.170.0140.00022.96
8.2.160.0100.00720.77
8.2.150.0000.00824.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0000.00819.48
8.2.110.0030.00719.33
8.2.100.0000.01217.91
8.2.90.0040.00419.21
8.2.80.0060.00317.97
8.2.70.0000.00817.75
8.2.60.0090.00017.93
8.2.50.0110.00018.10
8.2.40.0080.00018.34
8.2.30.0070.00018.06
8.2.20.0040.00417.75
8.2.10.0040.00419.44
8.2.00.0000.00817.84
8.1.280.0150.00625.92
8.1.270.0080.00021.88
8.1.260.0000.00826.35
8.1.250.0030.00528.09
8.1.240.0060.00322.62
8.1.230.0080.00317.78
8.1.220.0080.00017.74
8.1.210.0050.00318.77
8.1.200.0030.00617.47
8.1.190.0090.00017.11
8.1.180.0030.00718.10
8.1.170.0040.00418.70
8.1.160.0040.00421.99
8.1.150.0000.00718.66
8.1.140.0040.00417.46
8.1.130.0050.00217.85
8.1.120.0000.00717.36
8.1.110.0050.00317.38
8.1.100.0040.00417.41
8.1.90.0040.00417.45
8.1.80.0070.00017.46
8.1.70.0030.00317.43
8.1.60.0030.00517.60
8.1.50.0000.00817.59
8.1.40.0030.00617.50
8.1.30.0000.00817.63
8.1.20.0030.00517.59
8.1.10.0060.00317.55
8.1.00.0020.00517.45
8.0.300.0030.00518.77
8.0.290.0040.00416.63
8.0.280.0070.00018.38
8.0.270.0000.00717.27
8.0.260.0030.00316.93
8.0.250.0040.00417.05
8.0.240.0000.00817.04
8.0.230.0050.00317.00
8.0.220.0030.00517.00
8.0.210.0030.00316.87
8.0.200.0000.01116.93
8.0.190.0040.00416.99
8.0.180.0040.00417.01
8.0.170.0000.00717.07
8.0.160.0040.00417.02
8.0.150.0000.00716.99
8.0.140.0000.00816.87
8.0.130.0030.00313.42
8.0.120.0030.00516.96
8.0.110.0000.00716.90
8.0.100.0050.00316.82
8.0.90.0000.00817.02
8.0.80.0130.00717.02
8.0.70.0050.00216.94
8.0.60.0050.00217.02
8.0.50.0040.00417.00
8.0.30.0120.01117.30
8.0.20.0170.00517.40
8.0.10.0040.00417.05
8.0.00.0100.01016.61
7.4.330.0050.00015.14
7.4.320.0030.00316.58
7.4.300.0000.00716.66
7.4.290.0030.00316.49
7.4.280.0040.00416.55
7.4.270.0030.00616.48
7.4.260.0000.00716.53
7.4.250.0040.00416.50
7.4.240.0040.00416.50
7.4.230.0070.00016.51
7.4.220.0100.01016.53
7.4.210.0060.00816.52
7.4.200.0000.00716.42
7.4.190.0040.00316.62
7.4.160.0040.01116.44
7.4.150.0040.01417.40
7.4.140.0140.00517.86
7.4.130.0110.00916.55
7.4.120.0080.00916.51
7.4.110.0060.01216.42
7.4.100.0120.00616.49
7.4.90.0090.00916.59
7.4.80.0130.00319.39
7.4.70.0060.00916.40
7.4.60.0090.00716.41
7.4.50.0040.00416.43
7.4.40.0030.01322.77
7.4.30.0090.01316.49
7.4.00.0060.01015.26
7.3.330.0000.00613.35
7.3.320.0060.00013.37
7.3.310.0030.00316.28
7.3.300.0000.00816.25
7.3.290.0070.01016.36
7.3.280.0060.00816.37
7.3.270.0080.01217.40
7.3.260.0180.00316.71
7.3.250.0100.01016.48
7.3.240.0100.01016.46
7.3.230.0090.00916.40
7.3.210.0060.01016.46
7.3.200.0120.00619.39
7.3.190.0060.01016.52
7.3.180.0160.00516.66
7.3.170.0090.01216.36
7.3.160.0040.01216.41
7.3.120.0060.00914.88
7.3.10.0000.01016.75
7.3.00.0090.00316.71
7.2.330.0170.00016.81
7.2.320.0090.01316.26
7.2.310.0070.01416.73
7.2.300.0130.00416.45
7.2.290.0100.00616.40
7.2.130.0090.00316.88
7.2.120.0040.00716.98
7.2.110.0030.01017.03
7.2.100.0090.00317.08
7.2.90.0100.00716.93
7.2.80.0030.01016.98
7.2.70.0040.00816.98
7.2.60.0050.01216.84
7.2.50.0100.00316.76
7.2.40.0030.01016.98
7.2.30.0080.00516.80
7.2.20.0070.00716.84
7.2.10.0070.00316.91
7.2.00.0070.00518.24
7.1.250.0000.01015.83
7.1.200.0040.00815.83
7.1.100.0030.01018.34
7.1.70.0050.00317.30
7.1.60.0100.01419.82
7.1.50.0100.01016.69
7.1.00.0030.07722.52
7.0.200.0150.00716.69
7.0.140.0030.06721.99
7.0.60.0070.03720.05
7.0.50.0030.08017.70
7.0.40.0130.05020.18
7.0.30.0330.04720.26
7.0.20.0330.07320.26
7.0.10.0270.07720.11
7.0.00.0030.09020.21
5.6.280.0100.06721.11
5.6.210.0100.06320.51
5.6.200.0130.07318.24
5.6.190.0030.04320.50
5.6.180.2930.04320.33
5.6.170.0230.04720.48
5.6.160.0030.08720.61
5.6.150.0070.03718.18
5.6.140.0130.07018.21
5.6.130.0100.06718.24
5.6.120.0100.08021.03
5.6.110.0030.07321.15
5.6.100.0130.03321.08
5.6.90.0000.04721.09
5.6.80.0070.08020.54
5.6.70.3370.03320.44
5.5.350.0030.08020.39
5.5.340.0170.06318.07
5.5.330.0070.06320.19
5.5.320.0500.05320.27
5.5.310.0200.04720.27
5.5.300.0070.08317.99
5.5.290.0030.06018.08
5.5.280.0200.06720.87
5.5.270.0030.06020.86
5.5.260.0170.08020.80
5.5.250.0130.08020.70
5.5.240.0170.07020.29
5.4.450.0400.04319.55
5.4.440.0400.03019.28
5.4.430.0930.04019.41
5.4.420.0500.04719.45
5.4.410.0170.04718.92
5.4.400.0030.05718.79
5.4.390.0100.05318.57
5.4.380.0130.07318.62
5.4.370.0330.04718.75
5.4.360.0130.05718.84
5.4.350.0200.05718.47
5.4.340.0500.05718.57
5.4.320.0100.03512.51
5.4.310.0040.04012.51
5.4.300.0060.04312.52
5.4.290.0050.03912.51
5.4.280.0060.03812.41
5.4.270.0080.03612.37
5.4.260.0060.03812.38
5.4.250.0040.04112.38
5.4.240.0070.04612.37
5.4.230.0060.04012.37
5.4.220.0060.03912.37
5.4.210.0080.03712.37
5.4.200.0080.05212.36
5.4.190.0060.03912.37
5.4.180.0100.04912.36
5.4.170.0050.04012.38
5.4.160.0050.03912.37
5.4.150.0070.04112.37
5.4.140.0090.05412.05
5.4.130.0060.04012.04
5.4.120.0050.03612.00
5.4.110.0040.03712.00
5.4.100.0060.03512.00
5.4.90.0100.03412.00
5.4.80.0100.03811.99
5.4.70.0080.03411.99
5.4.60.0070.03511.99
5.4.50.0050.04011.98
5.4.40.0110.04111.96
5.4.30.0070.03611.97
5.4.20.0060.03511.96
5.4.10.0030.03811.96
5.4.00.0050.03711.46
5.3.290.0110.03712.80
5.3.280.0070.03612.70
5.3.270.0060.04412.72
5.3.260.0080.04912.72
5.3.250.0040.05012.72
5.3.240.0060.03712.72
5.3.230.0060.03712.71
5.3.220.0080.03712.68
5.3.210.0030.04312.68
5.3.200.0070.03812.68
5.3.190.0100.05212.68
5.3.180.0090.04612.68
5.3.170.0090.03712.67
5.3.160.0060.03612.67
5.3.150.0050.03912.67
5.3.140.0040.03912.66
5.3.130.0070.03912.66
5.3.120.0080.03912.66
5.3.110.0050.04012.66
5.3.100.0070.03512.12
5.3.90.0060.03812.09
5.3.80.0030.03912.07
5.3.70.0070.03412.08
5.3.60.0080.03512.07
5.3.50.0140.05512.00
5.3.40.0030.04212.00
5.3.30.0050.03711.96
5.3.20.0050.04011.75
5.3.10.0060.03711.71
5.3.00.0080.03511.69
5.2.170.0060.0309.19
5.2.160.0030.0319.20
5.2.150.0060.0299.19
5.2.140.0040.0329.19
5.2.130.0060.0369.15
5.2.120.0090.0289.15
5.2.110.0060.0299.16
5.2.100.0030.0329.17
5.2.90.0050.0309.16
5.2.80.0050.0319.15
5.2.70.0070.0349.15
5.2.60.0090.0399.10
5.2.50.0090.0459.07
5.2.40.0110.0409.04
5.2.30.0070.0329.02
5.2.20.0060.0359.01
5.2.10.0090.0308.92
5.2.00.0080.0338.77
5.1.60.0070.0238.06
5.1.50.0070.0278.06
5.1.40.0070.0308.05
5.1.30.0100.0368.39
5.1.20.0100.0388.43
5.1.10.0090.0348.15
5.1.00.0070.0368.14
5.0.50.0040.0286.63
5.0.40.0040.0286.48
5.0.30.0040.0426.30
5.0.20.0060.0246.26
5.0.10.0080.0196.23
5.0.00.0060.0366.23
4.4.90.0070.0194.78
4.4.80.0020.0234.75
4.4.70.0010.0234.76
4.4.60.0040.0164.76
4.4.50.0030.0224.77
4.4.40.0050.0314.71
4.4.30.0060.0254.76
4.4.20.0040.0194.84
4.4.10.0030.0174.85
4.4.00.0030.0274.76
4.3.110.0050.0194.67
4.3.100.0050.0144.66
4.3.90.0010.0174.63
4.3.80.0040.0304.59
4.3.70.0050.0204.63
4.3.60.0000.0184.63
4.3.50.0040.0144.63
4.3.40.0020.0254.53
4.3.30.0020.0163.28
4.3.20.0030.0153.27
4.3.10.0050.0133.23
4.3.00.0070.02013.29

preferences:
49.91 ms | 401 KiB | 5 Q