3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Eq { public function equiv(Eq $lhs, Eq $rhs): bool { return $lhs->equiv($lhs, $rhs); } } class Tuple2 { use Eq; public function __construct(public Eq $key, public Eq $value) {} public function equiv(Eq $lhs, Eq $rhs): bool { return $lhs->key->equiv($lhs->key, $rhs->key) && $lhs->value->equiv($lhs->value, $rhs->value); } } class Tuple3 { use Eq; public function __construct(public Eq $key, public Eq $value, public Eq $column) {} public function equiv(Eq $lhs, Eq $rhs): bool { return $lhs->key->equiv($lhs->key, $rhs->key) && $lhs->value->equiv($lhs->value, $rhs->value) && $lhs->column->equiv($lhs->column, $rhs->column); } } function check_equiv(Eq $lhs, Eq $rhs) { return $lhs->equiv($lhs, $rhs); } class Number { use Eq; public function __construct(public int $value) {} public function equiv(int $lhs, int $rhs): bool { return $lhs === $rhs; } } var_dump(check_equiv( new Tuple3(new Tuple2(new Number(1), new Number(2)), new Tuple2(new Number(3), new Number(4)), new Tuple2(new Number(5), new Number(6))), new Tuple3(new Tuple2(new Number(1), new Number(2)), new Tuple2(new Number(3), new Number(4)), new Tuple2(new Number(5), new Number(6))) ));

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.0040.01118.68
8.3.50.0110.01116.72
8.3.40.0100.00320.52
8.3.30.0140.00018.80
8.3.20.0060.00324.18
8.3.10.0050.00324.66
8.3.00.0070.00326.16
8.2.180.0120.00316.63
8.2.170.0180.00318.79
8.2.160.0110.00422.96
8.2.150.0000.00725.66
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0040.00419.36
8.2.110.0100.00019.37
8.2.100.0080.00317.91
8.2.90.0000.00817.75
8.2.80.0030.00617.97
8.2.70.0080.00017.93
8.2.60.0040.00419.28
8.2.50.0050.00518.10
8.2.40.0080.00022.14
8.2.30.0040.00418.09
8.2.20.0040.00419.43
8.2.10.0040.00418.24
8.2.00.0090.00017.73
8.1.280.0060.00925.92
8.1.270.0080.00024.66
8.1.260.0050.00226.35
8.1.250.0040.00428.09
8.1.240.0090.00022.05
8.1.230.0080.00318.95
8.1.220.0000.00817.74
8.1.210.0050.00318.77
8.1.200.0030.00617.35
8.1.190.0030.00519.01
8.1.180.0000.00818.10
8.1.170.0000.00818.68
8.1.160.0050.00322.20
8.1.150.0090.00018.52
8.1.140.0000.00817.42
8.1.130.0060.00317.41
8.1.120.0070.00017.43
8.1.110.0030.00517.55
8.1.100.0000.00717.63
8.1.90.0040.00417.61
8.1.80.0040.00417.48
8.1.70.0030.00517.57
8.1.60.0060.00317.64
8.1.50.0050.00317.53
8.1.40.0000.00717.69
8.1.30.0000.00817.77
8.1.20.0000.00717.67
8.1.10.0000.00817.64
8.1.00.0020.00517.46
8.0.300.0040.00418.80
8.0.290.0000.00916.88
8.0.280.0040.00418.50
8.0.270.0040.00416.86
8.0.260.0000.00717.41
8.0.250.0000.00817.41
8.0.240.0040.00417.41
8.0.230.0000.00817.41
8.0.220.0040.00417.41
8.0.210.0030.00617.41
8.0.200.0040.00417.41
8.0.190.0040.00417.41
8.0.180.0040.00417.41
8.0.170.0050.00217.41
8.0.160.0040.00417.41
8.0.150.0040.00417.41
8.0.140.0030.00317.41
8.0.130.0050.00217.41
8.0.120.0040.00417.41
8.0.110.0020.00517.41
8.0.100.0070.00017.41
8.0.90.0070.00017.41
8.0.80.0070.00017.41
8.0.70.0000.00717.41
8.0.60.0030.00317.41
8.0.50.0040.00417.41
8.0.30.0030.00317.41
8.0.20.0030.00317.41
8.0.10.0000.00717.41

preferences:
48.13 ms | 400 KiB | 5 Q