3v4l.org

run code in 300+ PHP versions simultaneously
<?php /* * This file is part of the Symfony package. * * (c) Fabien Potencier <fabien@symfony.com> * * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ /** * This class is a hand written simplified version of PHP native `ArrayObject` * class, to show that it behaves differently than the PHP native implementation. */ class CustomArrayObject implements ArrayAccess, IteratorAggregate, Countable, Serializable { private $array; public function __construct(array $array = null) { $this->array = $array ?: array(); } public function offsetExists($offset) { return array_key_exists($offset, $this->array); } public function offsetGet($offset) { return $this->array[$offset]; } public function offsetSet($offset, $value) { if (null === $offset) { $this->array[] = $value; } else { $this->array[$offset] = $value; } } public function offsetUnset($offset) { unset($this->array[$offset]); } public function getIterator() { return new ArrayIterator($this->array); } public function count() { return count($this->array); } public function serialize() { return serialize($this->array); } public function unserialize($serialized) { $this->array = (array) unserialize((string) $serialized); } } $array = array('foo' => 'bar', 'nulled' => null); $native = new ArrayObject($array); $custom = new CustomArrayObject($array); error_reporting(-1); $a = array_key_exists('missing', $custom); var_dump(isset($custom['missing']) || array_key_exists('missing', $custom));

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.0110.01118.39
8.3.50.0150.00821.14
8.3.40.0160.00318.76
8.3.30.0120.00320.34
8.3.20.0080.00018.71
8.3.10.0000.00821.00
8.3.00.0040.00419.60
8.2.180.0100.00716.63
8.2.170.0120.00618.96
8.2.160.0070.00722.96
8.2.150.0080.00025.66
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0080.00021.18
8.2.110.0100.00019.38
8.2.100.0080.00317.84
8.2.90.0030.00519.16
8.2.80.0030.00517.97
8.2.70.0080.00017.63
8.2.60.0040.00417.93
8.2.50.0000.00818.10
8.2.40.0030.00917.90
8.2.30.0040.00419.46
8.2.20.0000.00717.71
8.2.10.0000.00817.88
8.2.00.0100.00017.70
8.1.280.0040.01425.92
8.1.270.0030.01620.25
8.1.260.0080.00426.35
8.1.250.0030.00628.09
8.1.240.0040.00719.21
8.1.230.0080.00417.82
8.1.220.0030.00617.74
8.1.210.0040.00418.77
8.1.200.0040.00417.35
8.1.190.0050.00317.22
8.1.180.0000.00918.10
8.1.170.0090.00018.68
8.1.160.0080.00018.79
8.1.150.0030.00718.66
8.1.140.0030.00517.38
8.1.130.0000.00717.76
8.1.120.0050.00317.48
8.1.110.0050.00617.37
8.1.100.0000.00717.53
8.1.90.0050.00217.47
8.1.80.0000.00817.40
8.1.70.0070.00017.43
8.1.60.0040.00417.66
8.1.50.0040.00417.55
8.1.40.0000.00817.50
8.1.30.0030.00617.59
8.1.20.0040.00417.57
8.1.10.0040.00417.53
8.1.00.0040.00417.54
8.0.300.0040.00418.77
8.0.290.0000.00816.62
8.0.280.0050.00318.38
8.0.270.0050.00317.19
8.0.260.0030.00316.90
8.0.250.0040.00416.95
8.0.240.0000.00816.91
8.0.230.0000.00716.98
8.0.220.0030.00317.02
8.0.210.0030.00616.93
8.0.200.0060.00017.05
8.0.190.0030.00317.02
8.0.180.0040.00417.00
8.0.170.0070.00016.87
8.0.160.0040.00416.97
8.0.150.0070.00016.98
8.0.140.0070.00016.98
8.0.130.0030.00313.37
8.0.120.0050.00216.90
8.0.110.0040.00416.97
8.0.100.0070.00016.91
8.0.90.0040.00416.76
8.0.80.0090.00616.93
8.0.70.0000.00816.81
8.0.60.0080.00016.95
8.0.50.0000.00816.97
8.0.30.0090.01017.20
8.0.20.0080.01117.40
8.0.10.0040.00416.98
8.0.00.0100.00916.91
7.4.330.0000.00416.67
7.4.320.0030.00716.44
7.4.300.0030.00316.42
7.4.290.0080.00016.53
7.4.280.0030.00316.64
7.4.270.0000.00716.64
7.4.260.0030.00313.29
7.4.250.0040.00416.49
7.4.240.0000.00816.66
7.4.230.0030.00316.57
7.4.220.0060.01216.62
7.4.210.0090.00816.68
7.4.200.0030.00316.61
7.4.190.0040.00416.40
7.4.160.0100.01016.54
7.4.150.0080.01417.40
7.4.140.0150.00817.86
7.4.130.0110.01016.60
7.4.120.0110.00616.65
7.4.110.0120.01216.71
7.4.100.0070.01016.52
7.4.90.0130.01016.55
7.4.80.0060.01819.39
7.4.70.0080.01316.52
7.4.60.0140.00516.70
7.4.50.0080.00016.61
7.4.40.0070.00722.77
7.4.30.0100.01016.39
7.4.10.0060.01215.04
7.4.00.0070.01015.08
7.3.330.0050.00013.32
7.3.320.0050.00013.20
7.3.310.0030.00316.38
7.3.300.0050.00216.25
7.3.290.0030.01516.42
7.3.280.0080.00716.36
7.3.270.0090.00917.40
7.3.260.0080.01018.24
7.3.250.0070.01316.47
7.3.240.0120.00616.66
7.3.230.0160.00016.66
7.3.210.0080.00816.66
7.3.200.0100.01019.39
7.3.190.0110.01116.62
7.3.180.0210.00016.33
7.3.170.0060.00916.68
7.3.160.0070.01016.70
7.3.130.0110.00715.08
7.3.120.0100.00714.72
7.3.110.0050.01114.85
7.3.100.0040.01114.97
7.3.90.0080.00914.93
7.3.80.0030.01114.79
7.3.70.0020.01314.73
7.3.60.0050.01014.93
7.3.50.0060.00614.76
7.3.40.0050.00814.75
7.3.30.0020.01114.94
7.3.20.0040.01116.54
7.3.10.0060.00916.66
7.3.00.0070.00616.75
7.2.330.0100.00716.80
7.2.320.0140.00416.79
7.2.310.0140.01016.59
7.2.300.0130.00316.50
7.2.290.0090.00916.58
7.2.260.0120.00615.34
7.2.250.0130.00214.92
7.2.240.0020.01314.81
7.2.230.0050.00915.03
7.2.220.0100.00514.86
7.2.210.0050.01014.98
7.2.200.0090.00215.22
7.2.190.0070.00814.95
7.2.180.0070.00714.90
7.2.170.0070.00714.93
7.2.160.0030.01214.98
7.2.150.0030.01317.00
7.2.140.0100.00716.82
7.2.130.0070.00317.10
7.2.120.0080.00516.89
7.2.110.0030.01317.01
7.2.100.0000.01216.97
7.2.90.0080.00417.22
7.2.80.0090.00616.88
7.2.70.0110.00717.10
7.2.60.0070.00717.20
7.2.50.0060.01216.98
7.2.40.0070.01016.64
7.2.30.0030.01017.04
7.2.20.0080.01116.95
7.2.10.0030.01316.57
7.2.00.0090.00318.19
7.1.330.0090.00415.68
7.1.320.0050.00815.85
7.1.310.0060.00815.74
7.1.300.0070.00715.78
7.1.290.0080.00815.68
7.1.280.0020.01115.87
7.1.270.0000.01315.80
7.1.260.0110.00215.90
7.1.250.0060.00315.91
7.1.240.0060.01015.86
7.1.230.0060.00915.93
7.1.220.0000.01015.76
7.1.210.0000.01615.76
7.1.200.0110.00615.79
7.1.190.0030.01215.66
7.1.180.0060.00615.63
7.1.170.0080.00415.69
7.1.160.0070.00715.70
7.1.150.0100.00315.65
7.1.140.0090.00615.76
7.1.130.0140.00015.66
7.1.120.0040.00715.76
7.1.110.0030.01015.79
7.1.100.0060.00616.96
7.1.90.0100.00315.46
7.1.80.0040.00415.57
7.1.70.0090.00316.43
7.1.60.0090.01017.40
7.1.50.0070.01216.42
7.1.40.0060.00615.59
7.1.30.0060.00915.85
7.1.20.0070.00715.67
7.1.10.0060.00315.85
7.1.00.0050.02819.10
7.0.330.0070.00315.56
7.0.320.0000.01215.39
7.0.310.0030.01315.54
7.0.300.0030.01015.45
7.0.290.0030.00915.00
7.0.280.0040.00415.42
7.0.270.0030.01215.33
7.0.260.0000.01315.45
7.0.250.0070.00715.45
7.0.240.0060.00615.56
7.0.230.0090.00015.32
7.0.220.0050.00915.40
7.0.210.0040.01115.24
7.0.200.0030.00816.17
7.0.190.0060.00615.45
7.0.180.0080.00315.34
7.0.170.0080.00615.18
7.0.160.0080.00015.44
7.0.150.0000.01315.01
7.0.140.0020.04418.79
7.0.130.0000.01115.42
7.0.120.0000.00915.52
7.0.110.0060.00615.41
7.0.100.0090.04117.55
7.0.90.0080.03317.60
7.0.80.0050.03417.58
7.0.70.0040.02917.55
7.0.60.0020.04317.63
7.0.50.0120.02917.97
7.0.40.0090.04316.79
7.0.30.0100.03816.73
7.0.20.0020.04516.86
7.0.10.0050.03316.66
7.0.00.0110.03116.87
5.6.400.0030.01014.47
5.6.390.0070.01014.32
5.6.380.0030.01314.54
5.6.370.0070.01014.40
5.6.360.0040.01114.42
5.6.350.0030.00714.23
5.6.340.0110.00414.34
5.6.330.0070.00714.26
5.6.320.0030.01014.33
5.6.310.0040.01114.55
5.6.300.0000.00814.57
5.6.290.0030.01014.48
5.6.280.0050.03817.84
5.6.270.0040.00714.45
5.6.260.0090.00614.13
5.6.250.0040.04417.41
5.6.240.0050.03217.55
5.6.230.0090.04417.55
5.6.220.0070.04317.52
5.6.210.0110.02817.43
5.6.200.0060.03217.61
5.6.190.0110.04517.73
5.6.180.0080.02717.63
5.6.170.0070.02817.77
5.6.160.0070.04217.87
5.6.150.0060.03217.72
5.6.140.0050.03017.69
5.6.130.0020.03317.70
5.6.120.0040.04217.69
5.6.110.0140.03617.75
5.6.100.0070.02417.67
5.6.90.0070.02717.65
5.6.80.0030.02517.38
5.6.70.0030.02317.34
5.6.60.0030.02417.28
5.6.50.0020.02517.26
5.6.40.0140.01717.39
5.6.30.0080.01817.40
5.6.20.0050.02217.49
5.6.10.0080.02417.34
5.6.00.0080.01917.33
5.5.380.0070.04717.46
5.5.370.0050.04517.17
5.5.360.0020.04417.47
5.5.350.0100.04017.32
5.5.340.0080.04217.52
5.5.330.0030.03517.53
5.5.320.0070.02817.43
5.5.310.0100.03217.55
5.5.300.0080.04817.41
5.5.290.0080.03817.66
5.5.280.0050.04717.70
5.5.270.0030.03117.54
5.5.260.0030.02617.68
5.5.250.0060.02217.50
5.5.240.0030.02517.06
5.5.230.0070.02417.11
5.5.220.0050.02917.29
5.5.210.0050.03417.33
5.5.200.0030.02617.05
5.5.190.0050.02317.17
5.5.180.0030.02417.34
5.5.170.0070.00714.41
5.5.160.0020.02817.19
5.5.150.0050.02117.14
5.5.140.0030.04017.23
5.5.130.0070.03517.26
5.5.120.0030.02717.21
5.5.110.0020.02517.32
5.5.100.0060.02417.09
5.5.90.0050.02217.11
5.5.80.0030.02817.12
5.5.70.0030.03017.28
5.5.60.0050.02717.13
5.5.50.0050.02317.33
5.5.40.0080.01817.31
5.5.30.0090.02317.26
5.5.20.0050.02017.08
5.5.10.0030.02717.25
5.5.00.0090.02217.03
5.4.450.0070.04315.60
5.4.440.0100.03815.71
5.4.430.0110.03615.68
5.4.420.0020.03315.78
5.4.410.0070.03815.61
5.4.400.0070.02015.52
5.4.390.0050.02215.54
5.4.380.0050.02215.59
5.4.370.0010.02415.50
5.4.360.0040.02215.58
5.4.350.0030.02415.44
5.4.340.0000.02715.59
5.4.330.0060.00312.00
5.4.320.0020.02215.60
5.4.310.0050.03815.52
5.4.300.0050.02915.59
5.4.290.0030.03915.59
5.4.280.0050.02115.45
5.4.270.0080.03315.52
5.4.260.0060.02215.42
5.4.250.0070.02115.51
5.4.240.0040.02415.52
5.4.230.0050.02215.56
5.4.220.0100.01515.45
5.4.210.0070.02215.57
5.4.200.0050.01915.42
5.4.190.0050.01915.42
5.4.180.0030.02015.55
5.4.170.0070.02015.43
5.4.160.0050.01915.57
5.4.150.0100.01515.52
5.4.140.0030.02014.17
5.4.130.0060.02014.22
5.4.120.0040.02214.21
5.4.110.0060.01714.22
5.4.100.0060.01914.13
5.4.90.0080.01814.12
5.4.80.0030.02014.24
5.4.70.0070.01314.13
5.4.60.0050.01714.24
5.4.50.0030.02014.23
5.4.40.0050.02714.26
5.4.30.0030.04114.19
5.4.20.0050.02314.17
5.4.10.0020.03314.22
5.4.00.0060.03813.93
5.3.290.0000.02813.79
5.3.280.0050.02313.79
5.3.270.0030.02113.79
5.3.260.0040.01513.79
5.3.250.0070.01713.79
5.3.240.0050.01813.79
5.3.230.0040.02613.79
5.3.220.0090.01313.79
5.3.210.0080.01513.79
5.3.200.0030.02313.79
5.3.190.0020.02013.79
5.3.180.0000.02513.79
5.3.170.0030.01813.79
5.3.160.0070.01513.79
5.3.150.0030.02213.79
5.3.140.0020.02013.79
5.3.130.0060.03513.79
5.3.120.0000.04513.79
5.3.110.0030.02413.79
5.3.100.0100.02713.79
5.3.90.0070.03013.79
5.3.80.0080.03713.79
5.3.70.0050.03413.79
5.3.60.0080.03313.79
5.3.50.0100.03513.79
5.3.40.0070.03413.79
5.3.30.0070.03713.79
5.3.20.0070.02213.79
5.3.10.0030.03813.79
5.3.00.0080.02313.79
5.2.170.0000.03015.58
5.2.160.0030.06315.58
5.2.150.0030.06315.58
5.2.140.0030.06715.58
5.2.130.0070.06015.58
5.2.120.0000.06315.58
5.2.110.0070.06015.58
5.2.100.0030.04015.58
5.2.90.0130.04715.58
5.2.80.0000.06315.58
5.2.70.0130.05015.58
5.2.60.0000.04315.58
5.2.50.0070.05715.58
5.2.40.0100.02715.58
5.2.30.0100.04315.58
5.2.20.0030.03715.58
5.2.10.0100.05315.58
5.2.00.0070.03015.58
5.1.60.0070.04715.58
5.1.50.0030.04015.58
5.1.40.0130.04315.58
5.1.30.0030.03715.58
5.1.20.0030.04715.58
5.1.10.0070.05315.58
5.1.00.0030.05715.58
5.0.50.0030.04315.58
5.0.40.0000.02315.58
5.0.30.0000.05715.58
5.0.20.0000.02315.58
5.0.10.0030.03715.58
5.0.00.0030.06315.58
4.4.90.0000.03715.58
4.4.80.0000.03715.58
4.4.70.0000.01715.58
4.4.60.0000.03315.58
4.4.50.0000.02015.58
4.4.40.0030.04715.58
4.4.30.0000.02015.58
4.4.20.0000.03315.58
4.4.10.0100.02715.58
4.4.00.0030.05315.58
4.3.110.0070.02315.58
4.3.100.0070.02315.58
4.3.90.0000.03315.58
4.3.80.0030.05015.58
4.3.70.0030.01315.58
4.3.60.0000.03315.58
4.3.50.0000.03715.58
4.3.40.0100.04715.58
4.3.30.0000.03715.58
4.3.20.0030.03715.58
4.3.10.0000.03715.58
4.3.00.0070.03015.58

preferences:
41.44 ms | 401 KiB | 5 Q