3v4l.org

run code in 300+ PHP versions simultaneously
<?php /** * @property stdClass $x * @property stdClass $y */ class C { private $buffer = array(); function __get($key) { if (array_key_exists($key, $this->buffer)) { return $this->buffer[$key]; } $f = 'calc_' . $key; return $this->buffer[$key] = $this->$f(); } function calc_x() {print __METHOD__ . "\n"; $x = new stdClass; $x->y = $this->__get('y'); return $x; } function calc_y() {print __METHOD__ . "\n"; $y = new stdClass; // Set a stub to avoid infinite recursion. $this->buffer['y'] = $y; $y->x = $this->__get('x'); return $y; } } $c = new C; $x = $c->x; $y = $c->y; var_dump($x->y === $y, $y->x === $x); print "\n"; $c = new C; $c->y;

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.0120.00616.48
8.3.50.0080.01321.26
8.3.40.0120.00418.96
8.3.30.0070.00718.68
8.3.20.0070.00020.38
8.3.10.0000.00823.44
8.3.00.0000.00723.65
8.2.180.0070.01416.50
8.2.170.0110.00422.96
8.2.160.0070.01120.94
8.2.150.0050.00324.18
8.2.140.0070.00724.66
8.2.130.0080.00019.72
8.2.120.0030.00726.35
8.2.110.0030.00620.54
8.2.100.0080.00418.16
8.2.90.0080.00019.21
8.2.80.0000.00817.97
8.2.70.0030.00617.50
8.2.60.0040.00717.93
8.2.50.0040.00418.07
8.2.40.0030.00522.33
8.2.30.0030.00519.50
8.2.20.0000.00817.82
8.2.10.0000.00718.05
8.2.00.0000.00718.03
8.1.280.0090.00625.92
8.1.270.0130.00623.84
8.1.260.0000.00828.09
8.1.250.0040.00428.09
8.1.240.0090.00023.91
8.1.230.0070.00318.97
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0090.00017.25
8.1.190.0000.00817.22
8.1.180.0030.00518.10
8.1.170.0050.00318.62
8.1.160.0000.00720.70
8.1.150.0040.00418.83
8.1.140.0080.00019.58
8.1.130.0030.00317.69
8.1.120.0060.00317.29
8.1.110.0050.00217.47
8.1.100.0070.00017.39
8.1.90.0030.00617.44
8.1.80.0040.00417.28
8.1.70.0030.00317.39
8.1.60.0040.00417.50
8.1.50.0000.00917.57
8.1.40.0000.00817.43
8.1.30.0040.00417.62
8.1.20.0050.00317.65
8.1.10.0050.00217.47
8.1.00.0040.00417.44
8.0.300.0040.00418.77
8.0.290.0050.00216.75
8.0.280.0050.00318.51
8.0.270.0030.00317.27
8.0.260.0060.00017.23
8.0.250.0070.00016.96
8.0.240.0000.00816.83
8.0.230.0000.00716.94
8.0.220.0040.00416.91
8.0.210.0050.00216.86
8.0.200.0000.00616.95
8.0.190.0070.00016.97
8.0.180.0070.00016.81
8.0.170.0030.00516.89
8.0.160.0030.00516.82
8.0.150.0070.00016.77
8.0.140.0040.00416.83
8.0.130.0030.00313.34
8.0.120.0000.00816.82
8.0.110.0060.00316.84
8.0.100.0040.00416.72
8.0.90.0040.00416.73
8.0.80.0070.00716.79
8.0.70.0000.00816.90
8.0.60.0000.00716.77
8.0.50.0000.00816.82
8.0.30.0100.00917.12
8.0.20.0070.01217.40
8.0.10.0050.00216.83
8.0.00.0100.00816.69
7.4.330.0000.00516.70
7.4.320.0030.00316.55
7.4.300.0000.00816.52
7.4.290.0030.00316.59
7.4.280.0060.00316.50
7.4.270.0030.00316.40
7.4.260.0030.00716.40
7.4.250.0030.00516.56
7.4.240.0030.00416.38
7.4.230.0000.00816.41
7.4.220.0110.01116.48
7.4.210.0080.00816.49
7.4.200.0040.00416.50
7.4.160.0090.00916.41
7.4.150.0120.00617.40
7.4.140.0140.00717.86
7.4.130.0110.00916.60
7.4.120.0050.01316.54
7.4.110.0030.01516.59
7.4.100.0160.00316.59
7.4.90.0070.01016.51
7.4.80.0000.01719.39
7.4.70.0060.01016.32
7.4.60.0130.00316.28
7.4.50.0000.01216.62
7.4.40.0160.00016.63
7.4.30.0080.00816.43
7.4.00.0070.01014.75
7.3.330.0000.00913.36
7.3.320.0050.00013.17
7.3.310.0070.00016.28
7.3.300.0000.00616.24
7.3.290.0030.00316.40
7.3.280.0140.00316.41
7.3.270.0070.01117.40
7.3.260.0080.00816.39
7.3.250.0120.00616.49
7.3.240.0060.01216.42
7.3.230.0070.01016.59
7.3.210.0140.00316.40
7.3.200.0110.00516.60
7.3.190.0090.00616.66
7.3.180.0030.01416.37
7.3.170.0170.00616.43
7.3.160.0170.00016.65
7.3.120.0000.01415.16
7.3.110.0060.01214.64
7.3.100.0060.00915.09
7.3.90.0040.00714.96
7.3.80.0080.00414.86
7.3.70.0120.00314.80
7.3.60.0040.00814.93
7.3.50.0040.01214.94
7.3.40.0060.00614.77
7.3.30.0080.00314.89
7.3.20.0060.01016.72
7.3.10.0100.00316.40
7.3.00.0060.00616.64
7.2.330.0170.00316.83
7.2.320.0130.00616.75
7.2.310.0170.00316.60
7.2.300.0090.00916.46
7.2.290.0110.01116.91
7.2.250.0080.00815.10
7.2.240.0040.01115.28
7.2.230.0060.00915.19
7.2.220.0060.00614.89
7.2.210.0070.00314.90
7.2.200.0060.00814.87
7.2.190.0080.00815.21
7.2.180.0040.01115.12
7.2.170.0030.00715.15
7.2.130.0120.01216.78
7.2.120.0170.00616.50
7.2.110.0130.00416.52
7.2.100.0040.01916.55
7.2.90.0060.01316.66
7.2.80.0160.00716.50
7.2.70.0180.01216.71
7.2.60.0060.01116.76
7.2.50.0120.00616.38
7.2.40.0190.00316.78
7.2.30.0100.00716.70
7.2.20.0030.01016.42
7.2.10.0060.00316.44
7.2.00.0030.00918.04
7.1.330.0100.00315.77
7.1.320.0030.00615.88
7.1.310.0070.00716.02
7.1.300.0090.00015.58
7.1.290.0040.01115.54
7.1.280.0060.01016.00
7.1.270.0140.00015.79
7.1.260.0040.00815.66
7.1.250.0070.01115.57
7.1.200.0130.00315.80
7.1.100.0030.00917.99
7.1.70.0050.00217.23
7.1.60.0060.00919.18
7.1.50.0150.01916.69
7.1.00.0030.08022.31
7.0.200.0420.01214.59
7.0.60.0030.08021.71
7.0.50.0100.08317.81
7.0.40.0100.08720.13
7.0.30.0270.07320.16
7.0.20.0130.06020.26
7.0.10.0030.05720.19
7.0.00.0100.08020.22
5.6.280.0100.06020.82
5.6.210.0170.07720.68
5.6.200.0070.09018.22
5.6.190.0100.04320.46
5.6.180.0300.08020.64
5.6.170.0270.07320.56
5.6.160.0100.03720.46
5.6.150.0030.04018.27
5.6.140.0100.07318.22
5.6.130.0070.08018.22
5.6.120.0170.07021.13
5.6.110.0100.06320.99
5.6.100.0100.05020.96
5.6.90.0100.06321.11
5.6.80.0130.06020.33
5.5.350.0200.03320.50
5.5.340.0100.07717.98
5.5.330.0130.05320.43
5.5.320.0330.07320.28
5.5.310.0100.05720.30
5.5.300.0070.03717.98
5.5.290.0100.08317.98
5.5.280.0070.07320.66
5.5.270.0070.03720.65
5.5.260.0100.05320.77
5.5.250.0100.07720.50
5.5.240.0130.08320.20

preferences:
47.4 ms | 401 KiB | 5 Q