3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Obj implements ArrayAccess { public $container = [ "one" => 1, "two" => 2, "three" => 3, ]; public function offsetSet($offset, $value): void { if (is_null($offset)) { $this->container[] = $value; } else { $this->container[$offset] = $value; } } public function offsetExists($offset): bool { return isset($this->container[$offset]); } public function offsetUnset($offset): void { unset($this->container[$offset]); } public function offsetGet($offset): mixed { return isset($this->container[$offset]) ? $this->container[$offset] : null; } } $obj = new Obj; takesArray($obj); function takesArray(array $arr) {}

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.20.0110.00720.26
8.5.10.0110.00616.94
8.5.00.0130.01022.94
8.4.170.0080.01323.79
8.4.160.0130.00921.89
8.4.150.0010.00114.05
8.4.140.0130.01417.83
8.4.130.0410.00717.82
8.4.120.0440.00717.84
8.4.110.0440.00718.09
8.4.100.0400.01018.03
8.4.90.0440.00818.13
8.4.80.0370.00717.86
8.4.70.0300.01017.93
8.4.60.0410.01017.91
8.4.50.0410.01117.72
8.4.40.0440.00817.68
8.4.30.0490.01117.63
8.4.20.0440.01117.60
8.4.10.0460.00817.55
8.3.300.0100.01020.98
8.3.290.0160.00720.94
8.3.280.0130.00718.63
8.3.270.0130.00716.86
8.3.260.0110.01118.45
8.3.250.0360.01116.59
8.3.240.0410.00916.63
8.3.230.0400.00816.70
8.3.220.0250.01016.48
8.3.210.0380.00716.61
8.3.200.0300.00916.39
8.3.190.0310.00416.68
8.3.180.0170.00516.75
8.3.170.0160.00816.66
8.3.160.0220.00216.63
8.3.150.0200.00316.75
8.3.140.0390.00916.65
8.3.130.0370.00616.61
8.3.120.0340.01116.72
8.3.110.0350.01016.67
8.3.100.0450.00616.57
8.3.90.0290.00816.41
8.3.80.0410.00916.62
8.3.70.0420.00916.66
8.3.60.0400.00816.75
8.3.50.0440.01016.64
8.3.40.0440.01017.45
8.3.30.0370.00517.52
8.3.20.0340.01217.43
8.3.10.0310.01217.57
8.3.00.0340.00517.33
8.2.300.0120.00720.17
8.2.290.0310.01016.75
8.2.280.0320.00816.51
8.2.270.0340.00916.54
8.2.260.0290.00216.52
8.2.250.0160.00416.58
8.2.240.0230.00416.31
8.2.230.0160.00316.32
8.2.220.0310.01116.73
8.2.210.0380.00716.29
8.2.200.0350.00716.39
8.2.190.0360.00416.74
8.2.180.0340.00916.80
8.2.170.0220.00817.77
8.2.160.0150.00517.81
8.2.150.0160.00417.63
8.2.140.0370.00417.38
8.2.130.0380.00617.54
8.2.120.0400.00617.66
8.2.110.0390.00717.47
8.2.100.0380.00917.56
8.2.90.0300.01317.63
8.2.80.0380.00617.51
8.2.70.0340.00917.30
8.2.60.0480.00817.70
8.2.50.0410.01017.63
8.2.40.0420.00717.68
8.2.30.0320.01017.75
8.2.20.0360.00617.46
8.2.10.0390.00517.50
8.2.00.0230.00517.59
8.1.340.0110.00821.60

preferences:
29.44 ms | 403 KiB | 5 Q