3v4l.org

run code in 500+ PHP versions simultaneously
<?php trait OverloadConstructor { public function __construct(... $args) { $length = strlen('initMethod'); foreach (get_class_methods($this) as $method) { if (substr($method, 0, $length) === 'initMethod') { $this->{$method}(... $args); } } } } trait Init1 { protected function initMethodInit1(... $args) { echo 'initMethodInit1' . PHP_EOL; } } trait Init2 { protected function initMethodInit2(... $args) { echo 'initMethodInit2' . PHP_EOL; } } class InitTest { use OverloadConstructor, Init1; protected function initMethodInitTest(... $args) { echo 'initMethodInitTest' . PHP_EOL; } } class ChangeBehaviourOfInitTest extends InitTest { use Init2; protected function initMethodChangeBehaviourOfInitTest(... $args) { echo 'initMethodChangeBehaviourOfInitTest' . PHP_EOL; } } new InitTest(); new ChangeBehaviourOfInitTest();

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.5.80.0100.00716.85
8.5.70.0070.00716.80
8.5.60.0120.00716.75
8.5.50.0060.00316.67
8.5.30.0110.00619.59
8.5.20.0090.00819.30
8.5.10.0100.00818.53
8.5.00.0150.00720.24
8.4.230.0120.00722.29
8.4.220.0140.00719.80
8.4.210.0070.00419.62
8.4.180.0140.00819.55
8.4.170.0110.01125.49
8.4.160.0130.01023.93
8.4.150.0080.00416.77
8.4.140.0140.00817.59
8.4.130.0110.00719.25
8.4.120.0120.00820.61
8.4.110.0120.00922.54
8.4.100.0130.00717.82
8.4.90.0090.00918.84
8.4.80.0150.00817.99
8.4.70.0080.00517.75
8.4.60.0090.00820.36
8.4.50.0110.00919.35
8.4.40.0160.00619.32
8.4.30.0030.01617.62
8.4.20.0110.01120.54
8.4.10.0000.01019.36
8.3.320.0130.00618.55
8.3.310.0110.00918.50
8.3.300.0150.00622.45
8.3.290.0130.01318.49
8.3.280.0140.01018.48
8.3.270.0120.00716.64
8.3.260.0100.01016.62
8.3.250.0150.00318.82
8.3.240.0090.01116.55
8.3.230.0100.00916.64
8.3.220.0080.00917.11
8.3.210.0110.00916.50
8.3.200.0050.00416.85
8.3.190.0120.00617.28
8.3.180.0110.00820.75
8.3.170.0060.01220.82
8.3.160.0180.00018.50
8.3.150.0040.01420.50
8.3.140.0030.00618.60
8.3.130.0040.00418.32
8.3.120.0030.00620.65
8.3.110.0060.00320.94
8.3.100.0060.00316.63
8.3.90.0050.00318.41
8.3.80.0090.00017.97
8.3.70.0040.01116.38
8.3.60.0040.01118.56
8.3.50.0140.00718.22
8.3.40.0140.00018.66
8.3.30.0090.00618.79
8.3.20.0040.00421.86
8.3.10.0040.00418.75
8.3.00.0080.00019.38
8.2.320.0100.00918.05
8.2.310.0120.00618.09
8.2.300.0160.00418.01
8.2.290.0080.00420.48
8.2.280.0110.00820.13
8.2.270.0090.00917.04
8.2.260.0040.00420.52
8.2.250.0060.00322.20
8.2.240.0040.00418.84
8.2.230.0060.00322.58
8.2.220.0080.00024.06
8.2.210.0150.00326.77
8.2.200.0060.00316.63
8.2.190.0100.01016.58
8.2.180.0110.00318.42
8.2.170.0140.00022.96
8.2.160.0070.00719.33
8.2.150.0070.00024.18
8.2.140.0090.00024.66
8.2.130.0050.00222.19
8.2.120.0050.00326.35
8.2.110.0030.00619.31
8.2.100.0090.00317.66
8.2.90.0040.00418.34
8.2.80.0080.00317.97
8.2.70.0030.00618.04
8.2.60.0040.00418.14
8.2.50.0060.00318.10
8.2.40.0050.00321.25
8.2.30.0000.00719.14
8.2.20.0040.00417.93
8.2.10.0040.00419.57
8.2.00.0050.00317.98
8.1.340.0100.00819.92
8.1.330.0100.00922.01
8.1.320.0100.01016.10
8.1.310.0110.00820.43
8.1.300.0080.00018.40
8.1.290.0040.00418.88
8.1.280.0110.00425.92
8.1.270.0040.00423.99
8.1.260.0080.00026.35
8.1.250.0070.00328.09
8.1.240.0030.00623.97
8.1.230.0030.01020.89
8.1.220.0040.00417.76
8.1.210.0060.00318.95
8.1.200.0050.00317.48
8.1.190.0090.00017.13
8.1.180.0030.00618.10
8.1.170.0040.00418.70
8.1.160.0040.00418.80
8.1.150.0000.00718.95
8.1.140.0030.00320.33
8.1.130.0030.00620.24
8.1.120.0040.00417.43
8.1.110.0070.00017.34
8.1.100.0050.00317.51
8.1.90.0000.00817.45
8.1.80.0020.00517.40
8.1.70.0030.00517.36
8.1.60.0000.00817.61
8.1.50.0060.00317.55
8.1.40.0030.00517.55
8.1.30.0040.00417.55
8.1.20.0040.00417.65
8.1.10.0040.00417.59
8.1.00.0030.00617.48
8.0.300.0040.00420.01
8.0.290.0070.00016.63
8.0.280.0000.00718.44
8.0.270.0030.00317.14
8.0.260.0040.00418.44
8.0.250.0030.00516.84
8.0.240.0040.00416.92
8.0.230.0070.00016.86
8.0.220.0030.00716.91
8.0.210.0030.00316.94
8.0.200.0040.00416.86
8.0.190.0040.00417.03
8.0.180.0040.00416.91
8.0.170.0030.00516.93
8.0.160.0000.00716.97
8.0.150.0040.00416.81
8.0.140.0000.00816.77
8.0.130.0000.00713.36
8.0.120.0040.00416.77
8.0.110.0040.00416.74
8.0.100.0000.00716.89
8.0.90.0090.00016.94
8.0.80.0050.01016.89
8.0.70.0000.00716.79
8.0.60.0000.00716.79
8.0.50.0000.00816.82
8.0.30.0080.01117.11
8.0.20.0070.01717.40
8.0.10.0000.00716.91
8.0.00.0100.00916.72
7.4.330.0030.00515.55
7.4.320.0000.00716.53
7.4.300.0060.00016.40
7.4.290.0030.00316.55
7.4.280.0000.00816.51
7.4.270.0000.00916.47
7.4.260.0000.00716.55
7.4.250.0070.00016.54
7.4.240.0030.00316.54
7.4.230.0070.00016.50
7.4.220.0050.00316.41
7.4.210.0080.00716.61
7.4.200.0070.00016.62
7.4.160.0090.00616.51
7.4.140.0090.00917.86
7.4.130.0060.01216.51
7.4.120.0030.01416.67
7.4.110.0140.00416.36
7.4.100.0160.00616.54
7.4.90.0130.00616.47
7.4.80.0150.00619.39
7.4.70.0110.00516.49
7.4.60.0100.00716.68
7.4.50.0070.01016.43
7.4.40.0070.01016.64
7.4.00.0120.00315.02
7.3.330.0000.00513.27
7.3.320.0060.00013.40
7.3.310.0000.00716.34
7.3.300.0030.00316.34
7.3.290.0000.01516.29
7.3.280.0080.00816.33
7.3.260.0110.00716.45
7.3.240.0170.00316.34
7.3.230.0110.00616.32
7.3.210.0100.00716.60
7.3.200.0090.00916.39
7.3.190.0060.01616.44
7.3.180.0060.00916.50
7.3.170.0090.00916.56
7.3.160.0080.00816.55
7.3.20.7660.00714.75
7.3.10.0120.00914.64
7.3.00.1180.01014.50
7.2.330.0060.01216.65
7.2.320.0040.01516.64
7.2.310.0140.00516.89
7.2.300.0090.00916.46
7.2.290.0160.00316.56
7.2.150.3860.00715.06
7.2.140.0760.00714.55
7.2.130.0060.00614.71
7.2.120.1210.00614.48
7.2.110.0110.00715.01
7.2.100.0650.00314.91
7.2.90.0060.01714.70
7.2.80.0060.02114.76
7.2.70.0300.00614.78
7.2.60.0560.00414.87
7.2.50.0090.02214.60
7.2.40.0140.01115.06
7.2.30.0290.00014.66
7.2.20.0210.01415.03
7.2.10.0120.01614.53
7.2.00.0220.00414.89
7.1.250.0260.00013.61

preferences:
58.82 ms | 1443 KiB | 5 Q