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) { 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.68
8.3.50.0110.00821.14
8.3.40.0120.00918.79
8.3.30.0110.00420.26
8.3.20.0050.00318.88
8.3.10.0080.00021.28
8.3.00.0090.00619.79
8.2.180.0180.00316.63
8.2.170.0100.01022.96
8.2.160.0100.00320.52
8.2.150.0030.00524.18
8.2.140.0050.00324.66
8.2.130.0120.00626.16
8.2.120.0070.00021.00
8.2.110.0000.01022.11
8.2.100.0060.00617.97
8.2.90.0050.00319.11
8.2.80.0030.00517.97
8.2.70.0040.00417.63
8.2.60.0080.00018.16
8.2.50.0050.00318.10
8.2.40.0030.00618.22
8.2.30.0000.00819.36
8.2.20.0040.00417.86
8.2.10.0040.00417.73
8.2.00.0040.00417.89
8.1.280.0140.00425.92
8.1.270.0110.00323.99
8.1.260.0070.00026.35
8.1.250.0050.00328.09
8.1.240.0030.00622.14
8.1.230.0090.00317.83
8.1.220.0040.00417.78
8.1.210.0040.00418.77
8.1.200.0060.00317.25
8.1.190.0080.00017.35
8.1.180.0040.00418.10
8.1.170.0080.00018.61
8.1.160.0020.00518.89
8.1.150.0120.00018.77
8.1.140.0000.00817.38
8.1.130.0070.00017.86
8.1.120.0000.00717.48
8.1.110.0040.00717.47
8.1.100.0000.00817.49
8.1.90.0040.00417.49
8.1.80.0020.00517.43
8.1.70.0050.00317.43
8.1.60.0050.00317.49
8.1.50.0080.00017.51
8.1.40.0000.00717.42
8.1.30.0040.00417.58
8.1.20.0030.00617.64
8.1.10.0030.00617.56
8.1.00.0040.00417.60
8.0.300.0040.00418.77
8.0.290.0050.00316.75
8.0.280.0070.00018.37
8.0.270.0070.00017.28
8.0.260.0030.00316.89
8.0.250.0040.00417.04
8.0.240.0030.00617.06
8.0.230.0030.00317.04
8.0.220.0030.00316.93
8.0.210.0000.01016.85
8.0.200.0000.00617.01
8.0.190.0070.00017.05
8.0.180.0070.00017.06
8.0.170.0000.00717.00
8.0.160.0090.00016.94
8.0.150.0000.00716.96
8.0.140.0040.00416.93
8.0.130.0000.00513.39
8.0.120.0050.00316.84
8.0.110.0000.00816.82
8.0.100.0040.00416.84
8.0.90.0050.00316.87
8.0.80.0120.00916.96
8.0.70.0060.00316.99
8.0.60.0040.00416.95
8.0.50.0000.00716.85
8.0.30.0050.01416.98
8.0.20.0110.00717.40
8.0.10.0040.00417.11
8.0.00.0120.00716.94
7.4.330.0000.00516.80
7.4.320.0030.00616.54
7.4.300.0000.00716.38
7.4.290.0000.00816.63
7.4.280.0070.00016.62
7.4.270.0030.00516.62
7.4.260.0000.00513.34
7.4.250.0040.00416.46
7.4.240.0030.00316.56
7.4.230.0030.00316.55
7.4.220.0090.00916.49
7.4.210.0080.01116.60
7.4.200.0000.00816.36
7.4.190.0070.00016.62
7.4.160.0110.01116.57
7.4.150.0130.00617.40
7.4.140.0100.00717.86
7.4.130.0100.00816.48
7.4.120.0100.00716.53
7.4.110.0100.01016.68
7.4.100.0090.00916.62
7.4.90.0110.00816.52
7.4.80.0090.01019.39
7.4.70.0070.01016.58
7.4.60.0100.00716.43
7.4.50.0030.00516.37
7.4.40.0070.00722.77
7.4.30.0070.01016.40
7.4.00.0070.01014.88
7.3.330.0030.00313.05
7.3.320.0050.00013.12
7.3.310.0070.00016.13
7.3.300.0070.00016.13
7.3.290.0030.01316.20
7.3.280.0030.01316.27
7.3.270.0090.00917.40
7.3.260.0150.01318.24
7.3.250.0100.00916.38
7.3.240.0100.00716.55
7.3.230.0130.00316.55
7.3.210.0140.00416.46
7.3.200.0140.00319.39
7.3.190.0060.01216.18
7.3.180.0030.01216.46
7.3.170.0040.01216.42
7.3.160.0030.01316.41
7.3.120.0030.01014.73
7.3.10.0160.00616.59
7.3.00.0140.00416.51
7.2.330.0170.00016.83
7.2.320.0120.00616.79
7.2.310.0120.01316.41
7.2.300.0120.00616.81
7.2.290.0130.00416.70
7.2.130.0140.00716.74
7.2.120.0120.00616.59
7.2.110.0030.01016.65
7.2.100.0110.00716.68
7.2.90.0140.00516.74
7.2.80.0070.00916.69
7.2.70.0120.00616.78
7.2.60.0050.01116.47
7.2.50.0110.01016.90
7.2.40.0120.00616.80
7.2.30.0120.00316.54
7.2.20.0160.00516.63
7.2.10.0140.00416.92
7.2.00.0130.00517.64
7.1.250.0060.01115.32
7.1.200.0030.00915.94
7.1.100.0060.00618.30
7.1.70.0030.00517.23
7.1.60.0060.00617.04
7.1.50.0100.00317.06
7.1.40.0060.00616.57
7.1.30.0070.00716.75
7.1.20.0040.00716.71
7.1.10.0030.00516.77
7.1.00.0040.00716.61
7.0.200.0000.00916.79
7.0.190.0050.00216.84
7.0.180.0040.00416.57
7.0.170.0090.00016.57
7.0.160.0000.00916.57
7.0.150.0000.01116.57
7.0.140.0090.00616.57
7.0.130.0000.00716.57
7.0.120.0000.00716.71
7.0.110.0030.00716.57
7.0.100.0000.00716.57
7.0.90.0070.00016.57
7.0.80.0030.00716.57
7.0.70.0000.00916.57
7.0.60.0070.00316.57
7.0.50.0000.00916.57
7.0.40.0000.00816.57
7.0.30.0000.00816.57
7.0.20.0000.00716.57
7.0.10.0040.00416.57
7.0.00.0040.00416.57
5.6.300.0030.05020.82
5.6.290.0070.04720.58
5.6.280.0030.05021.02
5.6.270.0190.06421.01
5.6.260.0100.03721.03
5.6.250.0000.05320.79
5.6.240.0030.04320.82
5.6.230.0260.04220.81
5.6.220.0130.03820.86
5.6.210.0000.05920.79
5.6.200.0000.04820.98
5.6.190.0000.04720.84
5.6.180.0030.04221.01
5.6.170.0000.05020.70
5.6.160.0040.04620.84
5.6.150.0030.04420.90
5.6.140.0030.04721.00
5.6.130.0060.04520.79
5.6.120.0040.04720.91
5.6.110.0070.04320.77
5.6.100.0130.04320.91
5.6.90.0000.05020.88
5.6.80.0170.04020.37
5.6.70.0120.03720.32
5.6.60.0100.04020.09
5.6.50.0030.04520.19
5.6.40.0000.04820.18
5.6.30.0060.04320.36
5.6.20.0000.05020.09
5.6.10.0110.04020.08
5.6.00.0030.04020.30
5.5.380.0000.05217.55
5.5.370.0030.04217.54
5.5.360.0070.04717.42
5.5.350.0060.04117.63
5.5.340.0030.04718.10
5.5.330.0030.04518.04
5.5.320.0070.04118.09
5.5.310.0000.04618.00
5.5.300.0140.04018.04
5.5.290.0000.05418.00
5.5.280.0030.05018.01
5.5.270.0140.03618.16
5.5.260.0100.04018.17
5.5.250.0030.04817.87
5.5.240.0000.05217.47
5.5.230.0160.03817.51
5.5.220.0000.04417.21
5.5.210.0150.03017.41
5.5.200.0120.03917.50
5.5.190.0040.04317.31
5.5.180.0140.03417.09
5.5.160.0100.04017.48
5.5.150.0070.03917.21
5.5.140.0070.03617.21
5.5.130.0190.04217.45
5.5.120.0070.03817.09
5.5.110.0070.03617.43
5.5.100.0130.03317.35
5.5.90.0070.03717.09
5.5.80.0030.04017.11
5.5.70.0090.03316.95
5.5.60.0130.03617.34
5.5.50.0160.03917.33
5.5.40.0080.03717.36
5.5.30.0030.06517.36
5.5.20.0170.03117.34
5.5.10.0030.03917.29
5.5.00.0130.03217.09
5.4.450.0100.05219.42
5.4.440.0090.04119.38
5.4.430.0040.04619.52
5.4.420.0070.04319.23
5.4.410.0070.04519.45
5.4.400.0040.04619.07
5.4.390.0140.03619.09
5.4.380.0100.03918.98
5.4.370.0100.03619.23
5.4.360.0180.04319.02
5.4.350.0070.04118.89
5.4.340.0140.03119.06
5.4.320.0030.04819.07
5.4.310.0130.05219.06
5.4.300.0130.03519.11
5.4.290.0070.03619.06
5.4.280.0130.03218.95
5.4.270.0090.03719.20
5.4.260.0090.03719.13
5.4.250.0000.04519.10
5.4.240.0030.04519.06
5.4.230.0070.03618.91
5.4.220.0030.04618.97
5.4.210.0160.04218.96
5.4.200.0000.04218.97
5.4.190.0060.03919.15
5.4.180.0130.03119.06
5.4.170.0070.03918.97
5.4.160.0040.04218.96
5.4.150.0070.05818.96
5.4.140.0070.04516.59
5.4.130.0040.03616.57
5.4.120.0030.04216.57
5.4.110.0070.03516.63
5.4.100.0100.03216.70
5.4.90.0000.05316.64
5.4.80.0070.03416.70
5.4.70.0230.03316.61
5.4.60.0030.04016.68
5.4.50.0000.04116.60
5.4.40.0070.04116.65
5.4.30.0030.03816.68
5.4.20.0030.03716.70
5.4.10.0040.03916.62
5.4.00.0060.03516.57
5.3.290.0000.04816.57
5.3.280.0070.05816.57
5.3.270.0030.04616.57
5.3.260.0060.03616.57
5.3.250.0060.04116.57
5.3.240.0170.02416.57
5.3.230.0100.03516.57
5.3.220.0000.04416.57
5.3.210.0030.06216.57
5.3.200.0000.04916.57
5.3.190.0040.04316.57
5.3.180.0030.04216.57
5.3.170.0090.03516.57
5.3.160.0070.03416.57
5.3.150.0100.03416.57
5.3.140.0140.03116.57
5.3.130.0070.04016.57
5.3.120.0040.04716.57
5.3.110.0030.04016.57
5.3.100.0030.03916.57
5.3.90.0110.03216.57
5.3.80.0070.03316.57
5.3.70.0030.03716.57
5.3.60.0070.03416.57
5.3.50.0140.02816.57
5.3.40.0030.04216.57
5.3.30.0030.03816.57
5.3.20.0000.03916.57
5.3.10.0000.03816.57
5.3.00.0100.03116.57
5.2.170.0030.03216.57
5.2.160.0000.03416.57
5.2.150.0030.02916.57
5.2.140.0070.03116.57
5.2.130.0000.04016.57
5.2.120.0110.02516.57
5.2.110.0060.02816.57
5.2.100.0030.03116.57
5.2.90.0030.03016.57
5.2.80.0070.02916.57
5.2.70.0000.03216.57
5.2.60.0070.02716.57
5.2.50.0040.02916.57
5.2.40.0100.02316.57
5.2.30.0000.03216.57
5.2.20.0000.03616.57
5.2.10.0100.02316.57
5.2.00.0030.03116.57
5.1.60.0030.02716.57
5.1.50.0000.02916.57
5.1.40.0060.02216.57
5.1.30.0060.02416.57
5.1.20.0030.02816.57
5.1.10.0000.03016.57
5.1.00.0060.02616.57
5.0.50.0040.02616.57
5.0.40.0030.02016.57
5.0.30.0060.02816.57
5.0.20.0030.02016.57
5.0.10.0070.01716.57
5.0.00.0040.03016.57
4.4.90.0000.02016.57
4.4.80.0000.01716.57
4.4.70.0000.01716.57
4.4.60.0030.01816.57
4.4.50.0030.01316.57
4.4.40.0040.02716.57
4.4.30.0030.01416.57
4.4.20.0040.01516.57
4.4.10.0040.01516.57
4.4.00.0040.02316.57
4.3.110.0000.01916.57
4.3.100.0070.01416.57
4.3.90.0030.02216.57
4.3.80.0100.02516.57
4.3.70.0000.01716.57
4.3.60.0030.01316.57
4.3.50.0030.01316.57
4.3.40.0000.02516.57
4.3.30.0000.01716.57
4.3.20.0050.01316.57
4.3.10.0030.03816.57
4.3.00.0060.02916.57

preferences:
79.66 ms | 401 KiB | 5 Q