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)) { // 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)
7.3.50.0060.00614.72
7.3.40.0090.01314.49
7.3.30.0090.01314.49
7.3.20.0060.00616.29
7.3.10.0240.00016.59
7.3.00.0120.00916.53
7.2.180.0000.01414.70
7.2.170.0030.01714.63
7.2.160.0110.01214.67
7.2.150.0170.00316.66
7.2.140.0080.00516.68
7.2.130.0120.00916.75
7.2.120.0180.00916.79
7.2.110.0120.00316.55
7.2.100.0130.00916.66
7.2.90.0140.00716.60
7.2.80.0190.00316.88
7.2.70.0100.00716.66
7.2.60.0040.01116.43
7.2.50.0090.00416.74
7.2.40.0030.01016.78
7.2.30.0040.01316.68
7.2.20.0090.00316.80
7.2.10.0120.00416.45
7.2.00.0080.00416.58
7.1.280.0070.00715.22
7.1.270.0110.00315.63
7.1.260.0060.00915.51
7.1.250.0000.01515.70
7.1.240.0070.00715.57
7.1.230.0120.00315.29
7.1.220.0060.00615.25
7.1.210.0080.00315.53
7.1.200.0070.01315.43
7.1.190.0070.00715.41
7.1.180.0000.01315.35
7.1.170.0080.00315.49
7.1.160.0120.01115.19
7.1.150.0090.01215.40
7.1.140.0170.00915.52
7.1.130.0080.00415.54
7.1.120.0080.00415.27
7.1.110.0070.00715.17
7.1.100.0040.00715.44
7.1.90.0060.01515.45
7.1.80.0050.00515.66
7.1.70.0100.01115.45
7.1.60.0080.00415.56
7.1.50.0090.00615.72
7.1.40.0140.00615.41
7.1.30.0100.00315.48
7.1.20.0090.00915.59
7.1.10.0100.00015.61
7.1.00.0140.00615.50
7.0.330.0070.00515.02
7.0.320.0000.01014.91
7.0.310.0060.01515.02
7.0.300.0040.00715.35
7.0.290.0030.01115.11
7.0.280.0050.00815.12
7.0.270.0100.01015.09
7.0.260.0110.00315.17
7.0.250.0030.01015.30
7.0.240.0040.00715.28
7.0.230.0100.01015.21
7.0.220.0050.00515.02
7.0.210.0030.01715.48
7.0.200.0060.00615.23
7.0.190.0050.00515.22
7.0.180.0100.00315.12
7.0.170.0140.00615.21
7.0.160.0030.00915.29
7.0.150.0040.01615.33
7.0.140.0170.00415.23
7.0.130.0100.03118.74
7.0.120.0160.03518.64
7.0.110.0100.03018.65
7.0.100.0060.03618.64
7.0.90.0020.03518.61
7.0.80.0040.03318.70
7.0.70.0050.03018.71
7.0.60.0070.03319.68
7.0.50.0090.04518.38
7.0.40.0090.04319.17
7.0.30.0150.03619.16
7.0.20.0110.05019.18
7.0.10.0080.04919.17
7.0.00.0070.05019.10
5.6.400.0130.01014.27
5.6.390.0110.01114.26
5.6.380.0060.01014.49
5.6.370.0070.02114.05
5.6.360.0130.00914.36
5.6.350.0000.02114.20
5.6.340.0050.00814.00
5.6.330.0100.01014.43
5.6.320.0070.01414.22
5.6.310.0030.01114.66
5.6.300.0000.01414.11
5.6.290.0000.01314.52
5.6.280.0090.02817.59
5.6.270.0110.03217.58
5.6.260.0150.02817.67
5.6.250.0090.03417.67
5.6.240.0060.03617.71
5.6.230.0140.03217.58
5.6.220.0070.02817.67
5.6.210.0080.04818.60
5.6.200.0100.04817.81
5.6.190.0050.04218.51
5.6.180.0090.03918.66
5.6.170.0150.04018.59
5.6.160.0070.03818.52
5.6.150.0080.03817.88
5.6.140.0100.05017.71
5.6.130.0120.04917.84
5.6.120.0070.03418.80
5.6.110.0070.04918.59
5.6.100.0100.04218.74
5.6.90.0080.04618.76
5.6.80.0080.04218.44
5.6.70.0090.02517.14
5.6.60.0040.03017.22
5.6.50.0100.03517.26
5.6.40.0070.03717.27
5.6.30.0150.03817.14
5.6.20.0060.03417.23
5.6.10.0030.03217.16
5.6.00.0080.03117.29
5.5.380.0070.03316.04
5.5.370.0100.02915.80
5.5.360.0100.03115.70
5.5.350.0210.04117.44
5.5.340.0080.05416.76
5.5.330.0060.04617.51
5.5.320.0250.04417.50
5.5.310.0170.04317.42
5.5.300.0140.03116.77
5.5.290.0080.05116.65
5.5.280.0070.03417.63
5.5.270.0110.03217.91
5.5.260.0120.04317.75
5.5.250.0070.05017.64
5.5.240.0060.04517.29
5.5.230.0030.03715.85
5.5.220.0110.03115.62
5.5.210.0100.03215.75
5.5.200.0090.03115.86
5.5.190.0130.03715.85
5.5.180.0140.02715.58
5.5.170.0070.00914.47
5.5.160.0070.03215.74
5.5.150.0110.03315.64
5.5.140.0070.03415.78
5.5.130.0110.03115.78
5.5.120.0140.02715.87
5.5.110.0170.02915.72
5.5.100.0120.03415.73
5.5.90.0080.03715.79
5.5.80.0100.03315.69
5.5.70.0110.03315.88
5.5.60.0110.03115.97
5.5.50.0110.02915.81
5.5.40.0090.03515.50
5.5.30.0070.03215.87
5.5.20.0060.03415.70
5.5.10.0080.03315.85
5.5.00.0090.03015.96

preferences:
170.77 ms | 1394 KiB | 7 Q