3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test($test) { return new class($test) { public function __construct(public $test) {} }; } function test3($test) { return eval("return new class($test) { public function __construct(public \$test) {}};" ); } function compare($a, $b) { var_dump([ $a == $b, $a === $b, get_class($a) == get_class($b), ]); } compare(test(1), test(1)); // true, false, true, compare(test3(1), test3(1)); // false, false, false,

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.4.120.0130.00820.80
8.4.110.0140.00522.49
8.4.100.0090.00917.84
8.4.90.0140.00717.85
8.4.80.0050.00317.98
8.4.70.0110.00917.93
8.4.60.0160.00617.91
8.4.50.0080.00817.80
8.4.40.0190.01317.41
8.4.30.0220.00717.26
8.4.20.0230.00017.46
8.4.10.0160.00717.53
8.3.250.0100.00418.75
8.3.240.0120.00817.28
8.3.230.0060.00416.74
8.3.220.0040.00317.09
8.3.210.0100.00916.48
8.3.200.0110.00716.76
8.3.190.0140.00616.79
8.3.180.0130.00716.37
8.3.170.0180.00416.30
8.3.160.0220.00016.35
8.3.150.0170.00616.55
8.3.140.0170.00616.36
8.3.130.0140.00716.22
8.3.120.0200.00416.19
8.3.110.0170.00616.32
8.3.100.0160.00616.36
8.3.90.0180.00616.31
8.3.80.0240.00016.70
8.3.70.0190.00616.47
8.3.60.0180.00316.33
8.3.50.0180.00416.25
8.3.40.0180.00017.62
8.3.30.0170.00417.39
8.3.20.0180.00017.48
8.3.10.0140.00517.35
8.3.00.0120.00017.63
8.2.290.0100.00720.42
8.2.280.0060.00718.20
8.2.270.0190.00216.38
8.2.260.0210.00416.34
8.2.250.0230.00016.43
8.2.240.0180.00516.84
8.2.230.0250.00416.65
8.2.220.0190.00316.14
8.2.210.0190.00016.50
8.2.200.0110.00816.50
8.2.190.0140.00516.53
8.2.180.0150.00416.38
8.2.170.0180.00317.79
8.2.160.0160.00717.68
8.2.150.0250.00317.34
8.2.140.0150.00317.37
8.2.130.0160.00317.69
8.2.120.0160.00317.69
8.2.110.0220.00017.48
8.2.100.0120.00617.64
8.2.90.0200.00317.63
8.2.80.0220.00917.38
8.2.70.0220.00417.39
8.2.60.0330.00617.43
8.2.50.0180.00017.45
8.2.40.0110.00517.45
8.2.30.0190.00317.33
8.2.20.0160.00617.41
8.2.10.0190.01017.34
8.2.00.0340.00017.35
8.1.320.0050.00915.95

preferences:
27.03 ms | 403 KiB | 5 Q