3v4l.org

run code in 300+ PHP versions simultaneously
<?php function &get_instance_ref() { static $obj; static $property ='a'; echo 'Static object: '; var_dump($obj); if (!isset($obj)) { // Assign a reference to the static variable $obj = &new stdclass; } $obj->property++; return $obj; } function &get_instance_noref() { static $obj; static $property='a'; echo 'Static object: '; var_dump($obj); if (!isset($obj)) { // Assign the object to the static variable $obj = new stdclass; } $obj->property++; return $obj; } $obj1 = get_instance_ref(); $still_obj1 = get_instance_ref(); echo "\n"; $obj2 = get_instance_noref(); $still_obj2 = get_instance_noref(); ?>

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)
5.6.280.0100.06721.00
5.6.210.0070.03720.57
5.6.200.0070.07718.16
5.6.190.0000.09720.46
5.6.180.0170.04320.60
5.6.170.0230.07720.44
5.6.160.0000.09320.46
5.6.150.0000.09018.25
5.6.140.0070.03718.18
5.6.130.0070.08318.11
5.6.120.0070.08720.96
5.6.110.0070.05320.95
5.6.100.0170.07720.92
5.6.90.0100.09020.99
5.6.80.0030.05720.45
5.6.70.0230.07720.52
5.5.350.0230.07320.43
5.5.340.0070.04017.96
5.5.330.0170.08020.19
5.5.320.0270.05320.30
5.5.310.0200.08720.19
5.5.300.0070.03718.01
5.5.290.0100.07718.04
5.5.280.0030.07320.74
5.5.270.0030.08720.76
5.5.260.0130.04720.87
5.5.250.0070.08020.78
5.5.240.0200.06720.13
5.4.450.0100.06319.25
5.4.440.0070.07319.49
5.4.430.0100.05719.48
5.4.420.0000.05319.47
5.4.410.0030.03719.12
5.4.400.0100.03018.93
5.4.390.0070.06318.92
5.4.380.0000.04019.08
5.4.370.0100.06019.16
5.4.360.0100.07319.24
5.4.350.0030.04319.14
5.4.340.0000.05019.16
5.4.320.0070.05019.14
5.4.310.0170.06718.92
5.4.300.0100.07019.20
5.4.290.0130.07319.08
5.4.280.0070.05019.23
5.4.270.0100.05019.16
5.4.260.0070.04319.20
5.4.250.0070.05319.16
5.4.240.0030.04718.97
5.4.230.0100.07018.85
5.4.220.0030.08019.23
5.4.210.0100.05719.23
5.4.200.0070.04719.11
5.4.190.0030.04718.91
5.4.180.0100.07019.14
5.4.170.0130.07319.23
5.4.160.0000.05718.98
5.4.150.0000.06018.82
5.4.140.0030.06016.47
5.4.130.0030.07316.39
5.4.120.0170.03316.59
5.4.110.0030.06716.35
5.4.100.0100.04016.58
5.4.90.0030.06716.34
5.4.80.0070.04016.53
5.4.70.0030.07716.42
5.4.60.0030.04716.32
5.4.50.0170.03316.36
5.4.40.0000.05016.64
5.4.30.0130.05716.26
5.4.20.0200.05716.52
5.4.10.0070.07716.30
5.4.00.0000.06015.83
5.3.290.0000.04714.67
5.3.280.0070.05014.64
5.3.270.0130.06714.66
5.3.260.0070.07714.61
5.3.250.0100.04314.67
5.3.240.0000.06714.68
5.3.230.0130.05714.52
5.3.220.0070.05314.73
5.3.210.0070.04014.60
5.3.200.0070.06014.72
5.3.190.0030.06314.50
5.3.180.0100.04714.64
5.3.170.0000.07314.63
5.3.160.0070.07714.46
5.3.150.0130.06714.46
5.3.140.0030.08014.56
5.3.130.0100.04314.57
5.3.120.0170.06714.63
5.3.110.0030.07314.70
5.3.100.0030.07714.12
5.3.90.0030.04014.17
5.3.80.0070.06014.07
5.3.70.0030.04314.06
5.3.60.0030.04714.05
5.3.50.0130.06713.87
5.3.40.0070.06713.98
5.3.30.0000.04713.84
5.3.20.0030.03713.66
5.3.10.0070.04013.67
5.3.00.0000.07313.61
5.2.170.0100.03711.06
5.2.160.0030.03011.16
5.2.150.0100.03311.22
5.2.140.0070.04011.22
5.2.130.0100.06011.16
5.2.120.0030.03011.18
5.2.110.0030.06311.16
5.2.100.0100.05711.27
5.2.90.0030.05711.11
5.2.80.0100.06011.28
5.2.70.0000.04011.26
5.2.60.0070.05711.13
5.2.50.0000.04011.00
5.2.40.0030.04311.15
5.2.30.0000.04711.13
5.2.20.0030.05711.02
5.2.10.0030.02711.02
5.2.00.0000.03010.80
5.1.60.0100.03010.02
5.1.50.0100.0239.96
5.1.40.0030.0439.89
5.1.30.0000.05710.40
5.1.20.0030.05310.35
5.1.10.0000.05310.13
5.1.00.0000.03710.08
5.0.50.0000.0378.46
5.0.40.0100.0408.39
5.0.30.0000.0438.25
5.0.20.0030.0338.23
5.0.10.0000.0238.18
5.0.00.0030.0638.14
4.4.90.0100.0278.11
4.4.80.0070.0338.11
4.4.70.0030.0378.11
4.4.60.0000.0238.11
4.4.50.0030.0138.11
4.4.40.0030.0408.11
4.4.30.0000.0278.11
4.4.20.0000.0178.11
4.4.10.0030.0338.11
4.4.00.0000.0338.11
4.3.110.0030.0308.11
4.3.100.0030.0308.11
4.3.90.0030.0338.11
4.3.80.0000.0278.11
4.3.70.0030.0178.11
4.3.60.0000.0238.11
4.3.50.0000.0278.11
4.3.40.0030.0378.11
4.3.30.0000.0208.11
4.3.20.0000.0208.11
4.3.10.0070.0208.11
4.3.00.0030.0178.11

preferences:
140.67 ms | 1394 KiB | 7 Q