3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Article implements ArrayAccess { public $title; function __construct($title) { $this->title = $title; } function offsetSet($key, $value){ $this->{$key} = &$value; } function &offsetGet($key){ return $this->{$key}; } function offsetUnset($key){ unset($this->{$key}); } function offsetExists($offset) { return array_key_exists($offset,get_object_vars($this)); } } // Create the object $A = new Article('SPL Rocks'); // Change the title using array syntax using reference $str = 'SPL _really_ rocks'; $A['title'] =&$str; // Check what it looks like again print_r($A);

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.0110.00416.73
8.3.50.0080.00816.24
8.3.40.0000.01418.71
8.3.30.0070.00718.84
8.3.20.0050.00320.34
8.3.10.0040.00421.61
8.3.00.0080.00020.84
8.2.180.0070.01418.29
8.2.170.0070.00722.96
8.2.160.0090.00619.34
8.2.150.0050.00224.18
8.2.140.0040.00424.66
8.2.130.0000.00822.27
8.2.120.0040.00426.35
8.2.110.0090.00921.18
8.2.100.0070.00418.00
8.2.90.0080.00019.30
8.2.80.0050.00317.97
8.2.70.0050.00517.63
8.2.60.0040.00418.04
8.2.50.0000.00818.10
8.2.40.0030.00720.47
8.2.30.0000.00920.58
8.2.20.0040.00417.74
8.2.10.0070.00018.10
8.2.00.0030.00618.10
8.1.280.0070.01025.92
8.1.270.0040.00423.99
8.1.260.0020.00528.09
8.1.250.0040.00428.09
8.1.240.0030.00619.46
8.1.230.0070.00417.42
8.1.220.0000.00817.79
8.1.210.0060.00318.77
8.1.200.0000.01017.48
8.1.190.0050.00317.23
8.1.180.0050.00318.10
8.1.170.0030.00618.57
8.1.160.0000.00820.87
8.1.150.0040.00418.75
8.1.140.0040.00419.54
8.1.130.0000.00717.68
8.1.120.0000.00717.50
8.1.110.0070.00017.50
8.1.100.0000.00817.35
8.1.90.0000.00717.33
8.1.80.0040.00417.53
8.1.70.0070.00017.49
8.1.60.0000.00817.55
8.1.50.0000.00917.55
8.1.40.0080.00017.43
8.1.30.0030.00517.66
8.1.20.0040.00417.59
8.1.10.0080.00017.32
8.1.00.0040.00417.49
8.0.300.0040.00418.77
8.0.290.0000.00816.75
8.0.280.0030.00318.32
8.0.270.0030.00317.19
8.0.260.0000.00617.34
8.0.250.0040.00316.89
8.0.240.0050.00316.98
8.0.230.0040.00417.02
8.0.220.0040.00416.99
8.0.210.0030.00316.84
8.0.200.0040.00416.90
8.0.190.0000.00816.98
8.0.180.0030.00316.89
8.0.170.0040.00417.01
8.0.160.0050.00216.97
8.0.150.0000.00716.85
8.0.140.0040.00416.91
8.0.130.0050.00013.45
8.0.120.0050.00317.04
8.0.110.0070.00016.83
8.0.100.0000.00817.07
8.0.90.0070.00016.77
8.0.80.0000.01517.00
8.0.70.0000.00817.02
8.0.60.0000.00716.84
8.0.50.0000.00816.90
8.0.30.0130.00717.10
8.0.20.0140.00817.40
8.0.10.0000.00816.97
8.0.00.0060.01116.73
7.4.330.0030.00315.08
7.4.320.0000.00616.62
7.4.300.0030.00316.58
7.4.290.0000.00816.58
7.4.280.0000.00716.63
7.4.270.0060.00016.46
7.4.260.0070.00016.59
7.4.250.0050.00216.38
7.4.240.0030.00316.62
7.4.230.0000.00816.41
7.4.220.0150.00616.60
7.4.210.0040.01116.61
7.4.200.0030.00316.40
7.4.160.0100.00716.63
7.4.150.0070.01117.40
7.4.140.0140.00717.86
7.4.130.0100.00816.55
7.4.120.0090.00816.60
7.4.110.0100.00616.46
7.4.100.0100.00716.68
7.4.90.0100.00716.58
7.4.80.0070.01019.39
7.4.70.0090.00916.40
7.4.60.0040.01216.48
7.4.50.0080.00316.44
7.4.40.0110.01116.53
7.4.30.0070.01016.53
7.4.10.0070.01115.12
7.4.00.0060.01215.08
7.3.330.0040.00213.29
7.3.320.0030.00313.29
7.3.310.0000.00716.53
7.3.300.0040.00416.31
7.3.290.0100.00616.43
7.3.280.0070.00916.45
7.3.270.0030.01517.40
7.3.260.0160.00316.52
7.3.250.0100.00716.37
7.3.240.0060.01116.41
7.3.230.0060.01216.39
7.3.210.0100.00616.41
7.3.200.0060.00916.42
7.3.190.0000.01816.43
7.3.180.0090.00616.67
7.3.170.0120.00916.61
7.3.160.0080.00816.51
7.3.130.0130.00714.59
7.3.120.0090.00614.76
7.3.110.0100.01015.00
7.3.100.0070.01315.16
7.3.90.0030.00914.73
7.3.80.0110.00415.19
7.3.70.0100.00714.89
7.3.60.0070.00714.78
7.3.50.0100.00314.84
7.3.40.0090.00914.88
7.3.30.0100.00714.86
7.3.20.0000.00916.63
7.3.10.0030.00616.68
7.3.00.0030.00616.67
7.2.330.0040.01416.76
7.2.320.0150.00316.46
7.2.310.0040.01816.87
7.2.300.0030.01316.73
7.2.290.0090.00616.46
7.2.260.0070.01115.24
7.2.250.0040.01515.35
7.2.240.0090.00914.88
7.2.230.0070.01015.09
7.2.220.0090.00914.97
7.2.210.0110.00314.69
7.2.200.0100.01014.79
7.2.190.0000.01415.31
7.2.180.0060.00915.02
7.2.170.0100.00315.21
7.2.160.0000.00915.06
7.2.150.0080.00316.93
7.2.140.0060.00917.00
7.2.130.0040.00817.02
7.2.120.0070.00717.08
7.2.110.0060.01216.75
7.2.100.0120.00616.95
7.2.90.0100.00316.94
7.2.80.0040.00716.79
7.2.70.0070.00717.11
7.2.60.0010.00916.93
7.2.50.0080.00816.73
7.2.40.0140.00417.15
7.2.30.0090.00616.99
7.2.20.0100.00716.64
7.2.10.0040.01117.05
7.2.00.0060.00616.91
7.1.330.0070.01015.63
7.1.320.0070.00715.77
7.1.310.0090.00315.93
7.1.300.0120.00315.89
7.1.290.0080.00415.75
7.1.280.0040.01115.63
7.1.270.0040.00415.59
7.1.260.0100.00315.86
7.1.250.0030.01015.84
7.1.240.0030.01415.79
7.1.230.0030.00915.95
7.1.220.0030.01415.94
7.1.210.0030.01015.48
7.1.200.0020.01115.67
7.1.190.0000.01315.60
7.1.180.0070.00415.84
7.1.170.0040.01116.02
7.1.160.0070.01015.61
7.1.150.0060.00615.69
7.1.140.0030.01215.95
7.1.130.0070.00715.84
7.1.120.0030.00715.93
7.1.110.0060.00915.51
7.1.100.0070.00716.81
7.1.90.0030.01015.66
7.1.80.0030.00916.00
7.1.70.0050.00416.41
7.1.60.0080.00818.21
7.1.50.0080.01016.42
7.1.40.0110.00415.40
7.1.30.0030.00815.68
7.1.20.0040.00415.73
7.1.10.0060.01015.76
7.1.00.0070.03918.97
7.0.330.0040.00815.38
7.0.320.0070.00315.48
7.0.310.0080.00615.50
7.0.300.0030.01015.30
7.0.290.0060.00615.48
7.0.280.0000.01015.41
7.0.270.0000.01415.21
7.0.260.0070.00715.42
7.0.250.0060.00615.46
7.0.240.0040.01115.58
7.0.230.0040.01115.46
7.0.220.0030.00815.39
7.0.210.0000.01315.30
7.0.200.0090.00715.71
7.0.190.0070.00715.44
7.0.180.0040.00715.24
7.0.170.0030.01015.41
7.0.160.0070.00415.44
7.0.150.0040.01115.60
7.0.140.0090.00315.32
7.0.130.0040.00415.19
7.0.120.0030.00515.56
7.0.110.0080.00815.47
7.0.100.0120.00615.55
7.0.90.0110.00615.46
7.0.80.0050.00315.33
7.0.70.0080.00415.40
7.0.60.0020.02718.57
7.0.50.0030.02816.53
7.0.40.0080.03917.01
7.0.30.0140.02916.85
7.0.20.0130.03316.92
7.0.10.0160.03316.88
7.0.00.0150.03216.95
5.6.400.0030.01214.36
5.6.390.0040.01114.75
5.6.380.0000.01514.58
5.6.370.0030.01014.63
5.6.360.0080.00514.45
5.6.350.0000.01514.38
5.6.340.0030.00614.23
5.6.330.0080.00614.55
5.6.320.0090.00314.36
5.6.310.0060.00614.45
5.6.300.0030.00714.45
5.6.290.0040.01114.61
5.6.280.0000.04417.53
5.6.270.0000.01314.49
5.6.260.0060.00914.61
5.6.250.0000.01314.41
5.6.240.0060.00914.52
5.6.230.0030.00714.52
5.6.220.0060.00614.46
5.6.210.0050.04317.53
5.6.200.0030.03216.29
5.6.190.0200.04017.51
5.6.180.0100.03917.50
5.6.170.0160.03017.50
5.6.160.0070.03717.62
5.6.150.0080.03517.39
5.6.140.0150.03017.36
5.6.130.0070.04417.51
5.6.120.0080.03617.46
5.6.110.0120.02717.27
5.6.100.0120.03517.45
5.6.90.0220.03417.54
5.6.80.0280.03217.03
5.6.70.0030.03517.02
5.6.60.0270.03117.05
5.6.50.0190.03717.10
5.6.40.0180.02916.89
5.6.30.0050.03717.13
5.6.20.0250.03017.17
5.6.10.0220.03217.03
5.6.00.0250.03417.05
5.5.380.0000.01313.96
5.5.370.0100.00014.20
5.5.360.0090.00614.15
5.5.350.0130.04517.34
5.5.340.0070.04016.28
5.5.330.0150.04017.34
5.5.320.0180.02617.42
5.5.310.0130.03217.38
5.5.300.0140.03017.16
5.5.290.0100.03617.43
5.5.280.0090.03217.33
5.5.270.0070.03217.35
5.5.260.0270.02717.12
5.5.250.0210.03317.12
5.5.240.0190.03116.99
5.5.230.0150.02616.80
5.5.220.0060.03516.98
5.5.210.0220.03016.94
5.5.200.0170.03516.94
5.5.190.0050.03417.00
5.5.180.0220.03316.74
5.5.170.0060.00614.37
5.5.160.0360.02617.06
5.5.150.0300.03216.97
5.5.140.0270.02916.78
5.5.130.0320.02616.91
5.5.120.0300.02716.81
5.5.110.0260.02717.01
5.5.100.0250.02717.03
5.5.90.0240.03216.94
5.5.80.0200.03416.78
5.5.70.0230.03216.73
5.5.60.0180.03316.88
5.5.50.0160.03316.85
5.5.40.0320.02716.96
5.5.30.0250.03216.90
5.5.20.0280.02816.87
5.5.10.0280.03016.72
5.5.00.0030.03516.88

preferences:
99.07 ms | 400 KiB | 5 Q