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($name) { if (!isset($this::$classes[$name])) { throw new Exception('Invalid class name'); } $classes &= $this::$classes; return $classes[$name](); } } $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.0120.00318.43
8.3.50.0090.01122.10
8.3.40.0090.00618.83
8.3.30.0140.00319.18
8.3.20.0040.00420.20
8.3.10.0050.00322.01
8.3.00.0030.00522.52
8.2.180.0130.00717.00
8.2.170.0030.01718.91
8.2.160.0100.00322.96
8.2.150.0080.00024.18
8.2.140.0000.00824.66
8.2.130.0080.00026.16
8.2.120.0080.00019.48
8.2.110.0000.00822.33
8.2.100.0040.00719.64
8.2.90.0070.00019.20
8.2.80.0100.00317.97
8.2.70.0080.00317.75
8.2.60.0030.00517.93
8.2.50.0070.00318.07
8.2.40.0050.00318.34
8.2.30.0070.00018.09
8.2.20.0090.00017.89
8.2.10.0030.00519.48
8.2.00.0040.00417.84
8.1.280.0150.00625.92
8.1.270.0060.00322.01
8.1.260.0000.00826.35
8.1.250.0030.00528.09
8.1.240.0100.00323.97
8.1.230.0110.00019.16
8.1.220.0080.00017.74
8.1.210.0030.00618.77
8.1.200.0060.00317.35
8.1.190.0040.00417.63
8.1.180.0000.00818.10
8.1.170.0030.00618.50
8.1.160.0050.00222.06
8.1.150.0040.00418.63
8.1.140.0040.00417.44
8.1.130.0030.00317.71
8.1.120.0040.00417.55
8.1.110.0040.00417.47
8.1.100.0000.00717.51
8.1.90.0000.00717.52
8.1.80.0070.00017.50
8.1.70.0000.00717.34
8.1.60.0000.00917.61
8.1.50.0040.00417.60
8.1.40.0030.00617.59
8.1.30.0030.00517.58
8.1.20.0000.00817.64
8.1.10.0030.00617.64
8.1.00.0050.00317.62
8.0.300.0040.00418.77
8.0.290.0000.00717.18
8.0.280.0030.00318.48
8.0.270.0030.00317.20
8.0.260.0050.00316.97
8.0.250.0040.00417.03
8.0.240.0040.00417.01
8.0.230.0020.00517.02
8.0.220.0000.00716.99
8.0.210.0000.00717.00
8.0.200.0070.00416.91
8.0.190.0030.00617.08
8.0.180.0100.00017.01
8.0.170.0000.00717.00
8.0.160.0080.00017.01
8.0.150.0050.00216.90
8.0.140.0040.00416.98
8.0.130.0040.00413.38
8.0.120.0040.00416.86
8.0.110.0000.00716.98
8.0.100.0000.00816.93
8.0.90.0000.00816.97
8.0.80.0070.00717.03
8.0.70.0040.00416.88
8.0.60.0000.00816.97
8.0.50.0000.00716.93
8.0.30.0110.01117.10
8.0.20.0140.00517.40
8.0.10.0040.00417.17
8.0.00.0100.00716.94
7.4.330.0000.00515.09
7.4.320.0060.00016.50
7.4.300.0040.00416.52
7.4.290.0070.00016.62
7.4.280.0000.00716.52
7.4.270.0000.01016.21
7.4.260.0030.00716.66
7.4.250.0050.00316.62
7.4.240.0000.00816.58
7.4.230.0030.00316.38
7.4.220.0110.00716.45
7.4.210.0080.00516.54
7.4.200.0040.00416.72
7.4.190.0040.00416.62
7.4.160.0040.01516.47
7.4.150.0100.00917.40
7.4.140.0120.00617.86
7.4.130.0060.01216.59
7.4.120.0080.00916.58
7.4.110.0070.01016.61
7.4.100.0000.01816.49
7.4.90.0110.00716.72
7.4.80.0110.01119.39
7.4.70.0080.00816.57
7.4.60.0140.00316.37
7.4.50.0040.00416.71
7.4.40.0100.00722.77
7.4.30.0060.01116.73
7.4.00.0060.01015.07
7.3.330.0030.00313.29
7.3.320.0030.00313.43
7.3.310.0040.00416.46
7.3.300.0030.00316.52
7.3.290.0120.00416.45
7.3.280.0070.00916.45
7.3.270.0100.00717.40
7.3.260.0090.01216.43
7.3.250.0060.01316.55
7.3.240.0110.00616.44
7.3.230.0150.00316.45
7.3.210.0070.01016.70
7.3.200.0060.01219.39
7.3.190.0120.00316.61
7.3.180.0100.00716.70
7.3.170.0100.00616.53
7.3.160.0080.00816.52
7.3.120.0080.00414.74
7.3.110.0000.01414.61
7.3.100.0100.00315.14
7.3.90.0000.00814.77
7.3.80.0060.00314.57
7.3.70.0070.00715.02
7.3.60.0030.00614.96
7.3.50.0040.00814.71
7.3.40.0000.01514.73
7.3.30.0030.01014.94
7.3.20.0040.00716.40
7.3.10.0090.00616.73
7.3.00.0000.01016.82
7.2.330.0090.00916.44
7.2.320.0060.01316.88
7.2.310.0060.01216.61
7.2.300.0090.00916.86
7.2.290.0130.00316.82
7.2.240.0030.01214.75
7.2.230.0030.00714.84
7.2.220.0000.01115.41
7.2.210.0120.00315.01
7.2.200.0040.00715.01
7.2.190.0030.00915.00
7.2.180.0040.00715.25
7.2.170.0040.01115.06
7.2.160.0090.00015.07
7.2.150.0040.01217.06
7.2.140.0070.00716.93
7.2.130.0070.00717.10
7.2.120.0110.00316.87
7.2.110.0040.00716.73
7.2.100.0100.00316.84
7.2.90.0070.00717.20
7.2.80.0080.00416.85
7.2.70.0000.01117.18
7.2.60.0040.01217.03
7.2.50.0030.00916.54
7.2.40.0040.00416.97
7.2.30.0100.00716.88
7.2.20.0090.00616.90
7.2.10.0040.00816.96
7.2.00.0020.01418.27
7.1.330.0090.00616.05
7.1.320.0110.00415.73
7.1.310.0030.01015.84
7.1.300.0030.00915.88
7.1.290.0040.00815.96
7.1.280.0030.01015.63
7.1.270.0060.00615.77
7.1.260.0000.00915.93
7.1.250.0000.01015.77
7.1.200.0100.00315.89
7.1.100.0070.00418.00
7.1.70.0000.01016.84
7.1.60.0060.01919.82
7.1.50.0090.00317.05
7.1.00.0100.06322.42
7.0.200.0090.00016.74
7.0.140.0000.07722.09
7.0.60.0000.06719.93
7.0.50.0030.05717.73
7.0.40.0030.04320.13
7.0.30.0230.04320.16
7.0.20.0270.08320.30
7.0.10.0070.08720.33
7.0.00.0070.08320.22
5.6.280.0070.07020.96
5.6.210.0070.08020.52
5.6.200.0070.06018.15
5.6.190.0070.04020.57
5.6.180.0170.06320.52
5.6.170.0200.07320.47
5.6.160.0100.08320.51
5.6.150.0100.03318.21
5.6.140.0070.06018.24
5.6.130.0000.07018.15
5.6.120.0130.07021.13
5.6.110.0100.07721.13
5.6.100.0070.05321.01
5.6.90.0130.05721.11
5.6.80.0070.07020.30
5.5.350.0070.07720.29
5.5.340.0030.04018.02
5.5.330.0100.08020.35
5.5.320.0030.05020.35
5.5.310.0200.04320.34
5.5.300.0130.07718.08
5.5.290.0130.07018.08
5.5.280.0130.07720.99
5.5.270.0170.07720.73
5.5.260.0030.04320.81
5.5.250.0000.08720.63
5.5.240.0470.06320.27
5.4.450.0470.06319.47
5.4.440.0770.05019.60
5.4.430.0030.06319.53
5.4.420.0630.06019.43
5.4.410.0770.06319.48
5.4.400.0070.05719.24
5.4.390.0670.05719.37
5.4.380.0230.07018.52
5.4.370.0330.04718.48
5.4.360.0130.05718.75
5.4.350.0300.05018.73
5.4.340.0170.05718.76
5.4.320.0040.03912.52
5.4.310.0050.04012.52
5.4.300.0070.03712.52
5.4.290.0080.04212.52
5.4.280.0080.03712.42
5.4.270.0060.03712.38
5.4.260.0040.03912.38
5.4.250.0050.04012.38
5.4.240.0060.04112.38
5.4.230.0090.03812.37
5.4.220.0040.03812.37
5.4.210.0060.03512.37
5.4.200.0050.03812.38
5.4.190.0060.03612.37
5.4.180.0090.03912.37
5.4.170.0060.03612.38
5.4.160.0070.04012.38
5.4.150.0090.03612.37
5.4.140.0070.03812.06
5.4.130.0080.03512.04
5.4.120.0030.03912.00
5.4.110.0060.03612.00
5.4.100.0050.03611.99
5.4.90.0020.04012.00
5.4.80.0040.03812.00
5.4.70.0070.03312.00
5.4.60.0070.03411.99
5.4.50.0040.03811.99
5.4.40.0070.03311.97
5.4.30.0070.03411.98
5.4.20.0070.03411.97
5.4.10.0040.03611.98
5.4.00.0090.03211.46
5.3.290.0110.04112.80
5.3.280.0070.03912.71
5.3.270.0060.04312.73
5.3.260.0090.03712.72
5.3.250.0090.04112.72
5.3.240.0070.03612.72
5.3.230.0110.03212.71
5.3.220.0060.03712.68
5.3.210.0040.04012.68
5.3.200.0090.03512.68
5.3.190.0080.04612.68
5.3.180.0050.03712.67
5.3.170.0070.03512.67
5.3.160.0050.03612.67
5.3.150.0050.04412.67
5.3.140.0040.04812.66
5.3.130.0070.03812.66
5.3.120.0080.03812.66
5.3.110.0060.03912.66
5.3.100.0050.04412.12
5.3.90.0050.03612.09
5.3.80.0070.03612.07
5.3.70.0030.04112.07
5.3.60.0030.04012.07
5.3.50.0040.04112.00
5.3.40.0040.03712.01
5.3.30.0040.03611.97
5.3.20.0030.03811.75
5.3.10.0070.03311.72
5.3.00.0060.03811.70
5.2.170.0010.0349.18
5.2.160.0070.0339.18
5.2.150.0080.0399.18
5.2.140.0040.0319.18
5.2.130.0050.0289.14
5.2.120.0070.0259.14
5.2.110.0030.0319.14
5.2.100.0050.0329.15
5.2.90.0050.0299.14
5.2.80.0060.0299.14
5.2.70.0060.0289.13
5.2.60.0060.0309.09
5.2.50.0060.0389.06
5.2.40.0050.0299.04
5.2.30.0030.0319.01
5.2.20.0090.0269.01
5.2.10.0050.0358.92
5.2.00.0050.0308.77
5.1.60.0070.0228.05
5.1.50.0050.0248.05
5.1.40.0030.0258.04
5.1.30.0050.0258.39
5.1.20.0040.0278.42
5.1.10.0040.0288.13
5.1.00.0060.0278.13
5.0.50.0050.0216.61
5.0.40.0040.0196.47
5.0.30.0030.0316.28
5.0.20.0020.0236.25
5.0.10.0040.0266.23
5.0.00.0050.0346.22
4.4.90.0050.0164.78
4.4.80.0030.0174.75
4.4.70.0010.0174.75
4.4.60.0040.0144.75
4.4.50.0030.0154.77
4.4.40.0030.0254.71
4.4.30.0000.0184.76
4.4.20.0030.0154.84
4.4.10.0030.0144.85
4.4.00.0050.0264.76
4.3.110.0020.0204.67
4.3.100.0030.0144.66
4.3.90.0040.0134.64
4.3.80.0030.0264.58
4.3.70.0070.0104.63
4.3.60.0010.0164.63
4.3.50.0020.0164.63
4.3.40.0040.0234.54
4.3.30.0020.0183.29
4.3.20.0030.0193.27
4.3.10.0010.0173.23
4.3.00.0000.0236.22

preferences:
43.94 ms | 401 KiB | 5 Q