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)
8.3.60.0060.01218.68
8.3.50.0180.00821.98
8.3.40.0070.00718.80
8.3.30.0130.00020.17
8.3.20.0000.00720.18
8.3.10.0080.00021.81
8.3.00.0060.00322.37
8.2.180.0070.01018.38
8.2.170.0130.00722.96
8.2.160.0070.00720.53
8.2.150.0040.00424.18
8.2.140.0160.00324.66
8.2.130.0110.00426.16
8.2.120.0040.00419.66
8.2.110.0080.00319.39
8.2.100.0080.00417.84
8.2.90.0000.00819.26
8.2.80.0040.00417.97
8.2.70.0030.00517.50
8.2.60.0120.00017.93
8.2.50.0030.00718.07
8.2.40.0040.00418.28
8.2.30.0080.00018.19
8.2.20.0080.00017.75
8.2.10.0040.00417.83
8.2.00.0150.00417.77
8.1.280.0150.00625.92
8.1.270.0040.00424.66
8.1.260.0070.00026.35
8.1.250.0080.00028.09
8.1.240.0030.00622.05
8.1.230.0130.00318.98
8.1.220.0090.00017.78
8.1.210.0050.00318.77
8.1.200.0070.00317.35
8.1.190.0040.00417.51
8.1.180.0040.00420.24
8.1.170.0040.00418.45
8.1.160.0040.00422.04
8.1.150.0040.00418.61
8.1.140.0000.00717.36
8.1.130.0030.00517.76
8.1.120.0070.00017.32
8.1.110.0040.00417.42
8.1.100.0050.00217.38
8.1.90.0070.00017.46
8.1.80.0030.00517.46
8.1.70.0000.00717.38
8.1.60.0040.00417.57
8.1.50.0040.00417.60
8.1.40.0040.00417.53
8.1.30.0000.00817.61
8.1.20.0030.00617.71
8.1.10.0040.00417.59
8.1.00.0040.00417.39
8.0.300.0000.00718.77
8.0.290.0080.00016.63
8.0.280.0000.00718.38
8.0.270.0030.00317.21
8.0.260.0000.00716.77
8.0.250.0030.00317.03
8.0.240.0090.00016.85
8.0.230.0030.00316.96
8.0.220.0000.00716.88
8.0.210.0070.00016.78
8.0.200.0000.00716.88
8.0.190.0030.00516.96
8.0.180.0000.00716.82
8.0.170.0040.00416.93
8.0.160.0070.00016.78
8.0.150.0000.00716.86
8.0.140.0000.00716.88
8.0.130.0030.00313.35
8.0.120.0040.00416.71
8.0.110.0000.00816.91
8.0.100.0040.00416.71
8.0.90.0030.00316.79
8.0.80.0040.01116.95
8.0.70.0000.00716.93
8.0.60.0030.00516.95
8.0.50.0000.00816.95
8.0.30.0090.01016.98
8.0.20.0080.01017.40
8.0.10.0020.00517.03
8.0.00.0140.00816.71
7.4.330.0000.00415.00
7.4.320.0030.00316.44
7.4.300.0040.00416.63
7.4.290.0050.00216.63
7.4.280.0030.00316.61
7.4.270.0000.00716.50
7.4.260.0030.00316.49
7.4.250.0000.00816.48
7.4.240.0040.00416.61
7.4.230.0000.00716.69
7.4.220.0070.01116.43
7.4.210.0070.00816.59
7.4.200.0000.00716.61
7.4.190.0070.00016.40
7.4.160.0090.00616.50
7.4.150.0130.00717.40
7.4.140.0120.00817.86
7.4.130.0070.01316.56
7.4.120.0060.01116.53
7.4.110.0080.01316.48
7.4.100.0110.01116.47
7.4.90.0070.01016.68
7.4.80.0180.00019.39
7.4.70.0110.00616.55
7.4.60.0140.00316.59
7.4.50.0040.00016.66
7.4.40.0030.01522.77
7.4.30.0030.01316.64
7.4.00.0110.00414.64
7.3.330.0000.00513.39
7.3.320.0000.00513.19
7.3.310.0000.00816.38
7.3.300.0000.00616.24
7.3.290.0050.01016.29
7.3.280.0070.01216.38
7.3.270.0140.00317.40
7.3.260.0180.00716.45
7.3.250.0120.00816.42
7.3.240.0100.01316.55
7.3.230.0060.01116.43
7.3.210.0120.01216.32
7.3.200.0150.00519.39
7.3.190.0060.01316.43
7.3.180.0070.01316.46
7.3.170.0080.00716.32
7.3.160.0080.00816.55
7.3.120.0070.00715.09
7.2.330.0090.00916.48
7.2.320.0070.01616.69
7.2.310.0100.00716.60
7.2.300.0100.00716.75
7.2.290.0060.01316.81
7.2.00.0000.01519.25
7.1.100.0060.00918.11
7.1.70.0030.00617.23
7.1.60.0100.01619.29
7.1.50.0000.01117.08
7.1.00.0030.06322.28
7.0.200.0730.01014.52
7.0.140.0000.07722.01
7.0.60.0270.04320.05
7.0.50.0070.03717.74
7.0.40.0030.06720.24
7.0.30.0100.04720.32
7.0.20.0400.04020.23
7.0.10.0070.08720.34
7.0.00.0130.06020.08
5.6.280.0000.07720.79
5.6.210.0170.05320.47
5.6.200.0000.07018.14
5.6.190.0070.05020.41
5.6.180.4130.04320.61
5.6.170.0270.08020.34
5.6.160.0130.07020.52
5.6.150.0030.04018.27
5.6.140.0070.08318.25
5.6.130.0070.06318.18
5.6.120.0100.07321.13
5.6.110.0030.05321.01
5.6.100.0030.04020.98
5.6.90.0070.05321.02
5.6.80.0100.03320.41
5.6.70.3400.03320.52
5.5.350.0270.08320.44
5.5.340.0070.05718.07
5.5.330.0070.04320.37
5.5.320.0200.05720.31
5.5.310.0300.07020.35
5.5.300.0030.07717.96
5.5.290.0030.04718.06
5.5.280.0070.03720.97
5.5.270.0030.08720.97
5.5.260.0100.06020.74
5.5.250.0000.08720.57
5.5.240.0230.07720.16
5.4.450.0830.06319.47
5.4.440.0800.07319.26
5.4.430.0100.05719.41
5.4.420.0200.04719.43
5.4.410.0070.05318.93
5.4.400.0100.05718.73
5.4.390.0030.05718.73
5.4.380.0070.06018.48
5.4.370.0200.04318.68
5.4.360.0300.03318.57
5.4.350.0150.04412.02
5.4.340.0040.03812.02
5.4.320.0070.03512.51
5.4.310.0060.03612.51
5.4.300.0090.03412.51
5.4.290.0080.04112.51
5.4.280.0050.03712.41
5.4.270.0040.04212.41
5.4.260.0110.04712.41
5.4.250.0070.05318.78
5.4.240.0170.07318.71
5.4.230.0100.05318.70
5.4.220.0100.05318.75
5.4.210.0070.05718.85
5.4.200.0000.05718.95
5.4.190.0070.05718.87
5.4.180.0130.05318.74
5.4.170.0030.05718.73
5.4.160.0130.07318.73
5.4.150.0070.05318.98
5.4.140.0170.06316.29
5.4.130.0100.04716.42
5.4.120.0070.05016.36
5.4.110.0100.04716.46
5.4.100.0100.04716.48
5.4.90.0100.04316.29
5.4.80.0070.05016.59
5.4.70.0100.04716.45
5.4.60.0100.05716.45
5.4.50.0030.05316.38
5.4.40.0030.05016.38
5.4.30.0200.04316.36
5.4.20.0130.04316.40
5.4.10.0100.05716.41
5.4.00.0130.04316.01
5.3.290.0120.04612.80
5.3.280.0100.05014.79
5.3.270.0070.05714.72
5.3.260.0030.05314.72
5.3.250.0170.04714.76
5.3.240.0030.06714.64
5.3.230.0070.05014.80
5.3.220.0070.05014.64
5.3.210.0170.04314.59
5.3.200.0170.04014.48
5.3.190.0070.05314.68
5.3.180.0070.05014.55
5.3.170.0070.07014.57
5.3.160.0130.04314.55
5.3.150.0070.05314.55
5.3.140.0100.04714.56
5.3.130.0100.05314.54
5.3.120.0100.06714.63
5.3.110.0070.07714.54
5.3.100.0130.04313.88
5.3.90.0130.04714.13
5.3.80.0100.04714.12
5.3.70.0100.04714.10
5.3.60.0070.05314.04
5.3.50.0100.05314.04
5.3.40.0100.05313.80
5.3.30.0130.04313.98
5.3.20.0100.05313.61
5.3.10.0070.05313.65
5.3.00.0200.04013.66
5.2.170.0130.03711.25
5.2.160.0070.05011.25
5.2.150.0030.04311.05
5.2.140.0130.03710.97
5.2.130.0000.04710.98
5.2.120.0100.04011.09
5.2.110.0100.04011.21
5.2.100.0030.04011.01
5.2.90.0070.04011.11
5.2.80.0130.05010.94
5.2.70.0000.04711.18
5.2.60.0100.04011.05
5.2.50.0100.04711.13
5.2.40.0030.04310.93
5.2.30.0070.03710.99
5.2.20.0030.04310.96
5.2.10.0130.03311.07
5.2.00.0030.04010.59
5.1.60.0030.03310.59
5.1.50.0170.03710.18
5.1.40.0000.03710.01
5.1.30.0070.03310.52
5.1.20.0130.03010.57
5.1.10.0000.04010.26
5.1.00.0030.0379.93
5.0.50.0030.0308.40
5.0.40.0070.0238.64
5.0.30.0030.0408.26
5.0.20.0030.0338.25
5.0.10.0070.0278.00
5.0.00.0030.0438.14
4.4.90.0030.02010.59
4.4.80.0030.02010.59
4.4.70.0000.02310.59
4.4.60.0070.02010.59
4.4.50.0030.02010.59
4.4.40.0030.0337.49
4.4.30.0030.0277.49
4.4.20.0030.0207.49
4.4.10.0070.0207.49
4.4.00.0030.0337.49
4.3.110.0030.0207.49
4.3.100.0000.0237.49
4.3.90.0030.0307.49
4.3.80.0070.0307.49
4.3.70.0000.0237.49
4.3.60.0070.0207.49
4.3.50.0030.0237.49
4.3.40.0130.0277.49
4.3.30.0000.0277.49
4.3.20.0030.0207.49
4.3.10.0030.0237.49
4.3.00.0130.0206.60

preferences:
44.15 ms | 401 KiB | 5 Q