3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * Module creator */ Class Module { public function __construct($module) { $this->module = new System; } public function extensions($extension) { // In real life, we scan the $extension directory for class names // For now we hardcode a few here return [ 'SystemSettingsProfile', 'SystemSettingsPrivacy', 'SystemSettingsAccount', ]; } } /** * System service provider */ class System {} /** * System profile extensions */ abstract class Extension { public function render() { return get_called_class(); } public static function getTabs() { return get_called_class(); } } class SystemSettingsProfile extends Extension {} class SystemSettingsPrivacy extends Extension {} class SystemSettingsAccount extends Extension {} /** * Controller */ class Controller { public function index() { $extensions = (new Module('system'))->extensions('profile'); foreach($extensions as $extension) { $tabs[] = $extension::getTabs(); // Real-life: control structure checks if route key matches extension key // Except now we just keep overriding $content with the last $content = (new $extension)->render(); } var_dump($tabs, $content); } } (new Controller)->index();

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.0150.00618.80
8.3.30.0030.01219.05
8.3.20.0080.00020.29
8.3.10.0060.00320.21
8.3.00.0080.00019.38
8.2.170.0040.01122.96
8.2.160.0030.01020.42
8.2.150.0040.00424.18
8.2.140.0080.00024.66
8.2.130.0040.00426.16
8.2.120.0080.00022.16
8.2.110.0060.00322.24
8.2.100.0090.00317.89
8.2.90.0020.00519.21
8.2.80.0050.00317.97
8.2.70.0000.00817.63
8.2.60.0030.00618.02
8.2.50.0040.00418.07
8.2.40.0030.00618.16
8.2.30.0040.00419.16
8.2.20.0000.00717.65
8.2.10.0040.00418.18
8.2.00.0050.00217.74
8.1.270.0000.00923.96
8.1.260.0000.00826.35
8.1.250.0000.00828.09
8.1.240.0090.00023.67
8.1.230.0100.00319.00
8.1.220.0030.00617.79
8.1.210.0000.00718.77
8.1.200.0060.00317.35
8.1.190.0040.00417.35
8.1.180.0050.00318.10
8.1.170.0000.01118.50
8.1.160.0030.00521.92
8.1.150.0050.00218.93
8.1.140.0070.00017.45
8.1.130.0030.00317.70
8.1.120.0000.00717.47
8.1.110.0080.00017.43
8.1.100.0040.00417.36
8.1.90.0080.00017.32
8.1.80.0030.00717.47
8.1.70.0070.00017.40
8.1.60.0030.00617.47
8.1.50.0000.00717.41
8.1.40.0050.00317.39
8.1.30.0000.00817.59
8.1.20.0050.00317.52
8.1.10.0050.00217.43
8.1.00.0000.00817.39
8.0.300.0040.00418.77
8.0.290.0000.00716.75
8.0.280.0030.00318.30
8.0.270.0000.00717.29
8.0.260.0030.00317.36
8.0.250.0000.00716.84
8.0.240.0000.00716.84
8.0.230.0040.00416.98
8.0.220.0000.00716.84
8.0.210.0000.00716.90
8.0.200.0000.00716.94
8.0.190.0000.00816.94
8.0.180.0000.00816.95
8.0.170.0050.00316.92
8.0.160.0070.00016.93
8.0.150.0040.00416.79
8.0.140.0040.00416.82
8.0.130.0060.00013.30
8.0.120.0040.00416.75
8.0.110.0030.00716.73
8.0.100.0040.00416.78
8.0.90.0000.00816.76
8.0.80.0120.00916.82
8.0.70.0030.00516.95
8.0.60.0040.00416.67
8.0.50.0040.00416.84
8.0.30.0120.01017.09
8.0.20.0150.00817.40
8.0.10.0030.00617.03
8.0.00.0120.00916.78
7.4.330.0050.00015.14
7.4.320.0000.00616.62
7.4.300.0030.00316.54
7.4.290.0000.00616.48
7.4.280.0000.00816.62
7.4.270.0000.00716.43
7.4.260.0000.00716.58
7.4.250.0030.00516.55
7.4.240.0020.00516.47
7.4.230.0070.00016.43
7.4.220.0100.01016.54
7.4.210.0090.00616.50
7.4.200.0070.00016.49
7.4.160.0120.00416.36
7.4.150.0120.01217.40
7.4.140.0080.01217.86
7.4.130.0090.01016.42
7.4.120.0090.00816.50
7.4.110.0090.00816.65
7.4.100.0160.01016.63
7.4.90.0190.00716.54
7.4.80.0040.01316.57
7.4.70.0110.00516.50
7.4.60.0100.00616.38
7.4.50.0040.00416.56
7.4.40.0040.01216.62
7.4.30.0070.01016.39
7.4.10.0040.01515.00
7.4.00.0090.00814.97
7.3.330.0000.00613.37
7.3.320.0050.00013.39
7.3.310.0030.00316.39
7.3.300.0000.00616.34
7.3.290.0070.00716.31
7.3.280.0090.01016.33
7.3.270.0100.01017.40
7.3.260.0190.00616.51
7.3.250.0070.01216.41
7.3.240.0060.01116.53
7.3.230.0040.01316.39
7.3.210.0100.00716.34
7.3.200.0040.01219.39
7.3.190.0160.00616.38
7.3.180.0140.00516.53
7.3.170.0040.01216.56
7.3.160.0070.01016.29
7.3.130.0080.01215.00
7.3.120.0050.01214.77
7.3.110.0110.00614.72
7.3.100.0030.01314.91
7.3.90.0100.00714.78
7.3.80.0040.01014.82
7.3.70.0050.00714.68
7.3.60.0040.00914.99
7.3.50.0050.00814.91
7.3.40.0020.00914.96
7.3.30.0030.00914.79
7.3.20.0040.00616.75
7.3.10.0070.00716.61
7.3.00.0060.00716.73
7.2.330.0100.00616.86
7.2.320.0090.00916.65
7.2.310.0100.01316.55
7.2.300.0070.01016.66
7.2.290.0100.00716.64
7.2.260.0060.01315.11
7.2.250.0080.00915.06
7.2.240.0090.00814.94
7.2.230.0060.01215.08
7.2.220.0080.00615.04
7.2.210.0020.01215.20
7.2.200.0040.00715.22
7.2.190.0060.00815.09
7.2.180.0020.01114.96
7.2.170.0060.00615.05
7.2.160.0050.01014.96
7.2.150.0050.01016.73
7.2.140.0030.01016.78
7.2.130.0070.00716.80
7.2.120.0090.00616.98
7.2.110.0070.00617.01
7.2.100.0040.01016.88
7.2.90.0040.00916.89
7.2.80.0090.00516.93
7.2.70.0090.00616.93
7.2.60.0030.01016.88
7.2.50.0080.00816.89
7.2.40.0100.00516.86
7.2.30.0060.00816.84
7.2.20.0090.00716.97
7.2.10.0060.00616.99
7.2.00.0080.00916.82
7.1.330.0050.01015.82
7.1.320.0080.00715.72
7.1.310.0060.00915.72
7.1.300.0060.00915.72
7.1.290.0090.00515.78
7.1.280.0040.00815.90
7.1.270.0070.00815.79
7.1.260.0010.00915.93
7.1.250.0070.00615.77
7.1.240.0030.00815.76
7.1.230.0070.00815.67
7.1.220.0020.01115.81
7.1.210.0010.01215.78
7.1.200.0060.00915.71
7.1.190.0060.00915.64
7.1.180.0080.00615.81
7.1.170.0110.00515.68
7.1.160.0040.00815.80
7.1.150.0080.00715.72
7.1.140.0060.00815.80
7.1.130.0040.00915.66
7.1.120.0090.00615.69
7.1.110.0070.01015.73
7.1.100.0060.00815.91
7.1.90.0080.00815.76
7.1.80.0070.00515.87
7.1.70.0040.01016.20
7.1.60.0060.00916.13
7.1.50.0030.01116.16
7.1.40.0040.00915.77
7.1.30.0090.00615.80
7.1.20.0040.01015.73
7.1.10.0060.01015.72
7.1.00.0080.02317.40
7.0.330.0040.00915.43
7.0.320.0060.00815.17
7.0.310.0090.00215.37
7.0.300.0070.00615.42
7.0.290.0030.00915.41
7.0.280.0060.00715.20
7.0.270.0090.00315.23
7.0.260.0090.00615.41
7.0.250.0060.00815.32
7.0.240.0110.00315.40
7.0.230.0110.00615.42
7.0.220.0040.00915.44
7.0.210.0070.00615.20
7.0.200.0060.01115.78
7.0.190.0030.00715.41
7.0.180.0080.00715.53
7.0.170.0070.00815.24
7.0.160.0050.00715.41
7.0.150.0060.00715.45
7.0.140.0060.02517.09
7.0.130.0090.00315.42
7.0.120.0080.00615.40
7.0.110.0080.00715.46
7.0.100.0070.00815.51
7.0.90.0100.00715.37
7.0.80.0060.00815.45
7.0.70.0050.01015.38
7.0.60.0090.02616.59
7.0.50.0080.02116.09
7.0.40.0080.02815.00
7.0.30.0130.02215.15
7.0.20.0090.01715.09
7.0.10.0060.01815.18
7.0.00.0090.02415.06
5.6.400.0040.00614.44
5.6.390.0080.00514.45
5.6.380.0060.00914.48
5.6.370.0080.00814.52
5.6.360.0070.00914.54
5.6.350.0090.00714.54
5.6.340.0070.00914.32
5.6.330.0020.01414.36
5.6.320.0110.00514.50
5.6.310.0080.00714.32
5.6.300.0070.01014.20
5.6.290.0110.00514.52
5.6.280.0070.00914.52
5.6.270.0090.00414.27
5.6.260.0090.00514.38
5.6.250.0020.01214.38
5.6.240.0090.00714.45
5.6.230.0080.00614.48
5.6.220.0080.00614.29
5.6.210.0090.02615.98
5.6.200.0070.02815.38
5.6.190.0070.02715.95
5.6.180.0140.01416.01
5.6.170.0100.01715.92
5.6.160.0060.02815.90
5.6.150.0080.02315.34
5.6.140.0080.01315.38
5.6.130.0080.01415.43
5.6.120.0060.02315.95
5.6.110.0080.02515.92
5.6.100.0060.01815.96
5.6.90.0040.02616.08
5.6.80.0040.02715.77
5.6.70.0040.01214.41
5.6.60.0080.00714.52
5.6.50.0020.00914.27
5.6.40.0100.00414.31
5.6.30.0020.01014.21
5.6.20.0090.00314.32
5.6.10.0080.00914.22
5.6.00.0060.00614.31
5.5.380.0070.00613.35
5.5.370.0060.00813.42
5.5.360.0040.01213.15
5.5.350.0110.02615.28
5.5.340.0080.01514.47
5.5.330.0080.02414.99
5.5.320.0120.02215.03
5.5.310.0100.02615.05
5.5.300.0080.01414.50
5.5.290.0040.02614.37
5.5.280.0050.02715.22
5.5.270.0060.01815.24
5.5.260.0060.02815.14
5.5.250.0070.02215.06
5.5.240.0090.02214.99
5.5.230.0040.00913.24
5.5.220.0050.00813.07
5.5.210.0010.00813.14
5.5.200.0060.00813.03
5.5.190.0090.00413.22
5.5.180.0050.00613.25
5.5.170.0080.00812.94
5.5.160.0080.00313.25
5.5.150.0020.01013.18
5.5.140.0060.00713.24
5.5.130.0050.00913.41
5.5.120.0070.00613.37
5.5.110.0050.00713.31
5.5.100.0070.00813.13
5.5.90.0080.00713.11
5.5.80.0040.01013.19
5.5.70.0070.00713.30
5.5.60.0050.00713.31
5.5.50.0020.01313.18
5.5.40.0090.00413.35
5.5.30.0070.00713.25
5.5.20.0030.01213.10
5.5.10.0050.00813.29
5.5.00.0060.00713.21
5.4.450.0060.02013.32
5.4.440.0270.02013.38
5.4.430.0300.01813.36
5.4.420.0320.01813.39
5.4.410.0230.02513.33
5.4.400.0260.01513.30
5.4.390.0230.02213.20
5.4.380.0090.02013.20
5.4.370.0150.02013.15
5.4.360.0160.01313.18
5.4.350.0100.01713.11
5.4.340.0060.02213.19
5.4.330.0060.00611.37
5.4.320.0040.01311.60
5.4.310.0060.01411.60
5.4.300.0040.01511.63
5.4.290.0040.01511.58
5.4.280.0020.01711.60
5.4.270.0040.01711.61
5.4.260.0080.01111.60
5.4.250.0050.01611.56
5.4.240.0040.01411.67
5.4.230.0060.01411.49
5.4.220.0050.01311.55
5.4.210.0060.01311.50
5.4.200.0070.01311.59
5.4.190.0050.01511.46
5.4.180.0050.01511.53
5.4.170.0040.01811.59
5.4.160.0030.01611.59
5.4.150.0040.01311.59
5.4.140.0030.01511.40
5.4.130.0040.01211.45
5.4.120.0060.01411.49
5.4.110.0060.01311.58
5.4.100.0070.01311.57
5.4.90.0060.01311.53
5.4.80.0040.01411.54
5.4.70.0060.01311.53
5.4.60.0060.01211.54
5.4.50.0050.01311.56
5.4.40.0060.01311.55
5.4.30.0040.01211.48
5.4.20.0060.01311.49
5.4.10.0050.01311.59
5.4.00.0050.01411.28
5.3.290.0030.02211.85
5.3.280.0050.02211.80
5.3.270.0030.02311.81
5.3.260.0060.02211.81
5.3.250.0080.01911.81
5.3.240.0070.02011.81
5.3.230.0100.02211.80
5.3.220.0070.02111.79
5.3.210.0090.02011.79
5.3.200.0070.02011.79
5.3.190.0070.02111.79
5.3.180.0060.02011.79
5.3.170.0020.02611.78
5.3.160.0080.02011.79
5.3.150.0070.02111.79
5.3.140.0060.02311.78
5.3.130.0020.02711.78
5.3.120.0110.02211.78
5.3.110.0060.02311.78
5.3.100.0060.02111.51
5.3.90.0060.02011.50
5.3.80.0070.02011.50
5.3.70.0060.02011.50
5.3.60.0070.02011.49
5.3.50.0080.01811.46
5.3.40.0070.01911.46
5.3.30.0060.02111.44
5.3.20.0040.02111.33
5.3.10.0040.01911.32
5.3.00.0050.01811.31
5.2.170.0080.01410.06
5.2.160.0060.01510.06
5.2.150.0060.01710.06
5.2.140.0080.01410.06
5.2.130.0030.01710.04
5.2.120.0060.01610.04
5.2.110.0040.01510.04
5.2.100.0040.01510.04
5.2.90.0030.01810.04
5.2.80.0060.01410.04
5.2.70.0060.01410.04
5.2.60.0040.01810.02
5.2.50.0060.01710.00
5.2.40.0040.0199.99
5.2.30.0020.0219.97
5.2.20.0050.0169.97
5.2.10.0050.0179.92
5.2.00.0030.0189.86
5.1.60.0040.0139.50
5.1.50.0030.0169.50
5.1.40.0030.0149.48
5.1.30.0050.0139.66
5.1.20.0040.0159.67
5.1.10.0040.0169.54
5.1.00.0040.0139.54
5.0.50.0020.0148.78
5.0.40.0020.0118.70
5.0.30.0030.0168.61
5.0.20.0010.0138.59
5.0.10.0050.0098.58
5.0.00.0040.0168.58
4.4.90.0030.0087.84
4.4.80.0030.0117.82
4.4.70.0020.0117.82
4.4.60.0030.0107.83
4.4.50.0020.0117.84
4.4.40.0020.0167.80
4.4.30.0030.0087.83
4.4.20.0040.0107.87
4.4.10.0020.0097.87
4.4.00.0040.0157.83
4.3.110.0040.0097.78
4.3.100.0020.0117.78
4.3.90.0030.0117.77
4.3.80.0020.0197.74
4.3.70.0040.0107.76
4.3.60.0020.0117.76
4.3.50.0040.0097.76
4.3.40.0040.0197.72
4.3.30.0020.0137.10
4.3.20.0010.0137.09
4.3.10.0030.0107.07
4.3.00.0020.0148.88

preferences:
43.87 ms | 400 KiB | 5 Q