3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Entity { protected $_properties = []; public function &__get($property) { $value = null; if (isset($this->_properties[$property])) { $value =& $this->_properties[$property]; } return $value; } public function __set($property, $value) { $this->_properties[$property] = $value; } } class CustomIterator extends IteratorIterator { public $callback; public function __construct($items) { $this->callback = function ($a) { $a->foo .= ' world'; return $a; }; parent::__construct($items); } public function current() { $c = $this->callback; return $c(parent::current()); } } $entity = new Entity(); $entity->foo = 'hello'; $it = new CustomIterator(new ArrayIterator([$entity])); $it->rewind(); var_dump($it->current());

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.1.110.0030.00517.51
8.1.100.0040.00417.48
8.1.90.0050.00417.40
8.1.80.0030.00317.36
8.1.70.0000.00717.40
8.1.60.0070.00317.56
8.1.50.0030.00617.53
8.1.40.0040.00417.43
8.1.30.0030.00517.63
8.1.20.0030.00617.69
8.1.10.0050.00317.59
8.1.00.0040.00417.45
8.0.240.0030.00316.95
8.0.230.0030.00516.90
8.0.220.0040.00416.87
8.0.210.0040.00416.90
8.0.200.0000.00716.96
8.0.190.0000.00816.98
8.0.180.0070.00016.91
8.0.170.0040.00416.92
8.0.160.0040.00416.86
8.0.150.0040.00416.74
8.0.140.0080.00016.75
8.0.130.0080.00013.37
8.0.120.0080.00016.83
8.0.110.0000.00716.75
8.0.100.0020.00516.87
8.0.90.0040.00416.87
8.0.80.0150.00716.90
8.0.70.0000.00716.76
8.0.60.0000.00716.78
8.0.50.0040.00416.75
8.0.30.0100.01217.03
8.0.20.0180.00617.40
8.0.10.0050.00216.90
8.0.00.0130.01216.80
7.4.300.0000.00616.61
7.4.290.0000.00816.50
7.4.280.0000.00816.54
7.4.270.0070.00016.45
7.4.260.0040.00716.59
7.4.250.0040.00416.40
7.4.240.0070.00016.51
7.4.230.0000.00716.62
7.4.220.0110.00916.66
7.4.210.0090.00616.62
7.4.200.0000.00716.50
7.4.160.0090.00616.59
7.4.150.0140.00717.40
7.4.140.0120.00917.86
7.4.130.0160.00616.54
7.4.120.0100.00916.56
7.4.110.0130.00416.42
7.4.100.0000.01716.65
7.4.90.0090.01216.59
7.4.80.0060.01419.39
7.4.70.0140.00316.68
7.4.60.0130.00716.45
7.4.50.0030.00316.43
7.4.40.0120.00916.49
7.4.30.0100.00716.60
7.4.00.0110.00314.79
7.3.330.0020.00213.25
7.3.320.0050.00013.33
7.3.310.0040.00416.46
7.3.300.0070.00016.21
7.3.290.0080.00516.29
7.3.280.0090.00916.38
7.3.270.0160.00017.40
7.3.260.0130.00416.47
7.3.250.0100.01316.41
7.3.240.0130.00316.51
7.3.230.0050.01116.46
7.3.210.0030.01616.57
7.3.200.0090.01219.39
7.3.190.0090.00616.55
7.3.180.0030.01216.67
7.3.170.0060.00616.45
7.3.160.0090.01316.38
7.2.330.0120.01216.46
7.2.320.0130.00516.80
7.2.310.0100.01316.54
7.2.300.0150.00716.38
7.2.290.0080.01616.88
7.2.80.0030.01016.77
7.2.60.0110.00316.83
7.2.00.0040.00719.59
7.1.200.0100.00315.74
7.1.100.0070.00418.05
7.1.70.0000.01116.87
7.1.60.0100.01319.57
7.1.50.0000.02116.95
7.1.00.0070.07022.33
7.0.200.0050.00216.46
7.0.140.0100.04721.97
7.0.60.0070.04319.87
7.0.50.0100.07717.96
7.0.40.0030.09020.40
7.0.30.0130.04720.25
7.0.20.0200.04320.23
7.0.10.0000.04720.33
7.0.00.0130.08320.23
5.6.280.0070.07020.84
5.6.210.0130.08320.53
5.6.200.0070.07318.18
5.6.190.0070.07320.52
5.6.180.0430.04320.77
5.6.170.0270.04320.56
5.6.160.0000.04720.44
5.6.150.0130.07318.12
5.6.140.0230.06318.18
5.6.130.0000.06718.14
5.6.120.0100.04721.13
5.6.110.0070.04021.06
5.6.100.0100.08021.01
5.6.90.0100.08720.97
5.6.80.0030.04020.55
5.5.350.0270.08020.42
5.5.340.0030.04018.00
5.5.330.0100.05720.21
5.5.320.0070.04320.25
5.5.310.0200.04020.49
5.5.300.0100.04717.94
5.5.290.0130.08017.99
5.5.280.0100.05320.97
5.5.270.0100.06320.80
5.5.260.0130.05720.85
5.5.250.0130.04320.48
5.5.240.0130.06320.38
5.4.450.0670.06319.57
5.4.440.0930.06019.55
5.4.430.0770.06019.33
5.4.420.0730.06019.48
5.4.410.0800.05719.35
5.4.400.0430.04719.15
5.4.390.0800.07019.21
5.4.380.0300.03718.80
5.4.370.0170.05018.48
5.4.360.0200.04718.76
5.4.350.0170.05318.58
5.4.340.0230.05718.76
5.4.320.0230.04718.59
5.4.310.0130.05318.84
5.4.300.0270.04018.78
5.4.290.0100.05318.52
5.4.280.0100.05318.79
5.4.270.0100.05318.48
5.4.260.0230.04318.73
5.4.250.0170.05018.51
5.4.240.0030.06318.59
5.4.230.0130.05018.53
5.4.220.0230.04718.78
5.4.210.0130.05318.56
5.4.200.0130.05016.52
5.4.190.0230.04318.58
5.4.180.0200.04718.57
5.4.170.0170.05018.52
5.4.160.0130.05318.83
5.4.150.0100.05318.72
5.4.140.0100.05316.27
5.4.130.0130.04716.30
5.4.120.0170.04716.37
5.4.110.0100.05016.18
5.4.100.0070.05716.48
5.4.90.0200.04716.19
5.4.80.0100.05316.18
5.4.70.0170.04716.24
5.4.60.0130.05016.33
5.4.50.0070.05316.16
5.4.40.0130.05316.41
5.4.30.0070.05316.26
5.4.20.0130.05016.21
5.4.10.0100.05016.30
5.4.00.0070.05315.76
5.3.290.0170.05014.82
5.3.280.0130.05014.62
5.3.270.0100.05714.78
5.3.260.0100.05714.66
5.3.250.0200.04314.65
5.3.240.0070.05714.80
5.3.230.0170.04714.65
5.3.220.0130.05014.59
5.3.210.0130.05314.63
5.3.200.0100.05314.56
5.3.190.0130.05014.69
5.3.180.0170.04714.56
5.3.170.0130.05014.66
5.3.160.0200.04314.66
5.3.150.0200.04314.69
5.3.140.0100.05314.60
5.3.130.0100.05714.56
5.3.120.0100.05714.59
5.3.110.0130.05314.56
5.3.100.0130.05014.11
5.3.90.0170.04714.14
5.3.80.0070.05714.11
5.3.70.0100.05014.12
5.3.60.0070.05714.02
5.3.50.0170.04714.01
5.3.40.0200.04313.95
5.3.30.0130.05014.02
5.3.20.0070.05313.71
5.3.10.0100.05013.68
5.3.00.0100.05313.80
5.2.170.0100.04011.19
5.2.160.0100.04011.12
5.2.150.0100.04011.16
5.2.140.0070.04711.24
5.2.130.0130.04311.31
5.2.120.0170.03711.12
5.2.110.0100.04011.17
5.2.100.0130.03311.09
5.2.90.0070.04311.20
5.2.80.0070.04311.30
5.2.70.0170.03311.13
5.2.60.0100.04011.11
5.2.50.0130.04011.08
5.2.40.0070.04011.19
5.2.30.0130.03711.00
5.2.20.0070.04011.03
5.2.10.0030.04311.06
5.2.00.0070.04310.75
5.1.60.0100.03010.16
5.1.50.0130.02710.03
5.1.40.0100.03010.04
5.1.30.0130.03310.54
5.1.20.0030.04010.38
5.1.10.0070.03710.24
5.1.00.0100.03310.25
5.0.50.0100.0238.73
5.0.40.0030.0308.45
5.0.30.0100.0378.35
5.0.20.0030.0308.23
5.0.10.0100.0238.22
5.0.00.0170.0338.14
4.4.90.0030.0235.89
4.4.80.0000.0275.91
4.4.70.0070.0205.96
4.4.60.0070.0205.89
4.4.50.0100.0175.93
4.4.40.0100.0305.89
4.4.30.0070.0205.99
4.4.20.0000.0275.98
4.4.10.0030.0236.07
4.4.00.0070.0305.94
4.3.110.0030.0335.87
4.3.100.0070.0275.83
4.3.90.0100.0175.82
4.3.80.0070.0305.87
4.3.70.0100.0175.80
4.3.60.0030.0205.79
4.3.50.0100.0175.78
4.3.40.0070.0335.77
4.3.30.0070.0204.66
4.3.20.0030.0204.57
4.3.10.0000.0234.54
4.3.00.0030.02714.77

preferences:
25.84 ms | 406 KiB | 5 Q