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 = array()) { $this->array = $array; } public function offsetExists($offset) { echo 'called '; 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.0140.00718.55
8.3.50.0100.00722.05
8.3.40.0000.02118.79
8.3.30.0140.00020.09
8.3.20.0030.00518.77
8.3.10.0050.00321.14
8.3.00.0080.00019.69
8.2.180.0040.01116.75
8.2.170.0100.01022.96
8.2.160.0070.00720.35
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0040.00426.16
8.2.120.0130.00621.03
8.2.110.0040.00420.12
8.2.100.0030.01017.91
8.2.90.0080.00017.88
8.2.80.0040.00418.72
8.2.70.0050.00318.03
8.2.60.0030.00618.22
8.2.50.0000.00818.10
8.2.40.0090.00019.42
8.2.30.0040.00419.36
8.2.20.0000.00717.71
8.2.10.0000.00717.75
8.2.00.0030.00517.70
8.1.280.0150.00025.92
8.1.270.0060.00323.99
8.1.260.0070.00026.35
8.1.250.0000.00828.09
8.1.240.0080.00320.79
8.1.230.0060.00617.95
8.1.220.0040.00417.76
8.1.210.0000.00918.77
8.1.200.0030.00617.36
8.1.190.0050.00317.63
8.1.180.0080.00318.10
8.1.170.0080.00018.65
8.1.160.0030.00518.91
8.1.150.0040.00718.66
8.1.140.0050.00217.34
8.1.130.0000.00717.84
8.1.120.0030.00417.50
8.1.110.0070.00417.45
8.1.100.0000.00717.46
8.1.90.0040.00417.48
8.1.80.0030.00617.45
8.1.70.0000.00817.35
8.1.60.0040.00417.60
8.1.50.0040.00417.40
8.1.40.0000.00817.54
8.1.30.0040.00417.50
8.1.20.0060.00317.70
8.1.10.0000.00717.53
8.1.00.0040.00417.46
8.0.300.0040.00418.77
8.0.290.0080.00016.75
8.0.280.0030.00518.50
8.0.270.0060.00316.90
8.0.260.0070.00016.84
8.0.250.0000.00817.10
8.0.240.0030.00616.97
8.0.230.0080.00017.10
8.0.220.0030.00316.88
8.0.210.0000.00817.00
8.0.200.0000.00617.00
8.0.190.0070.00017.10
8.0.180.0000.00717.05
8.0.170.0040.00417.02
8.0.160.0050.00516.82
8.0.150.0050.00317.01
8.0.140.0000.00716.87
8.0.130.0000.00513.46
8.0.120.0040.00416.84
8.0.110.0040.00416.87
8.0.100.0000.00716.80
8.0.90.0040.00416.99
8.0.80.0030.01216.96
8.0.70.0040.00416.98
8.0.60.0080.00017.00
8.0.50.0030.00516.82
8.0.30.0130.00517.06
8.0.20.0120.00817.40
8.0.10.0050.00217.12
8.0.00.0090.01117.04
7.4.330.0020.00216.89
7.4.320.0040.00416.53
7.4.300.0030.00316.64
7.4.290.0000.00716.53
7.4.280.0030.00316.59
7.4.270.0000.00716.66
7.4.260.0000.00513.28
7.4.250.0040.00416.57
7.4.240.0000.00716.58
7.4.230.0070.00016.34
7.4.220.0180.00716.53
7.4.210.0070.00816.57
7.4.200.0070.00016.73
7.4.190.0070.00016.75
7.4.160.0060.01216.78
7.4.150.0110.00717.40
7.4.140.0110.00917.86
7.4.130.0030.01516.50
7.4.120.0080.01016.46
7.4.110.0120.00816.58
7.4.100.0090.01216.57
7.4.90.0090.00916.70
7.4.80.0170.00619.39
7.4.70.0100.01316.66
7.4.60.0070.01016.67
7.4.50.0000.00916.40
7.4.40.0040.01122.77
7.4.30.0080.00816.61
7.4.00.0060.00914.95
7.3.330.0030.00313.26
7.3.320.0000.00513.21
7.3.310.0000.00816.06
7.3.300.0000.00716.27
7.3.290.0030.01616.24
7.3.280.0060.01216.23
7.3.270.0120.00617.40
7.3.260.0100.00718.24
7.3.250.0100.00716.53
7.3.240.0100.00616.36
7.3.230.0130.00316.39
7.3.210.0110.00616.52
7.3.200.0130.01019.39
7.3.190.0040.01716.29
7.3.180.0100.01016.53
7.3.170.0130.00316.40
7.3.160.0140.00716.37
7.3.120.0020.01414.80
7.3.110.0130.00614.77
7.3.100.0060.00314.73
7.3.90.0110.00714.66
7.3.80.0110.00014.67
7.3.70.0110.00314.66
7.3.60.0030.00614.46
7.3.50.0030.01014.91
7.3.40.0030.01014.78
7.3.30.0030.01314.71
7.3.20.0100.00616.52
7.3.10.0050.01016.71
7.3.00.0080.00516.48
7.2.330.0170.00016.59
7.2.320.0150.00916.81
7.2.310.0150.00316.59
7.2.300.0000.01716.72
7.2.290.0110.00716.67
7.2.250.0090.00914.95
7.2.240.0040.01515.02
7.2.230.0070.00714.80
7.2.220.0060.01314.75
7.2.210.0000.01715.16
7.2.200.0030.00615.23
7.2.190.0060.00614.98
7.2.180.0070.00714.91
7.2.170.0120.00015.00
7.2.130.0090.00917.02
7.2.120.0040.01116.92
7.2.110.0100.00616.94
7.2.100.0060.00616.86
7.2.90.0040.01416.75
7.2.80.0080.00317.15
7.2.70.0030.00916.65
7.2.60.0100.00616.72
7.2.50.0030.01016.72
7.2.40.0060.00617.04
7.2.30.0040.01416.95
7.2.20.0070.00716.89
7.2.10.0060.00617.04
7.2.00.0050.01118.11
7.1.330.0140.00015.84
7.1.320.0080.00515.68
7.1.310.0070.00715.71
7.1.300.0030.01015.79
7.1.290.0120.00015.44
7.1.280.0100.00315.77
7.1.270.0000.01115.63
7.1.260.0140.00015.56
7.1.250.0070.00315.76
7.1.200.0070.00715.49
7.1.100.0040.01217.88
7.1.70.0030.00717.21
7.1.60.0040.01416.86
7.1.50.0040.01116.84
7.1.40.0070.01116.84
7.1.30.0060.00616.84
7.1.20.0060.01616.84
7.1.10.0030.00616.84
7.1.00.0000.00816.84
7.0.200.0080.00416.86
7.0.190.0000.01616.84
7.0.180.0030.00616.84
7.0.170.0000.01516.84
7.0.160.0000.01516.84
7.0.150.0030.00616.84
7.0.140.0040.00416.84
7.0.130.0060.01016.84
7.0.120.0030.00516.84
7.0.110.0000.00816.84
7.0.100.0030.00616.84
7.0.90.0000.00816.84
7.0.80.0030.00516.84
7.0.70.0030.00616.84
7.0.60.0040.00416.84
7.0.50.0000.00816.84
7.0.40.0100.00316.84
7.0.30.0040.00416.84
7.0.20.0030.00616.84
7.0.10.0030.00616.84
7.0.00.0100.00016.84
5.6.300.0210.04220.70
5.6.290.0000.05020.79
5.6.280.0030.04321.01
5.6.270.0000.04820.88
5.6.260.0230.04221.04
5.6.250.0030.03920.91
5.6.240.0070.04021.04
5.6.230.0000.04420.87
5.6.220.0000.04920.85
5.6.210.0000.04821.05
5.6.200.0100.03520.98
5.6.190.0070.04120.80
5.6.180.0000.04721.04
5.6.170.0030.04321.04
5.6.160.0030.04220.83
5.6.150.0030.04620.84
5.6.140.0070.06520.83
5.6.130.0030.03920.98
5.6.120.0030.04721.01
5.6.110.0210.03820.95
5.6.100.0000.04620.95
5.6.90.0030.08720.95
5.6.80.0000.04520.35
5.6.70.0140.04120.32
5.6.60.0030.04220.25
5.6.50.0060.03520.10
5.6.40.0000.07020.11
5.6.30.0100.06620.22
5.6.20.0070.06320.29
5.6.10.0100.08020.29
5.6.00.0030.05220.18
5.5.380.0000.04417.56
5.5.370.0030.03817.63
5.5.360.0000.04517.43
5.5.350.0000.04117.58
5.5.340.0000.04818.07
5.5.330.0030.04117.88
5.5.320.0030.03918.00
5.5.310.0000.04418.07
5.5.300.0070.04118.18
5.5.290.0070.08518.02
5.5.280.0030.07118.05
5.5.270.0000.04717.75
5.5.260.0100.07218.05
5.5.250.0060.07117.98
5.5.240.0100.04017.37
5.5.230.0030.04117.38
5.5.220.0140.03817.39
5.5.210.0000.08417.08
5.5.200.0000.04417.45
5.5.190.0030.04017.43
5.5.180.0070.07617.43
5.5.160.0070.07417.45
5.5.150.0030.08017.52
5.5.140.0030.06217.05
5.5.130.0030.03717.34
5.5.120.0030.03717.44
5.5.110.0100.05217.33
5.5.100.0030.03717.35
5.5.90.0000.07916.95
5.5.80.0030.07317.31
5.5.70.0030.07817.30
5.5.60.0100.06617.34
5.5.50.0070.05317.08
5.5.40.0070.03617.33
5.5.30.0030.04017.24
5.5.20.0030.04316.95
5.5.10.0040.03917.24
5.5.00.0000.04517.30
5.4.450.0030.05419.38
5.4.440.0030.04319.44
5.4.430.0000.04219.38
5.4.420.0070.07919.51
5.4.410.0130.03219.36
5.4.400.0070.03919.00
5.4.390.0000.04319.06
5.4.380.0000.04518.97
5.4.370.0030.04919.12
5.4.360.0000.04919.13
5.4.350.0030.04019.05
5.4.340.0000.04119.22
5.4.320.0070.05319.09
5.4.310.0000.04419.20
5.4.300.0070.04419.15
5.4.290.0030.04118.96
5.4.280.0070.03619.09
5.4.270.0070.07419.18
5.4.260.0030.04218.94
5.4.250.0000.06119.05
5.4.240.0100.07018.97
5.4.230.0000.06918.91
5.4.220.0000.08818.97
5.4.210.0070.06419.19
5.4.200.0000.04419.05
5.4.190.0000.04419.05
5.4.180.0040.03918.97
5.4.170.0030.04019.04
5.4.160.0000.04518.91
5.4.150.0030.04019.01
5.4.140.0030.03616.84
5.4.130.0100.05116.84
5.4.120.0070.03916.84
5.4.110.0030.05216.84
5.4.100.0060.06816.84
5.4.90.0070.03616.84
5.4.80.0030.03416.84
5.4.70.0070.05616.84
5.4.60.0000.04316.84
5.4.50.0000.05716.84
5.4.40.0030.03416.84
5.4.30.0000.03816.84
5.4.20.0070.03216.84
5.4.10.0030.06516.84
5.4.00.0100.04316.84
5.3.290.0060.05416.84
5.3.280.0070.05016.84
5.3.270.0000.04216.84
5.3.260.0000.05616.84
5.3.250.0100.06116.84
5.3.240.0000.04016.84
5.3.230.0000.05216.84
5.3.220.0000.03916.84
5.3.210.0030.07916.84
5.3.200.0070.08316.84
5.3.190.0030.05416.84
5.3.180.0030.07116.84
5.3.170.0060.05416.84
5.3.160.0030.04316.84
5.3.150.0060.03616.84
5.3.140.0240.03116.84
5.3.130.0000.04016.84
5.3.120.0000.04016.84
5.3.110.0060.04116.84
5.3.100.0030.06116.84
5.3.90.0030.04516.84
5.3.80.0130.02916.84
5.3.70.0030.03716.84
5.3.60.0030.03416.84
5.3.50.0000.04716.84
5.3.40.0030.03616.84
5.3.30.0000.05616.84
5.3.20.0030.05516.84
5.3.10.0090.02816.84
5.3.00.0090.03116.84
5.2.170.0030.02816.84
5.2.160.0030.02816.84
5.2.150.0030.02916.84
5.2.140.0030.02916.84
5.2.130.0000.03816.84
5.2.120.0000.03116.84
5.2.110.0000.04416.84
5.2.100.0000.03316.84
5.2.90.0030.06116.84
5.2.80.0030.05916.84
5.2.70.0030.06116.84
5.2.60.0070.06016.84
5.2.50.0030.06116.84
5.2.40.0030.02916.84
5.2.30.0000.03416.84
5.2.20.0000.03316.84
5.2.10.0030.02816.84
5.2.00.0030.02816.84
5.1.60.0000.02716.84
5.1.50.0000.02916.84
5.1.40.0030.02616.84
5.1.30.0030.02616.84
5.1.20.0000.02816.84
5.1.10.0030.02416.84
5.1.00.0000.02916.84
5.0.50.0200.01716.84
5.0.40.0060.01916.84
5.0.30.0030.02816.84
5.0.20.0030.03016.84
5.0.10.0000.02016.84
5.0.00.0060.05116.84
4.4.90.0030.01916.84
4.4.80.0000.01616.84
4.4.70.0000.01716.84
4.4.60.0000.01616.84
4.4.50.0040.01416.84
4.4.40.0000.02916.84
4.4.30.0000.01716.84
4.4.20.0000.01716.84
4.4.10.0040.01416.84
4.4.00.0000.02516.84
4.3.110.0000.03816.84
4.3.100.0000.01516.84
4.3.90.0000.01616.84
4.3.80.0000.03316.84
4.3.70.0080.01116.84
4.3.60.0030.01316.84
4.3.50.0000.01816.84
4.3.40.0030.02316.84
4.3.30.0000.01716.84
4.3.20.0040.01416.84
4.3.10.0160.01316.84
4.3.00.0000.01816.84

preferences:
47.67 ms | 401 KiB | 5 Q