3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types = 1); use function PHPStan\dumpType; use function PHPStan\Testing\assertType; class Obj implements ArrayAccess { private $container = [ ]; 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; } } $o = new Obj(); var_dump(is_iterable($o)); var_dump(is_array($o)); var_dump($o instanceof Traversable); foreach($o as $k => $v) { var_dump($k, $v); }

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.10.0110.00616.81
8.5.00.0150.00719.99
8.4.150.0010.00114.05
8.4.140.0090.01117.30
8.4.130.0140.00717.87
8.4.120.0130.00420.48
8.4.110.0110.00818.73
8.4.100.0400.00917.76
8.4.90.0450.00517.45
8.4.80.0350.01217.75
8.4.70.0210.00517.84
8.4.60.0410.00717.61
8.4.50.0360.01017.83
8.4.40.0390.00917.49
8.4.30.0400.01217.59
8.4.20.0410.01117.52
8.4.10.0400.01017.41
8.3.280.0120.00818.40
8.3.270.0150.00516.52
8.3.260.0140.00616.57
8.3.250.0130.00518.75
8.3.240.0110.00816.39
8.3.230.0230.00716.36
8.3.220.0360.01116.16
8.3.210.0380.00916.37
8.3.200.0370.00716.38
8.3.190.0340.01216.20
8.3.180.0350.00416.50
8.3.170.0380.00216.36
8.3.160.0280.00116.41
8.3.150.0170.00516.37
8.3.140.0210.00416.48
8.3.130.0330.00816.25
8.3.120.0380.01016.46
8.3.110.0380.00816.33
8.3.100.0430.00916.58
8.3.90.0390.00616.39
8.3.80.0420.00516.51
8.3.70.0370.01116.41
8.3.60.0440.00916.33
8.3.50.0460.01116.50
8.3.40.0400.01017.30
8.3.30.0310.00817.36
8.3.20.0370.00817.43
8.3.10.0360.00817.25
8.3.00.0350.00617.51
8.2.290.0340.00716.53
8.2.280.0270.00916.65
8.2.270.0350.00816.36
8.2.260.0310.00716.40
8.2.250.0190.00216.64
8.2.240.0240.00916.41
8.2.230.0330.00716.64
8.2.220.0330.00916.80
8.2.210.0340.00716.68
8.2.200.0320.00716.52
8.2.190.0330.00916.66
8.2.180.0350.00416.51
8.2.170.0380.00617.49
8.2.160.0320.01217.61
8.2.150.0250.00717.64
8.2.140.0280.00717.54
8.2.130.0180.00317.43
8.2.120.0180.00217.61
8.2.110.0190.00217.68
8.2.100.0360.00617.75
8.2.90.0380.00317.61
8.2.80.0320.01017.46
8.2.70.0320.00917.67
8.2.60.0420.00717.36
8.2.50.0390.00617.46
8.2.40.0350.00817.60
8.2.30.0230.00317.66
8.2.20.0340.00717.13
8.2.10.0290.00517.50
8.2.00.0230.00417.57
8.1.330.0380.00616.05
8.1.320.0340.00516.04
8.1.310.0320.00916.00
8.1.300.0330.00716.20
8.1.290.0380.00516.06
8.1.280.0330.00715.93
8.1.270.0370.00417.28
8.1.260.0340.00617.23
8.1.250.0350.00417.29
8.1.240.0320.00717.19
8.1.230.0290.00817.21
8.1.220.0320.00817.27
8.1.210.0300.00517.14
8.1.200.0310.00717.25
8.1.190.0320.00817.09
8.1.180.0260.00917.09
8.1.170.0300.00917.29
8.1.160.0300.00917.13
8.1.150.0330.00617.35
8.1.140.0290.00617.04
8.1.130.0200.00417.28
8.1.120.0120.01017.37
8.1.110.0310.00717.23
8.1.100.0260.01217.15
8.1.90.0300.00817.20
8.1.80.0540.00817.30
8.1.70.0320.00417.23
8.1.60.0260.00617.26
8.1.50.0240.01117.45
8.1.40.0170.00717.50
8.1.30.0330.00617.54
8.1.20.0240.01117.27
8.1.10.0300.00917.25
8.1.00.0270.00417.13
8.0.300.0290.00716.57
8.0.290.0230.01016.51
8.0.280.0330.00716.39
8.0.270.0410.00516.38
8.0.260.0320.00916.58
8.0.250.0280.00516.62
8.0.240.0280.01016.61
8.0.230.0290.01216.70
8.0.220.0290.01216.54
8.0.210.0320.00716.35
8.0.200.0310.00716.52
8.0.190.0340.00616.61
8.0.180.0300.00916.64
8.0.170.0350.00616.57
8.0.160.0310.00816.61
8.0.150.0310.00716.59
8.0.140.0280.00816.55
8.0.130.0300.00916.61
8.0.120.0270.00916.63
8.0.110.0200.00416.46
8.0.100.0270.00816.70
8.0.90.0400.00616.44
8.0.80.0330.00916.41
8.0.70.0280.00616.45
8.0.60.0150.00316.51
8.0.50.0140.00416.53
8.0.30.0150.00416.61
8.0.20.0200.00316.61
8.0.10.0150.00416.65
8.0.00.0160.00416.82
7.4.330.0160.00416.13
7.4.320.0300.00716.34
7.4.300.0290.00716.16
7.4.290.0300.00616.25
7.4.280.0280.00716.15
7.4.270.0240.00916.21
7.4.260.0270.00916.20
7.4.250.0280.00816.23
7.4.240.0280.00816.18
7.4.230.0310.00616.27
7.4.220.0250.00616.33
7.4.210.0240.00216.39
7.4.200.0150.00716.29
7.4.190.0130.00316.34
7.4.180.0130.00416.50
7.4.160.0320.00516.47
7.4.150.0290.00616.30
7.4.140.0260.00816.25
7.4.130.0270.00516.28
7.4.120.0360.00916.18
7.4.110.0290.00716.14
7.4.100.0320.00516.17
7.4.90.0270.00816.28
7.4.80.0280.00916.21
7.4.70.0150.00216.28
7.4.60.0150.00316.41
7.4.50.0270.00916.20
7.4.40.0280.00716.15
7.4.30.0290.00716.28
7.4.20.0300.00616.15
7.4.10.0320.00316.01
7.4.00.0290.00716.02
7.3.330.0250.00615.99
7.3.320.0310.00516.00
7.3.310.0290.00616.16
7.3.300.0300.00716.10
7.3.290.0190.00416.18
7.3.280.0280.00816.21
7.3.270.0270.00616.20
7.3.260.0240.00915.96
7.3.250.0290.01215.81
7.3.240.0270.00815.95
7.3.230.0290.00816.07
7.3.220.0300.00616.07
7.3.210.0300.00716.30
7.3.200.0340.00515.84
7.3.190.0330.00815.95
7.3.180.0310.00715.88
7.3.170.0300.00216.16
7.3.160.0120.00516.26
7.3.150.0140.00316.18
7.3.140.0290.00716.25
7.3.130.0310.00616.33
7.3.120.0160.00415.96
7.3.110.0280.00816.07
7.3.100.0360.00815.82
7.3.90.0290.00916.27
7.3.80.0310.00916.05
7.3.70.0280.01016.30
7.3.60.0290.01015.85
7.3.50.0280.00716.02
7.3.40.0250.00516.29
7.3.30.0140.00316.23
7.3.20.0250.00718.13
7.3.10.0280.00817.90
7.3.00.0320.00617.75
7.2.340.0270.00716.03
7.2.330.0320.00516.04
7.2.320.0300.00416.13
7.2.310.0270.00916.34
7.2.300.0290.00516.18
7.2.290.0200.00616.29
7.2.280.0190.00316.15
7.2.270.0140.00716.18
7.2.260.0200.00216.19
7.2.250.0170.00716.25
7.2.240.0290.00616.13
7.2.230.0290.00616.32
7.2.220.0220.00916.14
7.2.210.0230.00916.25
7.2.200.0270.00616.41
7.2.190.0270.00816.23
7.2.180.0310.00716.36
7.2.170.0270.00416.43
7.2.160.0320.00416.31
7.2.150.0360.00518.28
7.2.140.0270.01218.18
7.2.130.0330.00518.12
7.2.120.0310.00718.27
7.2.110.0360.00618.13
7.2.100.0340.00618.29
7.2.90.0340.00618.15
7.2.80.0330.00518.10
7.2.70.0260.01218.25
7.2.60.0230.01018.30
7.2.50.0300.00818.41
7.2.40.0310.00718.39
7.2.30.0330.00418.36
7.2.20.0320.00718.43
7.2.10.0260.01218.32
7.2.00.0250.00418.46
7.1.330.0280.00817.00
7.1.320.0240.00917.10
7.1.310.0310.00516.95
7.1.300.0270.00716.98
7.1.290.0280.01016.99
7.1.280.0280.00917.05
7.1.270.0300.00517.03
7.1.260.0280.00617.15
7.1.250.0250.00717.09
7.1.240.0250.00717.13
7.1.230.0270.00217.23
7.1.220.0160.00317.02
7.1.210.0190.00516.90
7.1.200.0120.00417.16
7.1.190.0160.00716.96
7.1.180.0140.00217.13
7.1.170.0250.00917.02
7.1.160.0230.01017.20
7.1.150.0230.00717.03
7.1.140.0170.00417.35
7.1.130.0140.00317.16
7.1.120.0160.00517.19
7.1.110.0150.00517.03
7.1.100.0250.00417.13
7.1.90.0140.00317.08
7.1.80.0310.00716.86
7.1.70.0290.00716.99
7.1.60.0280.00717.08
7.1.50.0190.00016.78
7.1.40.0220.00317.00
7.1.30.0170.00616.84
7.1.20.0290.00716.83
7.1.10.0330.00516.90
7.1.00.0230.00517.07
7.0.330.0270.00716.56
7.0.320.0230.01116.69
7.0.310.0260.00716.56
7.0.300.0280.00716.73
7.0.290.0220.00916.77
7.0.280.0200.00616.48
7.0.270.0250.00916.41
7.0.260.0260.00916.66
7.0.250.0290.00617.14
7.0.240.0280.00616.71
7.0.230.0270.00616.98
7.0.220.0200.00217.04
7.0.210.0150.00116.82
7.0.200.0240.00316.58
7.0.190.0260.00716.57
7.0.180.0290.00416.77
7.0.170.0290.00616.71
7.0.160.0240.01116.64
7.0.150.0290.00516.45
7.0.140.0280.00516.88
7.0.130.0290.00816.88
7.0.120.0270.00916.73
7.0.110.0260.00616.89
7.0.100.0260.00516.63
7.0.90.0250.01016.75
7.0.80.0270.00616.67
7.0.70.0250.00716.73
7.0.60.0280.00916.75
7.0.50.0230.00616.60
7.0.40.0240.00816.81
7.0.30.0270.00616.83
7.0.20.0320.00616.54
7.0.10.0230.01216.67
7.0.00.0280.00716.68
5.6.400.0290.00815.27
5.6.390.0330.00615.26
5.6.380.0280.00615.40
5.6.370.0250.00815.33
5.6.360.0290.00515.41
5.6.350.0240.00915.40
5.6.340.0210.00715.45
5.6.330.0150.00315.50
5.6.320.0160.00515.33
5.6.310.0190.00615.47
5.6.300.0200.00615.08
5.6.290.0260.00715.40
5.6.280.0250.00515.28
5.6.270.0160.00415.41
5.6.260.0210.00515.33
5.6.250.0290.00515.39
5.6.240.0260.00515.25
5.6.230.0260.00415.36
5.6.220.0130.00315.57
5.6.210.0250.00615.41
5.6.200.0220.01015.68
5.6.190.0270.00615.45
5.6.180.0240.00715.60
5.6.170.0280.00415.42
5.6.160.0290.00515.22
5.6.150.0290.00215.49
5.6.140.0270.00415.24
5.6.130.0290.00415.34
5.6.120.0240.01015.46
5.6.110.0270.00615.45
5.6.100.0260.00615.24
5.6.90.0210.01315.18
5.6.80.0230.00915.48
5.6.70.0230.00715.54
5.6.60.0250.00615.50
5.6.50.0280.00315.30
5.6.40.0220.01015.33
5.6.30.0240.00715.27
5.6.20.0200.00615.34
5.6.10.0260.00915.51
5.6.00.0200.00815.51
5.5.380.0280.00315.45
5.5.370.0230.00815.45
5.5.360.0260.00815.16
5.5.350.0340.00515.09
5.5.340.0310.00415.11
5.5.330.0310.00615.21
5.5.320.0160.00615.12
5.5.310.0220.01115.31
5.5.300.0100.00415.40
5.5.290.0130.00915.36
5.5.280.0240.00415.30
5.5.270.0210.00915.04
5.5.260.0240.00715.18
5.5.250.0250.00715.51
5.5.240.0260.00515.18
5.5.230.0250.00415.37
5.5.220.0250.00615.66
5.5.210.0270.00615.24
5.5.200.0250.00715.25
5.5.190.0230.00615.25
5.5.180.0160.00415.10
5.5.170.0240.01015.20
5.5.160.0120.00315.34
5.5.150.0100.00415.27
5.5.140.0130.00315.23
5.5.130.0070.00715.29
5.5.120.0200.01015.07
5.5.110.0260.00315.04
5.5.100.0190.00615.30
5.5.90.0150.00515.59
5.5.80.0220.00715.50
5.5.70.0240.00715.43
5.5.60.0270.00515.17
5.5.50.0230.00715.40
5.5.40.0210.00915.09
5.5.30.0220.00715.35
5.5.20.0240.00415.40
5.5.10.0230.00515.37
5.5.00.0220.00715.16
5.4.450.0180.00615.04
5.4.440.0200.00515.04
5.4.430.0220.00415.04
5.4.420.0200.00515.04
5.4.410.0180.00715.04
5.4.400.0190.00515.04
5.4.390.0190.00515.04
5.4.380.0190.00715.04
5.4.370.0210.00515.04
5.4.360.0170.00815.04
5.4.350.0190.00515.04
5.4.340.0190.00715.04
5.4.330.0210.00215.04
5.4.320.0170.00415.04
5.4.310.0070.00515.04
5.4.300.0200.00315.04
5.4.290.0140.00715.04
5.4.280.0220.00115.04
5.4.270.0130.00515.04
5.4.260.0120.00215.04
5.4.250.0180.00315.04
5.4.240.0210.00515.04
5.4.230.0170.00815.04
5.4.220.0150.00615.04
5.4.210.0210.00515.04
5.4.200.0180.00515.04
5.4.190.0170.00415.04
5.4.180.0190.00515.04
5.4.170.0200.00315.04
5.4.160.0200.00415.04
5.4.150.0180.00515.04
5.4.140.0180.00215.04
5.4.130.0160.00815.04
5.4.120.0170.00715.04
5.4.110.0310.00315.04
5.4.100.0160.00415.04
5.4.90.0080.00415.04
5.4.80.0070.00415.04
5.4.70.0130.00315.04
5.4.60.0200.00315.04
5.4.50.0180.00615.04
5.4.40.0180.00615.04
5.4.30.0180.00515.04
5.4.20.0170.00415.04
5.4.10.0180.00615.04
5.4.00.0180.00615.04
5.3.290.0170.00515.04
5.3.280.0160.00615.04
5.3.270.0110.00515.04
5.3.260.0120.00315.04
5.3.250.0100.00115.04
5.3.240.0080.00315.04
5.3.230.0070.00515.04
5.3.220.0180.00615.04
5.3.210.0220.00415.04
5.3.200.0180.00615.04
5.3.190.0220.00315.04
5.3.180.0210.00415.04
5.3.170.0230.00315.04
5.3.160.0180.00715.04
5.3.150.0220.00315.04
5.3.140.0210.00515.04
5.3.130.0150.00615.04
5.3.120.0220.00315.04
5.3.110.0170.00715.04
5.3.100.0200.00415.04
5.3.90.0180.00515.04
5.3.80.0170.00815.04
5.3.70.0200.00515.04
5.3.60.0180.00715.04
5.3.50.0160.00615.04
5.3.40.0210.00315.04
5.3.30.0170.00715.04
5.3.20.0140.00715.04
5.3.10.0150.00815.04
5.3.00.0150.00415.04
5.2.170.0180.00515.04
5.2.160.0120.00315.04
5.2.150.0120.00615.04
5.2.140.0090.00315.04
5.2.130.0070.00215.04
5.2.120.0120.00415.04
5.2.110.0080.00115.04
5.2.100.0130.00515.04
5.2.90.0160.00415.04
5.2.80.0140.00415.04
5.2.70.0080.00315.04
5.2.60.0110.00315.04
5.2.50.0100.00715.04
5.2.40.0160.00115.04
5.2.30.0160.00415.04
5.2.20.0150.00515.04
5.2.10.0150.00415.04
5.2.00.0150.00415.04
5.1.60.0110.00615.04
5.1.50.0110.00615.04
5.1.40.0120.00615.04
5.1.30.0120.00615.04
5.1.20.0160.00215.04
5.1.10.0150.00515.04
5.1.00.0140.00315.04
5.0.50.0100.00615.04
5.0.40.0110.00415.04
5.0.30.0140.00115.04
5.0.20.0100.00515.04
5.0.10.0120.00415.04
5.0.00.0090.00515.04
4.4.90.0040.00415.04
4.4.80.0080.00115.04
4.4.70.0080.00115.04
4.4.60.0080.00115.04
4.4.50.0080.00115.04
4.4.40.0090.00015.04
4.4.30.0070.00215.04
4.4.20.0070.00215.04
4.4.10.0070.00215.04
4.4.00.0060.00215.04
4.3.110.0090.00015.04
4.3.100.0090.00015.04
4.3.90.0080.00115.04
4.3.80.0070.00115.04
4.3.70.0050.00315.04
4.3.60.0080.00115.04
4.3.50.0070.00115.04
4.3.40.0060.00215.04
4.3.30.0060.00115.04
4.3.20.0050.00215.04
4.3.10.0050.00215.04
4.3.00.0060.00115.04

preferences:
82.7 ms | 403 KiB | 5 Q