3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait aTrait { public static function build($x) { return new static($x); } } class A { public function __construct($x) { $this->x = $x; } use aTrait; } class B { public function __construct($x) { $this->x = $x * 2; } use aTrait; } $a = A::build(2); $b = B::build(2); var_dump($a); var_dump($b);

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.00.0140.01120.04
8.4.150.0030.00014.05
8.4.140.0130.00917.59
8.4.130.0110.00917.67
8.4.120.0100.01024.17
8.4.110.0090.00820.30
8.4.100.0110.00919.05
8.4.90.0020.00622.46
8.4.80.0140.00618.83
8.4.70.0140.00718.30
8.4.60.0100.01018.64
8.4.50.0150.00718.82
8.4.40.0100.01022.04
8.4.30.0080.00018.55
8.4.20.0120.00919.00
8.4.10.0080.00817.75
8.3.280.0140.00718.51
8.3.270.0090.01016.76
8.3.260.0070.01216.59
8.3.250.0110.00518.90
8.3.240.0030.00517.24
8.3.230.0150.00416.60
8.3.220.0110.00718.99
8.3.210.0070.00718.41
8.3.200.0090.01116.78
8.3.190.0050.00517.35
8.3.180.0070.00417.18
8.3.170.0120.00620.66
8.3.160.0140.00716.70
8.3.150.0100.01017.09
8.3.140.0150.00316.63
8.3.130.0070.01016.73
8.3.120.0060.00319.03
8.3.110.0120.00420.94
8.3.100.0100.01024.06
8.3.90.0070.00026.77
8.3.80.0090.00020.56
8.3.70.0090.00916.86
8.3.60.0110.01118.63
8.3.50.0130.00316.54
8.3.40.0110.00718.63
8.3.30.0110.00418.85
8.3.20.0050.00322.41
8.3.10.0000.00822.05
8.3.00.0070.00023.66
8.2.290.0130.00520.66
8.2.280.0110.01018.47
8.2.270.0100.01017.27
8.2.260.0110.00416.45
8.2.250.0080.00016.62
8.2.240.0060.01018.67
8.2.230.0060.01022.58
8.2.220.0060.00937.54
8.2.210.0060.00326.77
8.2.200.0030.00616.63
8.2.190.0110.01116.58
8.2.180.0090.00618.55
8.2.170.0140.00022.96
8.2.160.0090.00620.32
8.2.150.0030.00624.18
8.2.140.0070.00724.66
8.2.130.0040.00426.16
8.2.120.0000.00820.68
8.2.110.0060.00319.17
8.2.100.0120.00017.91
8.2.90.0050.00320.47
8.2.80.0050.00318.16
8.2.70.0050.00317.80
8.2.60.0040.00418.16
8.2.50.0040.00418.07
8.2.40.0040.00420.07
8.2.30.0030.00618.05
8.2.20.0000.00718.12
8.2.10.0050.00219.23
8.2.00.0000.00719.14
8.1.330.0110.00721.99
8.1.320.0170.00716.10
8.1.310.0040.00415.94
8.1.300.0110.00718.45
8.1.290.0060.00318.88
8.1.280.0060.01225.92
8.1.270.0030.00520.77
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00622.66
8.1.230.0080.00421.00
8.1.220.0000.00817.77
8.1.210.0080.00018.89
8.1.200.0060.00317.35
8.1.190.0040.00417.25
8.1.180.0030.00518.10
8.1.170.0050.00318.57
8.1.160.0040.00418.96
8.1.150.0070.00018.82
8.1.140.0000.00720.89
8.1.130.0030.00320.19
8.1.120.0000.00717.48
8.1.110.0000.01017.30
8.1.100.0000.00717.41
8.1.90.0040.00417.42
8.1.80.0030.00517.47
8.1.70.0070.00017.35
8.1.60.0000.00717.58
8.1.50.0000.00817.49
8.1.40.0030.00617.36
8.1.30.0000.00917.62
8.1.20.0050.00317.59
8.1.10.0040.00417.51
8.1.00.0000.00717.48
8.0.300.0000.00719.89
8.0.290.0040.00416.88
8.0.280.0000.00718.44
8.0.270.0000.00717.17
8.0.260.0060.00019.95
8.0.250.0030.00716.95
8.0.240.0040.00416.95
8.0.230.0030.00316.87
8.0.220.0060.00316.81
8.0.210.0030.00316.88
8.0.200.0000.00716.93
8.0.190.0030.00617.02
8.0.180.0070.00416.93
8.0.170.0040.00416.95
8.0.160.0030.00516.94
8.0.150.0050.00316.71
8.0.140.0030.00516.82
8.0.130.0030.00313.33
8.0.120.0000.00816.79
8.0.110.0000.00816.93
8.0.100.0040.00416.77
8.0.90.0030.00616.72
8.0.80.0060.00916.86
8.0.70.0050.00216.78
8.0.60.0040.00416.79
8.0.50.0040.00416.77
8.0.30.0090.00817.00
8.0.20.0040.01617.13
8.0.10.0000.00716.82
8.0.00.0140.00616.77
7.4.330.0060.00216.93
7.4.320.0000.00616.56
7.4.300.0000.00716.50
7.4.290.0030.00316.52
7.4.280.0000.00716.60
7.4.270.0030.00316.59
7.4.260.0030.00313.30
7.4.250.0000.00716.54
7.4.240.0070.00016.66
7.4.230.0070.00016.69
7.4.220.0070.00016.61
7.4.210.0110.00616.54
7.4.200.0030.00316.70
7.4.130.0140.00416.49
7.4.120.0110.00616.54
7.4.110.0040.01216.34
7.4.100.0080.01216.75
7.4.90.0160.00316.52
7.4.80.0170.02019.39
7.4.70.0090.00616.49
7.4.60.0060.01216.47
7.4.50.0080.00816.50
7.4.40.0100.00716.44
7.4.00.0070.00815.13
7.3.330.0030.00516.19
7.3.320.0050.00313.11
7.3.310.0030.00316.11
7.3.300.0050.00216.21
7.3.290.0140.00316.30
7.3.260.0120.01016.45
7.3.240.0110.00716.43
7.3.230.0190.00616.40
7.3.210.0100.00616.55
7.3.200.0100.00616.44
7.3.190.0120.00316.63
7.3.180.0030.01216.58
7.3.170.0160.01016.59
7.3.160.0110.00716.68
7.3.120.0060.01214.86
7.3.110.0070.00714.76
7.3.100.0080.00914.83
7.3.90.0050.00914.68
7.3.80.0080.00714.78
7.3.70.0080.00514.79
7.3.60.0100.00314.85
7.3.50.0080.00414.50
7.3.40.0060.00714.78
7.3.30.0040.00914.70
7.3.20.0020.01316.57
7.3.10.0070.00616.65
7.3.00.0090.00416.67
7.2.330.0070.01316.45
7.2.320.0100.00716.48
7.2.310.0100.00716.68
7.2.300.0120.00916.67
7.2.290.0100.00716.55
7.2.250.0120.00614.89
7.2.240.0060.01014.84
7.2.230.0070.00715.23
7.2.220.0090.00715.04
7.2.210.0020.01215.08
7.2.200.0060.01015.05
7.2.190.0060.00814.93
7.2.180.0050.00614.91
7.2.170.0030.00915.09
7.2.160.0080.00615.09
7.2.150.0040.01216.86
7.2.140.0060.00916.88
7.2.130.0070.01016.86
7.2.120.0070.00716.84
7.2.110.0070.00616.75
7.2.100.0070.00516.80
7.2.90.0040.00916.93
7.2.80.0050.01016.94
7.2.70.0080.00416.93
7.2.60.0070.00917.00
7.2.50.0040.01016.92
7.2.40.0100.00616.88
7.2.30.0070.00716.86
7.2.20.0070.00716.81
7.2.10.0090.00416.76
7.2.00.0030.01016.78
7.1.330.0100.00515.83
7.1.320.0070.00715.68
7.1.310.0030.00915.73
7.1.300.0070.00615.75
7.1.290.0060.00615.62
7.1.280.0090.00415.81
7.1.270.0070.00515.66
7.1.260.0080.00515.65
7.1.250.0060.00615.69
7.1.240.0070.00715.64
7.1.230.0100.00315.52
7.1.220.0000.00815.52
7.1.210.0130.00315.64
7.1.200.0050.00815.92
7.1.190.0150.00315.63
7.1.180.0100.00715.72
7.1.170.0070.01015.40
7.1.160.0030.00916.00
7.1.150.0090.00615.87
7.1.140.0060.00615.93
7.1.130.0100.00315.89
7.1.120.0040.00915.70
7.1.110.0080.00815.87
7.1.100.0030.01015.74
7.1.90.0040.00815.63
7.1.80.0030.01315.96
7.1.70.0040.01115.90
7.1.60.0040.01115.91
7.1.50.0120.00316.05
7.1.40.0060.00915.75
7.1.30.0030.01315.59
7.1.20.0070.00415.61
7.1.10.0090.00615.90
7.1.00.0000.00915.66

preferences:
29.99 ms | 403 KiB | 5 Q