3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Eq { abstract public function equiv(Eq $lhs, Eq $rhs): bool; } 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); } var_dump(check_equiv( new Tuple3(new Tuple2(1, 2), new Tuple2(3, 4), new Tuple2(5, 6)), new Tuple3(new Tuple2(1, 2), new Tuple2(3, 4), new Tuple2(5, 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.70.0110.00416.88
8.3.60.0090.00616.88
8.3.50.0100.01018.44
8.3.40.0140.00020.49
8.3.30.0140.00018.68
8.3.20.0040.00424.18
8.3.10.0110.00424.66
8.3.00.0030.00726.16
8.2.190.0040.01118.64
8.2.180.0180.00318.29
8.2.170.0090.01218.95
8.2.160.0030.01022.96
8.2.150.0040.00425.66
8.2.140.0000.00824.66
8.2.130.0070.00026.16
8.2.120.0030.00626.16
8.2.110.0100.00020.38
8.2.100.0030.00917.78
8.2.90.0040.00419.18
8.2.80.0000.00719.34
8.2.70.0000.00817.63
8.2.60.0030.00617.63
8.2.50.0030.00517.63
8.2.40.0060.00319.33
8.2.30.0060.00317.73
8.2.20.0070.00019.30
8.2.10.0000.00818.18
8.2.00.0060.01217.73
8.1.280.0100.01025.92
8.1.270.0080.00024.66
8.1.260.0040.00426.35
8.1.250.0000.00828.09
8.1.240.0090.00022.83
8.1.230.0070.00417.77
8.1.220.0080.00018.64
8.1.210.0000.00918.77
8.1.200.0040.00417.23
8.1.190.0000.01117.35
8.1.180.0030.00518.10
8.1.170.0040.00417.62
8.1.160.0000.00818.86
8.1.150.0080.00418.67
8.1.140.0030.00617.37
8.1.130.0170.00017.41
8.1.120.0080.00817.47
8.1.110.0160.00017.41
8.1.100.0120.00417.54
8.1.90.0050.01417.41
8.1.80.0170.00017.54
8.1.70.0100.00517.41
8.1.60.0120.00817.66
8.1.50.0110.00817.54
8.1.40.0150.00317.54
8.1.30.0120.00817.68
8.1.20.0170.00217.64
8.1.10.0160.00317.48
8.1.00.0160.00317.43
8.0.300.0000.00918.77
8.0.290.0060.00317.00
8.0.280.0040.00418.03
8.0.270.0030.00318.12
8.0.260.0160.00017.41
8.0.250.0140.00217.41
8.0.240.0100.00517.41
8.0.230.0120.00317.41
8.0.220.0080.00817.41
8.0.210.0160.00017.41
8.0.200.0100.00617.41
8.0.190.0100.00517.41
8.0.180.0100.00517.41
8.0.170.0120.00317.41
8.0.160.0080.00817.41
8.0.150.0100.00517.41
8.0.140.0150.00017.41
8.0.130.0140.00217.41
8.0.120.0150.00417.41
8.0.110.0180.00317.41
8.0.100.0090.00617.41
8.0.90.0090.00617.41
8.0.80.0100.00617.41
8.0.70.0170.00017.41
8.0.60.0120.00317.41
8.0.50.0110.00417.41
8.0.30.0110.00517.41
8.0.20.0120.00317.41
8.0.10.0150.00017.41

preferences:
18.18 ms | 401 KiB | 5 Q