3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyObject{ public static $_register = array(); public $_id = -1; public $_value = ''; function __construct( $value ){ $this->_value = $value; $this->_id = count( self::$_register ); var_dump($this); self::$_register[ $this->_id ] = &$this; // I also tried '= &$this' } function foo(){ // outputs 'id : value' echo $this->_id.' : ' . $this->_value. PHP_EOL; } } $test = new MyObject( 'hihi' ); $test->foo(); var_dump(MyObject::$_register); MyObject::$_register[0]=null; var_dump($test);

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.0090.00616.50
8.3.50.0080.01421.97
8.3.40.0090.01318.81
8.3.30.0110.00419.13
8.3.20.0150.00420.52
8.3.10.0030.00623.48
8.3.00.0080.00020.95
8.2.180.0110.00418.54
8.2.170.0120.00322.96
8.2.160.0090.01320.39
8.2.150.0050.00324.18
8.2.140.0040.00424.66
8.2.130.0090.00026.16
8.2.120.0070.00720.79
8.2.110.0090.00022.08
8.2.100.0060.00618.03
8.2.90.0050.00319.17
8.2.80.0050.00317.97
8.2.70.0050.00317.46
8.2.60.0050.00318.05
8.2.50.0040.00418.07
8.2.40.0030.00619.87
8.2.30.0080.00018.23
8.2.20.0040.00417.79
8.2.10.0040.00418.13
8.2.00.0000.00817.63
8.1.280.0140.00325.92
8.1.270.0060.00323.97
8.1.260.0040.00426.35
8.1.250.0080.00028.09
8.1.240.0110.00023.82
8.1.230.0060.00619.05
8.1.220.0030.00517.80
8.1.210.0000.00818.77
8.1.200.0030.00617.35
8.1.190.0050.00317.35
8.1.180.0040.00418.10
8.1.170.0080.00418.41
8.1.160.0050.00322.09
8.1.150.0000.00718.52
8.1.140.0040.00417.51
8.1.130.0070.00017.50
8.1.120.0040.00417.38
8.1.110.0040.00417.45
8.1.100.0000.00717.48
8.1.90.0000.00817.36
8.1.80.0000.00817.38
8.1.70.0040.00417.43
8.1.60.0060.00317.55
8.1.50.0000.00817.47
8.1.40.0000.01017.48
8.1.30.0000.00917.59
8.1.20.0040.00417.70
8.1.10.0050.00317.56
8.1.00.0050.00217.53
8.0.300.0000.00718.77
8.0.290.0050.00217.18
8.0.280.0030.00318.47
8.0.270.0030.00317.32
8.0.260.0060.00316.75
8.0.250.0030.00316.85
8.0.240.0030.00316.97
8.0.230.0030.00316.92
8.0.220.0030.00316.89
8.0.210.0040.00416.80
8.0.200.0070.00016.98
8.0.190.0000.00716.94
8.0.180.0040.00416.91
8.0.170.0040.00416.93
8.0.160.0040.00316.92
8.0.150.0040.00416.81
8.0.140.0000.00716.91
8.0.130.0000.00613.34
8.0.120.0040.00416.85
8.0.110.0000.00916.99
8.0.100.0040.00416.84
8.0.90.0000.00716.93
8.0.80.0060.01016.90
8.0.70.0040.00416.97
8.0.60.0000.00717.02
8.0.50.0070.00016.86
8.0.30.0090.01016.95
8.0.20.0080.01017.40
8.0.10.0070.00016.86
8.0.00.0100.00816.98
7.4.330.0030.00315.01
7.4.320.0070.00016.47
7.4.300.0030.00316.62
7.4.290.0000.00716.54
7.4.280.0030.00316.56
7.4.270.0030.00316.52
7.4.260.0000.00716.43
7.4.250.0040.00416.47
7.4.240.0070.00016.62
7.4.230.0020.00516.62
7.4.220.0030.01516.62
7.4.210.0100.00716.51
7.4.200.0000.00716.62
7.4.190.0070.00016.38
7.4.160.0030.01416.36
7.4.150.0180.00017.40
7.4.140.0080.01417.86
7.4.130.0110.00716.49
7.4.120.0110.00716.59
7.4.110.0130.01016.61
7.4.100.0090.00916.55
7.4.90.0110.00716.38
7.4.80.0150.00919.39
7.4.70.0100.00716.36
7.4.60.0120.00816.63
7.4.50.0030.00616.39
7.4.40.0090.00916.45
7.4.30.0130.00316.66
7.4.00.0030.00614.92
7.3.330.0050.00013.37
7.3.320.0060.00013.40
7.3.310.0030.00316.41
7.3.300.0030.00316.39
7.3.290.0100.01016.38
7.3.280.0050.01116.38
7.3.270.0110.00717.40
7.3.260.0130.00716.56
7.3.250.0080.01016.35
7.3.240.0030.01916.34
7.3.230.0100.00616.39
7.3.210.0030.01316.37
7.3.200.0060.01119.39
7.3.190.0200.02116.42
7.3.180.0030.01316.51
7.3.170.0150.00016.62
7.3.160.0060.00916.65
7.3.120.0030.00914.98
7.3.10.0040.01116.84
7.3.00.0060.00916.47
7.2.330.0090.00916.70
7.2.320.0000.01916.82
7.2.310.0070.01116.82
7.2.300.0100.01016.76
7.2.290.0120.00616.70
7.2.130.0050.00516.57
7.2.120.0040.01116.94
7.2.110.0030.01016.76
7.2.100.0060.00916.89
7.2.90.0070.01016.94
7.2.80.0060.00617.07
7.2.70.0140.00316.62
7.2.60.0030.01016.50
7.2.50.0100.00717.21
7.2.40.0090.00916.59
7.2.30.0060.01016.53
7.2.20.0030.01316.83
7.2.10.0130.00317.00
7.2.00.0050.00818.25
7.1.250.0060.00915.85
7.1.100.0120.00618.30
7.1.70.0000.01117.28
7.1.60.0040.01116.88
7.1.50.0110.01417.01
7.1.00.0030.07722.48
7.0.200.0000.01016.88
7.0.140.0030.07322.22
7.0.60.0130.06720.01
7.0.50.0070.06017.87
7.0.40.0070.05017.86
7.0.30.0100.03717.76
7.0.20.0070.04317.81
7.0.10.0100.07717.80
7.0.00.0030.07717.80
5.6.280.0070.07021.08
5.6.210.0000.08320.73
5.6.200.0030.09018.19
5.6.190.0130.06018.27
5.6.180.0000.06718.25
5.6.170.0030.04318.18
5.6.160.0070.05018.14
5.6.150.0070.05318.28
5.6.140.0100.07318.29
5.6.130.0070.08318.33
5.6.120.0100.07718.18
5.6.110.0100.04718.11
5.6.100.0030.04018.18
5.6.90.0130.07318.10
5.6.80.0070.05717.57
5.6.70.0170.07017.57
5.6.60.0130.07317.53
5.6.50.0100.04717.66
5.6.40.0030.05717.63
5.6.30.0100.04717.64
5.6.20.0100.07717.64
5.6.10.0100.05317.57
5.6.00.0100.07017.54
5.5.350.0230.04320.39
5.5.340.0100.07718.08
5.5.330.0100.08017.95
5.5.320.0070.03717.98
5.5.310.0100.03717.97
5.5.300.0000.04717.95
5.5.290.0070.08017.98
5.5.280.0100.06317.98
5.5.270.0000.04717.95
5.5.260.0070.04018.03
5.5.250.0030.06017.79
5.5.240.0100.07717.37
5.5.230.0100.07317.37
5.5.220.0030.06017.36
5.5.210.0100.07717.46
5.5.200.0030.08017.30
5.5.190.0070.05717.33
5.5.180.0030.04017.32
5.5.160.0030.05017.30
5.5.150.0000.04317.30
5.5.140.0130.07017.30
5.5.130.0100.04717.29
5.5.120.0000.05317.33
5.5.110.0070.08017.43
5.5.100.0030.07317.21
5.5.90.0070.07317.30
5.5.80.0030.06317.23
5.5.70.0100.03717.18
5.5.60.0100.04717.31
5.5.50.0070.06017.32
5.5.40.0100.04317.26
5.5.30.0100.07717.27
5.5.20.0030.07717.23
5.5.10.0030.06017.30
5.5.00.0100.06717.21
5.4.450.0100.05319.43
5.4.440.0070.08319.35
5.4.430.0000.04319.28
5.4.420.0030.07319.46
5.4.410.0070.06719.18
5.4.400.0100.06318.89
5.4.390.0170.06719.13
5.4.380.0030.06319.27
5.4.370.0100.06319.02
5.4.360.0030.08319.13
5.4.350.0000.04319.11
5.4.340.0070.07718.97
5.4.320.0170.04019.09
5.4.310.0030.04019.09
5.4.300.0170.06019.04
5.4.290.0070.05719.09
5.4.280.0030.05718.95
5.4.270.0070.03719.01
5.4.260.0100.07719.09
5.4.250.0070.05018.88
5.4.240.0100.04319.00
5.4.230.0170.06719.12
5.4.220.0070.07718.96
5.4.210.0030.06019.02
5.4.200.0130.07019.02
5.4.190.0030.05319.02
5.4.180.0030.06018.95
5.4.170.0000.08319.00
5.4.160.0030.08019.08
5.4.150.0130.07018.96
5.4.140.0030.07316.30
5.4.130.0130.06016.43
5.4.120.0070.07016.39
5.4.110.0130.07016.42
5.4.100.0100.07316.32
5.4.90.0130.07316.32
5.4.80.0070.07016.28
5.4.70.0030.06716.29
5.4.60.0070.04016.42
5.4.50.0070.07316.32
5.4.40.0070.07716.33
5.4.30.0200.06716.30
5.4.20.0100.03316.30
5.4.10.0030.04016.32
5.4.00.0030.04015.74
5.3.290.0100.04314.70
5.3.280.0170.07014.55
5.3.270.0170.07014.65
5.3.260.0130.07014.57
5.3.250.0130.07014.59
5.3.240.0100.06714.67
5.3.230.0070.06014.67
5.3.220.0200.04714.62
5.3.210.0030.08014.60
5.3.200.0100.04014.42
5.3.190.0130.06314.42
5.3.180.0030.05714.64
5.3.170.0100.06014.61
5.3.160.0170.06714.59
5.3.150.0000.08014.60
5.3.140.0100.07014.58
5.3.130.0130.07014.57
5.3.120.0030.04714.63
5.3.110.0000.04014.61
5.3.100.0070.07014.08
5.3.90.0030.05014.06
5.3.80.0130.06314.06
5.3.70.0100.05014.06
5.3.60.0200.06314.07
5.3.50.0070.08013.94
5.3.40.0100.05313.96
5.3.30.0070.03714.13
5.3.20.0030.05313.73
5.3.10.0100.03013.66
5.3.00.0070.04313.65
5.2.170.0170.05711.20
5.2.160.0000.06711.22
5.2.150.0030.06311.00
5.2.140.0100.06011.19
5.2.130.0030.05011.18
5.2.120.0030.03311.13
5.2.110.0070.04711.14
5.2.100.0030.05711.20
5.2.90.0070.06011.14
5.2.80.0030.05711.13
5.2.70.0070.04711.13
5.2.60.0030.05711.10
5.2.50.0030.06011.13
5.2.40.0000.03711.01
5.2.30.0130.05310.87
5.2.20.0030.04310.95
5.2.10.0100.06010.96
5.2.00.0100.05310.72
5.1.60.0030.04310.10
5.1.50.0030.0439.99
5.1.40.0000.0309.98
5.1.30.0100.03710.30
5.1.20.0000.03010.43
5.1.10.0000.04310.05
5.1.00.0070.04710.08
5.0.50.0100.0408.61
5.0.40.0000.0408.62
5.0.30.0030.0308.06
5.0.20.0070.0378.41
5.0.10.0070.0408.38
5.0.00.0000.0438.27
4.4.90.0000.0307.95
4.4.80.0070.0337.95
4.4.70.0000.0377.95
4.4.60.0070.0307.95
4.4.50.0070.0107.95
4.4.40.0000.0507.95
4.4.30.0000.0377.95
4.4.20.0030.0337.95
4.4.10.0000.0377.95
4.4.00.0030.0577.95
4.3.110.0030.0137.95
4.3.100.0130.0277.95
4.3.90.0030.0307.95
4.3.80.0030.0577.95
4.3.70.0030.0277.95
4.3.60.0030.0207.95
4.3.50.0000.0207.95
4.3.40.0000.0577.95
4.3.30.0070.0277.95
4.3.20.0000.0237.95
4.3.10.0000.0207.95
4.3.00.0000.0177.95

preferences:
46.76 ms | 400 KiB | 5 Q