3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Uid implements \ArrayAccess { protected $uid; public function __construct($uid) { $this->uid = $uid; } public function __toString() { return $this->uid; } public function offsetExists($offset) { return $offset === 0; } public function offsetGet($offset) { if ($offset === 0 || $offset == 'uid') { return $this->uid; } } public function offsetSet($offset, $value) {} public function offsetUnset($offset) {} } $data = new stdClass(); $data->uid = '1234'; print $data->uid; print "\n"; print $data->uid[0]; print "\n"; $data = array(); $data['uid'] = '1234'; print $data['uid']; print "\n"; print $data['uid'][0]; print "\nNew Uid Class\n"; $data['uid'] = new Uid('1234'); print $data['uid']; print "\n"; print $data['uid'][0]; print "\n"; print $data['uid'][1];

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.0100.01018.43
8.3.50.0120.00721.96
8.3.40.0140.00318.93
8.3.30.0090.00619.21
8.3.20.0080.00020.16
8.3.10.0090.00621.88
8.3.00.0000.00819.38
8.2.180.0120.00618.50
8.2.170.0090.00922.96
8.2.160.0140.00420.52
8.2.150.0030.00624.18
8.2.140.0080.00024.66
8.2.130.0050.00326.16
8.2.120.0030.00519.35
8.2.110.0070.00419.37
8.2.100.0090.00317.75
8.2.90.0050.00319.15
8.2.80.0040.00417.97
8.2.70.0090.00317.75
8.2.60.0050.00317.93
8.2.50.0040.00418.07
8.2.40.0060.00320.07
8.2.30.0040.00418.17
8.2.20.0030.00617.65
8.2.10.0040.00418.09
8.2.00.0070.00017.74
8.1.280.0130.00325.92
8.1.270.0040.00420.79
8.1.260.0000.00826.35
8.1.250.0040.00428.09
8.1.240.0060.00323.80
8.1.230.0040.00717.66
8.1.220.0000.00817.74
8.1.210.0030.00518.77
8.1.200.0030.00717.35
8.1.190.0050.00317.23
8.1.180.0080.00018.10
8.1.170.0000.00719.01
8.1.160.0000.00722.06
8.1.150.0000.00718.94
8.1.140.0000.00817.50
8.1.130.0030.00517.78
8.1.120.0060.00317.54
8.1.110.0040.00417.41
8.1.100.0050.00317.50
8.1.90.0040.00417.55
8.1.80.0080.00017.54
8.1.70.0030.00317.45
8.1.60.0000.00817.52
8.1.50.0040.00417.52
8.1.40.0130.00017.49
8.1.30.0080.00017.71
8.1.20.0040.00417.60
8.1.10.0090.00017.50
8.1.00.0000.00717.57
8.0.300.0060.00318.77
8.0.290.0000.00716.63
8.0.280.0070.00018.49
8.0.270.0070.00017.21
8.0.260.0000.00617.31
8.0.250.0030.00316.97
8.0.240.0050.00316.92
8.0.230.0070.00017.02
8.0.220.0000.00716.95
8.0.210.0050.00316.82
8.0.200.0000.00716.89
8.0.190.0060.00317.03
8.0.180.0030.00317.00
8.0.170.0070.00016.98
8.0.160.0000.00816.88
8.0.150.0030.00316.83
8.0.140.0000.00716.94
8.0.130.0000.00613.45
8.0.120.0050.00316.90
8.0.110.0000.00816.78
8.0.100.0050.00316.77
8.0.90.0040.00416.76
8.0.80.0060.01316.90
8.0.70.0030.00516.92
8.0.60.0000.00717.00
8.0.50.0000.00817.00
8.0.30.0130.01117.18
8.0.20.0110.00917.40
8.0.10.0000.00716.93
8.0.00.0110.00716.86
7.4.330.0000.00515.09
7.4.320.0060.00016.66
7.4.300.0000.00716.63
7.4.290.0000.01016.41
7.4.280.0000.00716.53
7.4.270.0030.00316.57
7.4.260.0030.00316.54
7.4.250.0000.00816.42
7.4.240.0000.00716.59
7.4.230.0070.00016.55
7.4.220.0090.00916.50
7.4.210.0040.01116.57
7.4.200.0040.00416.64
7.4.160.0130.00316.55
7.4.150.0120.00617.40
7.4.140.0140.00717.86
7.4.130.0070.01016.61
7.4.120.0050.01216.49
7.4.110.0100.01316.36
7.4.100.0070.01116.53
7.4.90.0090.00916.61
7.4.80.0150.00919.39
7.4.70.0130.00316.67
7.4.60.0060.01016.45
7.4.50.0000.00816.55
7.4.40.0110.00616.47
7.4.30.0130.00416.46
7.4.10.0040.01514.96
7.4.00.0050.01214.82
7.3.330.0050.00013.26
7.3.320.0100.00713.24
7.3.310.0030.00516.26
7.3.300.0050.00316.39
7.3.290.0000.00716.26
7.3.280.0040.01416.36
7.3.270.0040.02017.40
7.3.260.0030.01416.39
7.3.250.0120.00916.41
7.3.240.0110.00816.61
7.3.230.0040.01516.49
7.3.210.0080.00816.62
7.3.200.0110.01419.39
7.3.190.0150.00316.67
7.3.180.0060.01116.48
7.3.170.0110.00516.59
7.3.160.0040.01216.53
7.3.130.0150.00014.99
7.3.120.0030.01115.01
7.3.110.0120.00514.88
7.3.100.0020.01514.60
7.3.90.0100.00714.98
7.3.80.0120.00214.74
7.3.70.0050.00814.82
7.3.60.0040.00814.89
7.3.50.0070.00714.86
7.3.40.0080.00614.84
7.3.30.0060.00714.69
7.3.20.0030.01416.79
7.3.10.0080.00616.73
7.3.00.0070.00516.71
7.2.330.0060.01216.64
7.2.320.0110.00816.79
7.2.310.0060.01216.46
7.2.300.0030.01216.46
7.2.290.0110.00616.53
7.2.260.0090.00315.30
7.2.250.0060.01315.14
7.2.240.0040.01215.27
7.2.230.0070.01014.81
7.2.220.0070.01015.34
7.2.210.0090.00715.19
7.2.200.0020.01415.28
7.2.190.0070.01115.07
7.2.180.0050.01015.03
7.2.170.0040.01015.08
7.2.160.0050.00515.09
7.2.150.0090.00616.96
7.2.140.0000.00917.04
7.2.130.0070.00717.14
7.2.120.0110.00717.01
7.2.110.0060.00616.95
7.2.100.0060.00917.04
7.2.90.0000.01416.90
7.2.80.0030.01016.77
7.2.70.0080.00317.21
7.2.60.0030.00717.03
7.2.50.0090.00617.01
7.2.40.0090.00017.09
7.2.30.0070.00717.00
7.2.20.0070.00717.04
7.2.10.0070.00716.90
7.2.00.0060.00517.99
7.1.330.0020.01315.85
7.1.320.0020.01215.72
7.1.310.0040.00815.79
7.1.300.0070.01015.85
7.1.290.0050.00615.78
7.1.280.0090.00715.80
7.1.270.0020.01215.75
7.1.260.0020.00915.77
7.1.250.0030.00815.77
7.1.240.0000.01615.84
7.1.230.0060.00915.95
7.1.220.0040.01515.80
7.1.210.0080.00415.90
7.1.200.0000.01215.81
7.1.190.0040.01115.54
7.1.180.0070.00715.95
7.1.170.0060.00315.79
7.1.160.0110.00415.54
7.1.150.0040.00415.86
7.1.140.0080.00815.64
7.1.130.0000.01516.02
7.1.120.0060.00615.81
7.1.110.0060.00915.93
7.1.100.0030.00917.21
7.1.90.0100.00315.87
7.1.80.0030.01015.73
7.1.70.0060.00716.60
7.1.60.0080.00617.69
7.1.50.0080.00616.44
7.1.40.0030.01315.81
7.1.30.0040.01115.92
7.1.20.0100.00715.84
7.1.10.0070.00715.70
7.1.00.0050.04019.16
7.0.330.0040.00415.25
7.0.320.0110.00715.35
7.0.310.0070.00715.50
7.0.300.0030.00515.22
7.0.290.0100.00315.21
7.0.280.0100.00015.21
7.0.270.0000.00815.48
7.0.260.0040.00815.54
7.0.250.0040.00415.37
7.0.240.0070.00715.46
7.0.230.0000.01415.44
7.0.220.0030.00715.45
7.0.210.0000.01115.32
7.0.200.0000.01016.12
7.0.190.0030.00615.64
7.0.180.0070.00315.48
7.0.170.0000.01515.29
7.0.160.0100.00015.60
7.0.150.0070.01015.55
7.0.140.0020.02218.65
7.0.130.0100.00315.41
7.0.120.0030.01015.19
7.0.110.0000.01115.56
7.0.100.0030.00715.28
7.0.90.0000.01015.50
7.0.80.0060.00615.54
7.0.70.0150.00015.34
7.0.60.0070.04017.69
7.0.50.0050.03816.72
7.0.40.0050.04816.88
7.0.30.0270.02816.78
7.0.20.0090.03516.75
7.0.10.0130.03816.85
7.0.00.0050.05016.77
5.6.400.0090.00314.76
5.6.390.0030.01014.70
5.6.380.0040.00814.55
5.6.370.0100.00314.79
5.6.360.0080.00014.50
5.6.350.0100.00314.64
5.6.340.0000.01014.72
5.6.330.0040.01114.20
5.6.320.0080.00314.53
5.6.310.0060.00314.61
5.6.300.0070.00414.59
5.6.290.0040.01114.45
5.6.280.0030.03917.86
5.6.270.0000.01014.78
5.6.260.0030.01014.57
5.6.250.0030.01014.57
5.6.240.0060.00614.50
5.6.230.0040.00714.50
5.6.220.0040.00714.57
5.6.210.0100.04217.63
5.6.200.0060.04716.34
5.6.190.0050.03317.40
5.6.180.0170.04017.60
5.6.170.0100.02617.55
5.6.160.0050.04417.52
5.6.150.0060.03316.20
5.6.140.0020.02616.44
5.6.130.0050.04016.37
5.6.120.0070.04517.65
5.6.110.0020.02417.76
5.6.100.0090.04117.71
5.6.90.0020.02717.77
5.6.80.0070.04217.27
5.6.70.2340.02217.39
5.6.60.0110.00414.20
5.6.50.0060.00914.23
5.6.40.0000.01114.51
5.6.30.0060.00614.20
5.6.20.0070.00414.47
5.6.10.0070.00414.36
5.6.00.0070.00714.44
5.5.380.0070.00714.50
5.5.370.0030.01014.51
5.5.360.0000.01314.21
5.5.350.0130.03617.49
5.5.340.0060.04616.08
5.5.330.0080.02017.32
5.5.320.0250.04017.42
5.5.310.0200.03217.54
5.5.300.0080.02716.17
5.5.290.0070.02016.13
5.5.280.0130.04017.75
5.5.270.0080.02117.58
5.5.260.0030.04717.76
5.5.250.0110.03817.54
5.5.240.0070.02217.30
5.5.230.0050.00314.50
5.5.220.0080.00814.16
5.5.210.0000.01314.27
5.5.200.0000.01214.39
5.5.190.0060.00914.19
5.5.180.0070.00414.47
5.5.170.0000.01314.46
5.5.160.0040.01114.32
5.5.150.0000.00914.34
5.5.140.0040.00814.56
5.5.130.0090.00614.42
5.5.120.0060.01014.52
5.5.110.0100.00714.35
5.5.100.0000.01114.56
5.5.90.0000.01614.56
5.5.80.0060.00914.36
5.5.70.0110.00414.40
5.5.60.0110.00414.33
5.5.50.0000.01214.31
5.5.40.0030.01014.41
5.5.30.0040.01214.50
5.5.20.0120.00314.41
5.5.10.0070.00714.18
5.5.00.0040.00714.07
5.4.450.0400.03215.98
5.4.440.0500.03816.12
5.4.430.0430.03516.13
5.4.420.0600.03316.18
5.4.410.0080.03015.98
5.4.400.0150.03915.58
5.4.390.0150.03815.72
5.4.380.0150.03915.62
5.4.370.0070.04315.66
5.4.360.0070.03515.64
5.4.350.0150.04115.56
5.4.340.0170.03015.68
5.4.330.0000.00812.64
5.4.320.1130.03315.68
5.4.310.0770.03215.63
5.4.300.0080.02815.63
5.4.290.0030.03515.63
5.4.280.0050.03715.70
5.4.270.0130.03115.62
5.4.260.0150.02515.71
5.4.250.0150.02615.72
5.4.240.0120.03215.63
5.4.230.0130.02715.60
5.4.220.0100.03415.69
5.4.210.0150.02615.70
5.4.200.0140.02814.71
5.4.190.0100.02815.63
5.4.180.0150.02515.74
5.4.170.0100.03515.69
5.4.160.0180.02515.67
5.4.150.0070.03715.70
5.4.140.0150.03614.54
5.4.130.0080.04414.45
5.4.120.0100.04214.49
5.4.110.0100.02714.41
5.4.100.0120.02914.55
5.4.90.0100.03414.46
5.4.80.0180.02314.44
5.4.70.0090.03214.52
5.4.60.0100.02914.45
5.4.50.0090.03014.46
5.4.40.0120.02814.47
5.4.30.0140.02714.46
5.4.20.0050.03514.45
5.4.10.0120.03614.40
5.4.00.0080.04014.21
5.3.290.0300.04714.71
5.3.280.0100.08014.63
5.3.270.0270.06014.67
5.3.260.0330.05314.64
5.3.250.0100.06014.72
5.3.240.0170.05714.62
5.3.230.0300.06314.82
5.3.220.0170.07714.61
5.3.210.0270.07314.64
5.3.200.0430.06314.68
5.3.190.0500.07314.66
5.3.180.0270.07314.56
5.3.170.0300.07014.88
5.3.160.0500.04714.63
5.3.150.0300.04714.63
5.3.140.0230.05714.60
5.3.130.0170.05714.56
5.3.120.0270.05714.62
5.3.110.0230.06014.56
5.3.100.0300.05014.06
5.3.90.0230.04714.22
5.3.80.0300.04314.05
5.3.70.0170.05714.14
5.3.60.1000.05014.04
5.3.50.0230.05714.12
5.3.40.0230.06013.95
5.3.30.0170.05314.05
5.3.20.0230.05013.70
5.3.10.0100.06013.64
5.3.00.0230.05713.75
5.2.170.0230.04711.16
5.2.160.0230.03711.17
5.2.150.0970.04711.38
5.2.140.0100.05011.19
5.2.130.0170.04311.35
5.2.120.0100.05011.11
5.2.110.0200.05011.23
5.2.100.0230.04011.16
5.2.90.0100.04711.16
5.2.80.0130.05011.18
5.2.70.0200.04011.09
5.2.60.1300.06011.16
5.2.50.0230.05311.10
5.2.40.0130.04311.02
5.2.30.0230.03311.09
5.2.20.0000.05011.09
5.2.10.0100.04310.85
5.2.00.0200.04310.78
5.1.60.0030.04310.18
5.1.50.0170.03310.04
5.1.40.0100.03710.02
5.1.30.0070.04010.33
5.1.20.0170.03310.43
5.1.10.0130.03710.13
5.1.00.0130.03310.26
5.0.50.0130.0238.61
5.0.40.0100.0378.54
5.0.30.0100.0438.28
5.0.20.0100.0238.25
5.0.10.0100.0238.39
5.0.00.0030.0478.30
4.4.90.0130.0177.72
4.4.80.0030.0277.72
4.4.70.0070.0307.72
4.4.60.0130.0237.72
4.4.50.0070.0337.72
4.4.40.0070.0537.72
4.4.30.0070.0337.72
4.4.20.0030.0377.72
4.4.10.0130.0177.72
4.4.00.0030.0437.72
4.3.110.0100.0277.72
4.3.100.0070.0237.72
4.3.90.0100.0237.72
4.3.80.0100.0307.72
4.3.70.0070.0277.72
4.3.60.0000.0307.72
4.3.50.0130.0307.72
4.3.40.0000.0507.72
4.3.30.0070.0237.72
4.3.20.0030.0307.72
4.3.10.0070.0237.72
4.3.00.0100.0207.01

preferences:
48.34 ms | 401 KiB | 5 Q