3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Cookie implements ArrayAccess { public function offsetSet($offset, $value) { setcookie($offset, $value); } public function offsetGet($offset) { return $_COOKIE[$offset]; } public function offsetUnset($offset) { setcookie($offset, null, time()-1); } public function offsetExists($offset) { return isset($_COOKIE[$offset]); } } $cookie = new Cookie; // 读取Cookie print $cookie["username"]; // 写入Cookie $cookie["passwd"] = "123abc";

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)
7.3.10.0070.00716.41
7.3.00.0050.01016.58
7.2.130.0090.00616.85
7.2.120.0070.00716.94
7.2.110.0050.00916.80
7.2.100.0050.00616.92
7.2.90.0030.01017.08
7.2.80.0040.00916.86
7.2.70.0070.00516.95
7.2.60.0070.00516.89
7.2.50.0080.00716.90
7.2.40.0080.00616.83
7.2.30.0060.00616.89
7.2.20.0040.01116.91
7.2.10.0020.01216.77
7.2.00.0030.01017.43
7.1.250.0030.00815.88
7.1.240.0090.00015.73
7.1.230.0070.00715.83
7.1.220.0030.00915.64
7.1.210.0040.00415.42
7.1.200.0020.01415.83
7.1.190.0000.00815.73
7.1.180.0000.00815.70
7.1.170.0040.00715.89
7.1.160.0030.00915.48
7.1.150.0000.01015.64
7.1.140.0040.00715.77
7.1.130.0030.00915.55
7.1.120.0070.00715.82
7.1.110.0060.01016.00
7.1.100.0050.00517.01
7.1.90.0030.00915.55
7.1.80.0060.00915.86
7.1.70.0020.01016.54
7.1.60.0000.01617.63
7.1.50.0200.00525.33
7.1.40.0060.00615.63
7.1.30.0050.00315.84
7.1.20.0030.00915.56
7.1.10.0060.00315.68
7.1.00.0070.04019.17
7.0.330.0070.00715.43
7.0.320.0000.01015.30
7.0.310.0000.01015.42
7.0.300.0070.00715.27
7.0.290.0030.00615.37
7.0.280.0090.00315.47
7.0.270.0030.01315.31
7.0.260.0040.00415.12
7.0.250.0030.00915.46
7.0.240.0030.01015.52
7.0.230.0000.00715.39
7.0.220.0030.01015.26
7.0.210.0000.01315.41
7.0.200.0030.00816.07
7.0.190.0060.00615.50
7.0.180.0120.00015.34
7.0.170.0060.00315.45
7.0.160.0030.00915.21
7.0.150.0030.00315.62
7.0.140.0050.04118.58
7.0.130.0030.00915.09
7.0.120.0070.00715.39
7.0.110.0050.04017.62
7.0.100.0030.02717.80
7.0.90.0020.04517.71
7.0.80.0020.03117.71
7.0.70.0070.02517.64
7.0.60.0060.04617.66
7.0.50.0050.02217.75
7.0.40.0050.03516.67
7.0.30.0100.01716.63
7.0.20.0020.04516.70
7.0.10.0080.04016.58
7.0.00.0050.04316.48
5.6.380.0040.00814.32
5.6.370.0030.01314.35
5.6.360.0040.00914.84
5.6.350.0030.01014.24
5.6.340.0040.01114.26
5.6.330.0000.01114.39
5.6.320.0090.00314.33
5.6.310.0000.01214.13
5.6.300.0030.00614.38
5.6.290.0050.00314.47
5.6.280.0060.03417.82
5.6.270.0000.01214.13
5.6.260.0060.03517.63
5.6.250.0070.03217.53
5.6.240.0050.02817.71
5.6.230.0050.02517.65
5.6.220.0030.03617.46
5.6.210.0080.04517.48
5.6.200.0110.03017.52
5.6.190.0050.03517.39
5.6.180.0030.03617.46
5.6.170.0000.03217.62
5.6.160.0080.03717.40
5.6.150.0070.02017.50
5.6.140.0130.03817.52
5.6.130.0040.02717.50
5.6.120.0060.02317.67
5.6.110.0100.01717.43
5.6.100.0090.04017.52
5.6.90.0050.02317.41
5.6.80.0100.03817.19
5.6.70.0080.04117.26
5.6.60.0060.04617.18
5.6.50.0030.04417.20
5.6.40.0030.04317.13
5.6.30.0070.04417.11
5.6.20.0030.03717.09
5.6.10.0110.03617.27
5.6.00.0050.02117.14
5.5.380.0050.02514.39
5.5.370.0050.04214.46
5.5.360.0050.04314.64
5.5.350.0020.02414.45
5.5.340.0030.02814.78
5.5.330.0090.03914.59
5.5.320.0000.02414.66
5.5.310.0030.03514.41
5.5.300.0100.04514.76
5.5.290.0060.04314.56
5.5.280.0070.03514.80
5.5.270.0060.04114.65
5.5.260.0040.02714.83
5.5.250.0050.02014.38
5.5.240.0060.03714.37
5.5.230.0030.04014.29
5.5.220.0030.03714.27
5.5.210.0060.02114.46
5.5.200.0060.03914.43
5.5.190.0070.03514.27
5.5.180.0070.04014.18
5.5.170.0000.00811.01
5.5.160.0020.04714.31
5.5.150.0030.03614.34
5.5.140.0100.01514.47
5.5.130.0050.03014.46
5.5.120.0030.02414.42
5.5.110.0070.02214.08
5.5.100.0050.02214.24
5.5.90.0040.02514.23
5.5.80.0070.02214.40
5.5.70.0030.02014.25
5.5.60.0050.02314.29
5.5.50.0020.02214.32
5.5.40.0060.02014.20
5.5.30.0020.02214.36
5.5.20.0020.02514.40
5.5.10.0020.02614.28
5.5.00.0040.01814.12
5.4.450.0060.03115.35
5.4.440.0020.02315.27
5.4.430.0070.02415.23
5.4.420.0060.03515.24
5.4.410.0030.01815.38
5.4.400.0050.01715.17
5.4.390.0000.03015.17
5.4.380.0050.03315.00
5.4.370.0060.01814.90
5.4.360.0050.02214.96
5.4.350.0030.03115.07
5.4.340.0030.02614.96
5.4.330.0000.00911.26
5.4.320.0050.04015.37
5.4.310.0020.02215.10
5.4.300.0020.02515.01
5.4.290.0080.03115.02
5.4.280.0050.02515.26
5.4.270.0020.02414.92
5.4.260.0050.01815.16
5.4.250.0070.02215.20
5.4.240.0070.01915.25
5.4.230.0050.02215.05
5.4.220.0030.03014.93
5.4.210.0040.02015.04
5.4.200.0000.02415.19
5.4.190.0040.01915.03
5.4.180.0050.02015.09
5.4.170.0020.02315.14
5.4.160.0110.01315.03
5.4.150.0020.02414.99
5.4.140.0060.01313.63
5.4.130.0070.02013.91
5.4.120.0050.01813.90
5.4.110.0050.01913.89
5.4.100.0020.02113.88
5.4.90.0070.01313.87
5.4.80.0000.01913.86
5.4.70.0030.01813.92
5.4.60.0080.01613.75
5.4.50.0070.01513.75
5.4.40.0080.01813.85
5.4.30.0040.02113.82
5.4.20.0020.02013.81
5.4.10.0070.01313.81
5.4.00.0100.01313.38
5.3.290.0030.02312.60
5.3.280.0070.01712.59
5.3.270.0030.02812.53
5.3.260.0030.02012.63
5.3.250.0050.01812.66
5.3.240.0020.02212.57
5.3.230.0000.02212.61
5.3.220.0060.01812.59
5.3.210.0020.02212.57
5.3.200.0060.02012.41
5.3.190.0070.01712.65
5.3.180.0030.01812.72
5.3.170.0030.02212.74
5.3.160.0030.01812.52
5.3.150.0040.01912.58
5.3.140.0020.02412.57
5.3.130.0030.01712.60
5.3.120.0000.01912.48
5.3.110.0020.02112.53
5.3.100.0010.02312.25
5.3.90.0040.01812.52
5.3.80.0040.01712.34
5.3.70.0040.01712.41
5.3.60.0030.02012.28
5.3.50.0020.01812.31
5.3.40.0030.02012.32
5.3.30.0030.01412.32
5.3.20.0020.01912.07
5.3.10.0030.01911.98
5.3.00.0000.01811.91
5.2.170.0040.01311.20
5.2.160.0030.01611.20
5.2.150.0050.01311.20
5.2.140.0040.01411.20
5.2.130.0050.01211.20
5.2.120.0020.01311.20
5.2.110.0070.01211.20
5.2.100.0070.01211.20
5.2.90.0000.01611.20
5.2.80.0020.01511.20
5.2.70.0030.01511.20
5.2.60.0000.01511.20
5.2.50.0030.01811.20
5.2.40.0030.01711.20
5.2.30.0040.01311.20
5.2.20.0030.03111.20
5.2.10.0030.01811.20
5.2.00.0070.01711.20
5.1.60.0020.01711.20
5.1.50.0050.01211.20
5.1.40.0030.02011.20
5.1.30.0090.02311.20
5.1.20.0020.01811.20
5.1.10.0030.01611.20
5.1.00.0030.01311.20
5.0.50.0020.01611.20
5.0.40.0020.02511.20
5.0.30.0020.03511.20
5.0.20.0040.02011.20
5.0.10.0040.02011.20
5.0.00.0040.02111.20
4.4.90.0000.01011.20
4.4.80.0030.01711.20
4.4.70.0030.00711.20
4.4.60.0000.02711.20
4.4.50.0000.01611.20
4.4.40.0020.02111.20
4.4.30.0000.02211.20
4.4.20.0040.00811.20
4.4.10.0000.01311.20
4.4.00.0020.01611.20
4.3.110.0000.01811.20
4.3.100.0030.01111.20
4.3.90.0030.01711.20
4.3.80.0030.02011.20
4.3.70.0020.01211.20
4.3.60.0040.01711.20
4.3.50.0020.01711.20
4.3.40.0020.03211.20
4.3.30.0000.02311.20
4.3.20.0000.01411.20
4.3.10.0000.01811.20
4.3.00.0010.01611.20

preferences:
40.78 ms | 401 KiB | 5 Q