3v4l.org

run code in 300+ PHP versions simultaneously
<?php function &get_instance_ref() { static $obj; 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; echo 'Static object: '; var_dump($obj); if (isset($obj)) {$property=2; // Assign the object to the static variable $obj = new stdclass($this->property); } $obj->property++; return $obj; } $obj1 = get_instance_ref(); $still_obj1 = get_instance_ref(); echo "\n"; $obj2 = get_instance_noref(); $still_obj2 = get_instance_noref(); $still_obj3 = 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.0070.07020.99
5.6.210.0000.08720.67
5.6.200.0100.05318.29
5.6.190.0070.06020.58
5.6.180.0230.04020.39
5.6.170.0370.06720.47
5.6.160.0000.04320.44
5.6.150.0030.07018.24
5.6.140.0000.05018.11
5.6.130.0070.06318.21
5.6.120.0130.07721.00
5.6.110.0070.04021.09
5.6.100.0100.07020.99
5.6.90.0030.05721.01
5.6.80.0130.06720.29
5.5.350.0330.06720.41
5.5.340.0070.05018.07
5.5.330.0030.04020.23
5.5.320.0070.05020.38
5.5.310.0330.04320.27
5.5.300.0130.06018.02
5.5.290.0030.06317.94
5.5.280.0070.08020.78
5.5.270.0200.07320.73
5.5.260.0100.05320.78
5.5.250.0100.06020.71
5.5.240.0030.07720.16
5.4.450.0070.06719.48
5.4.440.0070.07719.30
5.4.430.0070.04719.30
5.4.420.0000.07019.33
5.4.410.0100.07019.04
5.4.400.0070.04018.98
5.4.390.0070.07719.15
5.4.380.0000.05019.24
5.4.370.0070.08018.88
5.4.360.0000.05019.08
5.4.350.0130.04318.86
5.4.340.0130.04019.08
5.4.320.0030.05319.24
5.4.310.0030.04019.25
5.4.300.0130.02718.92
5.4.290.0100.05018.92
5.4.280.0070.04319.23
5.4.270.0030.04019.20
5.4.260.0030.04319.24
5.4.250.0030.07318.86
5.4.240.0130.06719.23
5.4.230.0100.04319.11
5.4.220.0170.06719.23
5.4.210.0030.05318.91
5.4.200.0030.07719.00
5.4.190.0030.05319.23
5.4.180.0070.05718.95
5.4.170.0070.07019.07
5.4.160.0130.03719.10
5.4.150.0000.05719.29
5.4.140.0070.07016.32
5.4.130.0030.05016.31
5.4.120.0100.05316.41
5.4.110.0100.06316.54
5.4.100.0000.06716.33
5.4.90.0070.04316.46
5.4.80.0070.03716.45
5.4.70.0030.05316.41
5.4.60.0070.05716.47
5.4.50.0030.04716.38
5.4.40.0030.05016.64
5.4.30.0070.07016.27
5.4.20.0030.06716.46
5.4.10.0030.05316.25
5.4.00.0170.06015.80
5.3.290.0000.04014.56
5.3.280.0030.04014.62
5.3.270.0070.04714.61
5.3.260.0230.03014.77
5.3.250.0000.08314.52
5.3.240.0000.08014.64
5.3.230.0170.04314.76
5.3.220.0100.04714.58
5.3.210.0030.04314.72
5.3.200.0070.08014.62
5.3.190.0070.03714.58
5.3.180.0030.08314.57
5.3.170.0100.07314.60
5.3.160.0070.04314.62
5.3.150.0030.05014.57
5.3.140.0070.05014.71
5.3.130.0030.07714.55
5.3.120.0000.05314.57
5.3.110.0070.05714.44
5.3.100.0100.07714.07
5.3.90.0070.07314.08
5.3.80.0000.07714.07
5.3.70.0100.06314.03
5.3.60.0030.06714.05
5.3.50.0070.04713.99
5.3.40.0170.03713.95
5.3.30.0070.06014.06
5.3.20.0030.04013.62
5.3.10.0070.07013.68
5.3.00.0100.07013.64
5.2.170.0100.05711.21
5.2.160.0030.05311.05
5.2.150.0030.06311.13
5.2.140.0100.04311.09
5.2.130.0030.06011.17
5.2.120.0030.03011.12
5.2.110.0000.06010.99
5.2.100.0030.05011.27
5.2.90.0070.02711.18
5.2.80.0030.03710.99
5.2.70.0000.03311.13
5.2.60.0100.06010.95
5.2.50.0030.06711.07
5.2.40.0030.03310.96
5.2.30.0000.04011.14
5.2.20.0070.05011.02
5.2.10.0030.06710.92
5.2.00.0070.05010.92
5.1.60.0000.05710.92
5.1.50.0030.05010.92
5.1.40.0000.05710.92
5.1.30.0030.05710.92
5.1.20.0070.05310.92
5.1.10.0030.05010.92
5.1.00.0030.03710.92
5.0.50.0030.05010.92
5.0.40.0070.02710.92
5.0.30.0070.06010.92
5.0.20.0030.03010.92
5.0.10.0030.02010.92
5.0.00.0030.03710.92
4.4.90.0000.01710.92
4.4.80.0030.02010.92
4.4.70.0070.02310.92
4.4.60.0030.03310.92
4.4.50.0030.03010.92
4.4.40.0030.05310.92
4.4.30.0000.03710.92
4.4.20.0070.02710.92
4.4.10.0000.03010.92
4.4.00.0100.03310.92
4.3.110.0030.03310.92
4.3.100.0030.03310.92
4.3.90.0000.01710.92
4.3.80.0030.05310.92
4.3.70.0000.03010.92
4.3.60.0000.02710.92
4.3.50.0000.03310.92
4.3.40.0000.06010.92
4.3.30.0000.03710.92
4.3.20.0000.03710.92
4.3.10.0030.02310.92
4.3.00.0030.03010.92

preferences:
151.28 ms | 1394 KiB | 7 Q