3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Capstone\Container; class Registry { protected $map; /** * @param \arrayAccess|array|null $map */ function __construct( &$map = null ) { if( $map === null ) { $map = array(); } $this->map &= $map; } function set($key, $value){ $this->map[$key] = $value; } function setMany(array $map){ foreach($map as $key => $value){ $this->set($key, $value); } } function get($key){ if(array_key_exists($key, $this->map)){ return $this->map[$key]; } return null; } function has($key){ return array_key_exists($key, $this->map); } function length(){ return count($this->map); } function getIterator(){ return new \ArrayIterator($this->map); } } $bob = array('x' => 'y'>); $bob_reg = new Registry($bob); $bob_reg->set('ted', 'bob'); print_r($bob);

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)
5.4.250.0030.05718.99
5.4.240.0100.04718.98
5.4.230.0070.06018.96
5.4.220.0130.05018.99
5.4.210.0070.07018.98
5.4.200.0130.07018.99
5.4.190.0170.04318.96
5.4.180.0100.04718.79
5.4.170.0100.07718.89
5.4.160.0100.05018.89
5.4.150.0030.07719.08
5.4.140.0100.05016.50
5.4.130.0100.04716.52
5.4.120.0070.07316.38
5.4.110.0130.04316.57
5.4.100.0030.05016.55
5.4.90.0100.04316.41
5.4.80.0030.05316.42
5.4.70.0030.05016.59
5.4.60.0070.05316.31
5.4.50.0100.06316.44
5.4.40.0030.06016.51
5.4.30.0170.04716.38
5.4.20.0130.04716.50
5.4.10.0200.05016.50
5.4.00.0030.05315.74
5.3.280.0170.04014.70
5.3.270.0130.05014.70
5.3.260.0130.06714.78
5.3.250.0030.05314.70
5.3.240.0070.05314.79
5.3.230.0070.05014.63
5.3.220.0100.04714.76
5.3.210.0030.05314.59
5.3.200.0100.04714.72
5.3.190.0070.05314.41
5.3.180.0000.05314.81
5.3.170.0100.04314.55
5.3.160.0130.07314.73
5.3.150.0030.06014.66
5.3.140.0130.04714.60
5.3.130.0070.05314.64
5.3.120.0100.07314.73
5.3.110.0030.05714.64
5.3.100.0030.05714.13
5.3.90.0030.05713.93
5.3.80.0100.06714.11
5.3.70.0170.04014.02
5.3.60.0100.04714.07
5.3.50.0170.06014.04
5.3.40.0070.07013.98
5.3.30.0130.06313.91
5.3.20.0030.07313.61
5.3.10.0170.06313.75
5.3.00.0000.05313.64

preferences:
135.67 ms | 1394 KiB | 7 Q