3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Header { public function __construct() { $this->project = get_prior_object(); $this->modules = get_prior_object(1); } } class Modules { public function __construct() { $this->project = get_prior_object(); $this->header = new Header(); } } class Project { public $config = "config"; public function __construct() { $this->modules = new Modules(); } } $p = new Project(); var_dump($p->modules, $p->modules->header, $p->modules->project); function get_prior_object($skip = 0) { $bt = debug_backtrace(); if (isset($bt[1]['function']) && $bt[1]['function'] === "__construct") { // called from constructor, so skip it! $skip++; } foreach ($bt as $stack) { if (isset($stack['function']) && $stack['function'] === "__construct" && $skip-- <= 0) { return $stack['object']; } } return null; }

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.61
8.3.50.0120.00817.30
8.3.40.0150.00018.84
8.3.30.0040.01118.84
8.3.20.0050.00318.65
8.3.10.0040.00418.67
8.3.00.0040.00419.38
8.2.180.0110.01116.50
8.2.170.0040.01122.96
8.2.160.0110.00718.91
8.2.150.0030.00624.18
8.2.140.0050.00324.66
8.2.130.0040.00426.16
8.2.120.0030.00719.77
8.2.110.0030.00722.11
8.2.100.0100.00517.91
8.2.90.0050.00319.15
8.2.80.0090.00017.97
8.2.70.0090.00617.63
8.2.60.0060.00318.05
8.2.50.0060.00318.07
8.2.40.0030.00619.35
8.2.30.0080.00017.81
8.2.20.0060.00317.79
8.2.10.0000.00817.80
8.2.00.0000.00817.75
8.1.280.0040.01825.92
8.1.270.0040.00423.99
8.1.260.0040.00426.35
8.1.250.0090.00028.09
8.1.240.0060.00322.05
8.1.230.0090.00319.07
8.1.220.0050.00317.74
8.1.210.0040.00418.77
8.1.200.0060.00317.47
8.1.190.0040.00417.35
8.1.180.0080.00018.10
8.1.170.0040.00418.71
8.1.160.0030.00619.07
8.1.150.0070.00318.70
8.1.140.0040.00417.46
8.1.130.0040.00419.20
8.1.120.0000.00717.50
8.1.110.0000.00717.41
8.1.100.0040.00417.46
8.1.90.0000.00717.42
8.1.80.0000.00717.36
8.1.70.0040.00417.45
8.1.60.0080.00017.59
8.1.50.0040.00417.56
8.1.40.0000.00817.58
8.1.30.0060.00317.51
8.1.20.0080.00317.66
8.1.10.0030.00517.48
8.1.00.0000.00917.33
8.0.300.0060.00318.77
8.0.290.0050.00316.75
8.0.280.0030.00518.48
8.0.270.0000.00717.26
8.0.260.0040.00416.81
8.0.250.0050.00416.84
8.0.240.0000.00816.98
8.0.230.0040.00416.95
8.0.220.0070.00016.94
8.0.210.0050.00316.86
8.0.200.0050.00316.99
8.0.190.0030.00616.87
8.0.180.0040.00416.82
8.0.170.0000.00816.89
8.0.160.0000.00716.93
8.0.150.0000.00816.73
8.0.140.0030.00516.89
8.0.130.0000.00613.28
8.0.120.0040.00716.74
8.0.110.0040.00416.94
8.0.100.0030.00516.90
8.0.90.0030.00516.78
8.0.80.0100.01016.88
8.0.70.0040.00416.86
8.0.60.0060.00316.77
8.0.50.0070.00016.93
8.0.30.0120.00616.78
8.0.20.0060.01316.99
8.0.10.0030.00616.86
8.0.00.0130.00816.91
7.4.330.0000.00512.96
7.4.320.0060.00016.48
7.4.300.0000.00716.58
7.4.290.0030.00316.64
7.4.280.0030.00616.41
7.4.270.0000.00716.56
7.4.260.0030.00313.28
7.4.250.0030.00616.54
7.4.240.0030.00316.52
7.4.230.0070.00016.49
7.4.220.0100.01716.64
7.4.210.0060.00916.56
7.4.200.0000.00716.44
7.4.190.0000.00816.56
7.4.160.0100.00716.39
7.4.150.0130.00816.30
7.4.140.0150.00417.86
7.4.130.0160.00316.64
7.4.120.0090.00916.49
7.4.110.0060.01216.52
7.4.100.0120.00616.61
7.4.90.0120.00616.36
7.4.80.0170.00819.39
7.4.70.0030.01316.53
7.4.60.0130.00316.50
7.4.50.0030.00316.54
7.4.40.0090.00616.46
7.4.30.0090.00916.50
7.4.00.0030.01315.00
7.3.330.0060.00013.20
7.3.320.0000.00813.23
7.3.310.0000.00716.27
7.3.300.0030.00316.38
7.3.290.0060.01016.39
7.3.280.0070.00716.32
7.3.270.0140.00716.56
7.3.260.0170.00316.77
7.3.240.0120.00616.37
7.3.230.0100.01016.61
7.3.210.0120.00616.66
7.3.200.0070.01016.65
7.3.190.0120.00616.59
7.3.180.0100.00716.28
7.3.170.0090.00916.74
7.3.160.0060.01116.41
7.3.120.0070.01015.01
7.3.110.0090.00915.01
7.3.100.0090.00615.07
7.3.90.0030.01414.93
7.3.80.0110.00314.95
7.3.70.0060.01014.88
7.3.60.0000.01514.90
7.3.50.0060.00914.87
7.3.40.0070.01314.68
7.3.30.0000.01414.95
7.3.20.0050.00516.63
7.3.10.0100.00316.56
7.3.00.0040.00816.46
7.2.330.0110.00716.80
7.2.320.0070.01316.90
7.2.310.0080.01216.64
7.2.300.0080.00816.48
7.2.290.0140.00516.79
7.2.250.0090.00914.73
7.2.240.0030.01214.70
7.2.230.0120.00314.93
7.2.220.0060.00615.32
7.2.210.0040.01415.02
7.2.200.0000.01215.14
7.2.190.0070.01115.22
7.2.180.0070.01114.80
7.2.170.0070.00714.79
7.2.110.0110.00416.79
7.2.60.0000.01416.85
7.2.00.0070.01019.50
7.1.330.0030.01415.79
7.1.320.0000.01315.79
7.1.310.0070.01015.95
7.1.300.0030.01015.83
7.1.290.0040.00415.73
7.1.280.0120.00315.62
7.1.270.0110.00715.60
7.1.260.0030.00915.98
7.1.200.0090.00315.80
7.1.100.0000.01018.19
7.1.70.0040.00417.27
7.1.60.0140.01019.21
7.1.50.0070.01117.06
7.1.00.0070.07322.48
7.0.200.0030.00716.86
7.0.140.0030.07321.99
7.0.120.0030.07322.18
7.0.60.0200.07019.95
7.0.50.0070.07017.91
7.0.40.0100.08020.38
7.0.30.0270.09020.30
7.0.20.0270.03320.19
7.0.10.0030.09020.15
7.0.00.0100.08320.22
5.6.280.0000.07720.91
5.6.210.0100.07720.68
5.6.200.0070.08318.15
5.6.190.0070.04020.77
5.6.180.0530.06720.41
5.6.170.0170.05320.55
5.6.160.0100.08320.57
5.6.150.0130.07318.21
5.6.140.0030.08318.23
5.6.130.0000.05718.14
5.6.120.0000.04321.13
5.6.110.0100.06721.00
5.6.100.0100.03321.04
5.6.90.0130.08021.00
5.6.80.0070.07320.50
5.5.350.2900.03720.45
5.5.340.0000.04317.99
5.5.330.0030.04720.19
5.5.320.0000.06720.35
5.5.310.0300.04020.32
5.5.300.0100.05017.94
5.5.290.0100.07717.95
5.5.280.0100.08020.91
5.5.270.0100.08320.73
5.5.260.0070.07720.78
5.5.250.0100.07020.51
5.5.240.0100.06720.28
5.4.450.0570.06719.20
5.4.440.0370.05319.28
5.4.430.0370.04719.54
5.4.420.0470.04019.53
5.4.410.0470.03019.14
5.4.400.0530.07019.14
5.4.390.0400.03719.25
5.4.380.0530.06319.22
5.4.370.0500.05319.15
5.4.360.0570.05019.20
5.4.350.0500.06319.07
5.4.340.0230.05019.00
5.4.320.0570.06018.89
5.4.310.0530.06319.31
5.4.300.0400.04719.17
5.4.290.0400.04018.94
5.4.280.0600.03019.21
5.4.270.0500.04319.00
5.4.260.0470.03319.24
5.4.250.0400.03719.13
5.4.240.0570.05019.19
5.4.230.0370.05018.97
5.4.220.0400.03718.86
5.4.210.0400.03719.07
5.4.200.0470.06719.07
5.4.190.0570.06019.07
5.4.180.0470.03719.08
5.4.170.0430.05319.33
5.4.160.0530.05718.96
5.4.150.0570.07319.17
5.4.140.0400.03716.38
5.4.130.0430.04716.37
5.4.120.0500.06716.41
5.4.110.0500.04716.58
5.4.100.0470.05716.63
5.4.90.0530.06016.41
5.4.80.0530.05316.59
5.4.70.0500.06716.55
5.4.60.0300.04316.51
5.4.50.0230.07316.53
5.4.40.0530.06316.25
5.4.30.0470.06016.50
5.4.20.0470.05016.24
5.4.10.0330.04016.53
5.4.00.0430.04315.96
5.3.290.0570.03314.84
5.3.280.0430.05014.72
5.3.270.0500.05714.62
5.3.260.0530.06314.61
5.3.250.0470.04014.59
5.3.240.0330.04314.77
5.3.230.0530.05714.69
5.3.220.0670.06014.62
5.3.210.0500.05714.55
5.3.200.0500.06314.80
5.3.190.0470.04014.48
5.3.180.0530.06014.65
5.3.170.0570.05714.73
5.3.160.0270.06714.55
5.3.150.0300.06014.73
5.3.140.0500.05314.68
5.3.130.0530.06314.49
5.3.120.0430.04314.55
5.3.110.0370.04014.63
5.3.100.0470.06314.09
5.3.90.0330.04314.05
5.3.80.0530.05013.94
5.3.70.0500.06714.12
5.3.60.0430.05314.17
5.3.50.0470.03714.01
5.3.40.0500.06014.01
5.3.30.0500.06014.14
5.3.20.0370.04013.68
5.3.10.0530.05713.68
5.3.00.0470.04313.65
5.2.170.0470.05011.12
5.2.160.0670.03711.07
5.2.150.0370.02711.07
5.2.140.0330.05011.27
5.2.130.0300.03011.04
5.2.120.0430.04011.04
5.2.110.0330.03011.04
5.2.100.0400.02711.02
5.2.90.0500.05011.12
5.2.80.0300.03711.01
5.2.70.0470.05011.01
5.2.60.0400.05710.93
5.2.50.0530.03711.14
5.2.40.0330.02311.00
5.2.30.0330.03711.06
5.2.20.0300.06010.97
5.2.10.0270.03010.88
5.2.00.0370.05010.65
5.1.60.0370.05010.01
5.1.50.0330.04710.14
5.1.40.0300.0279.92
5.1.30.0300.03010.35
5.1.20.0270.02310.37
5.1.10.0170.0309.96
5.1.00.0230.02310.16
5.0.50.0100.0208.54
5.0.40.0100.0208.58
5.0.30.0100.0308.36
5.0.20.0170.0238.37
5.0.10.0100.0208.20
5.0.00.0130.0308.33
4.4.90.0200.0307.82
4.4.80.0170.0337.82
4.4.70.0130.0177.82
4.4.60.0130.0377.82
4.4.50.0130.0277.82
4.4.40.0230.0477.82
4.4.30.0200.0207.82
4.4.20.0100.0137.82
4.4.10.0100.0207.82
4.4.00.0130.0207.82
4.3.110.0070.0177.82
4.3.100.0100.0137.82
4.3.90.0100.0177.82
4.3.80.0170.0337.82
4.3.70.0100.0207.82
4.3.60.0100.0177.82
4.3.50.0130.0207.82
4.3.40.0130.0237.82
4.3.30.0030.0177.82
4.3.20.0030.0337.82
4.3.10.0070.0277.82
4.3.00.0030.0207.82

preferences:
37.38 ms | 400 KiB | 5 Q