3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a = (object) array(); $b = (object) array(); function object_handle($obj) { static $mask = 0, $offset; if (!$mask) { if (defined('HHVM_VERSION')) { $offset = 24; } else { $offset = 8; } $o = (object) array(); $mask = hexdec(substr(spl_object_hash($o), $offset, 8)); // check if we are nested in an output buffering handler to prevent a fatal error with ob_start() below foreach (debug_backtrace(PHP_VERSION_ID >= 50400 ? DEBUG_BACKTRACE_IGNORE_ARGS : false) as $frame) { if (isset($frame['function'][0]) && !isset($frame['class']) && 'o' === $frame['function'][0] && in_array($frame['function'], array('ob_clean', 'ob_end_clean', 'ob_flush', 'ob_end_flush', 'ob_get_contents', 'ob_get_flush')) ) { $frame['line'] = 0; break; } } if (!empty($frame['line'])) { ob_start(); debug_zval_dump($o); $mask ^= substr(ob_get_clean(), 17); } } return hexdec(substr(spl_object_hash($obj), $offset, 8)) ^ $mask; } //ob_start('abc'); //ob_end_flush(); $o = array(); echo object_handle($o[]=(object) array()), "\n"; echo object_handle($o[]=(object) array()), "\n"; echo object_handle($o[]=(object) array()), "\n"; echo object_handle($o[]=(object) array()), "\n"; echo object_handle($o[]=(object) array()), "\n"; echo object_handle($o[]=(object) array()), "\n"; echo object_handle($o[]=(object) array()), "\n"; echo object_handle($b), "\n"; echo object_handle($a), "\n"; function abc() { global $a; isset($a) or $a = (object) array(); return object_handle($a); } ob_start('abc');

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.0110.00418.56
8.3.50.0110.01021.21
8.3.40.0110.01118.79
8.3.30.0110.00419.11
8.3.20.0080.00020.25
8.3.10.0080.00020.65
8.3.00.0040.00417.63
8.2.180.0040.01116.63
8.2.170.0120.00322.96
8.2.160.0070.00720.39
8.2.150.0040.00424.18
8.2.140.0000.00824.66
8.2.130.0050.00326.16
8.2.120.0040.00421.12
8.2.110.0070.00320.54
8.2.100.0090.00318.22
8.2.90.0000.00819.25
8.2.80.0060.00317.97
8.2.70.0030.00617.59
8.2.60.0030.00517.93
8.2.50.0000.00818.07
8.2.40.0000.00818.34
8.2.30.0050.00318.14
8.2.20.0000.00817.93
8.2.10.0040.00418.21
8.2.00.0000.01017.94
8.1.280.0090.00625.92
8.1.270.0040.00423.84
8.1.260.0040.00426.35
8.1.250.0050.00328.09
8.1.240.0090.00023.96
8.1.230.0040.00719.14
8.1.220.0040.00417.74
8.1.210.0040.00418.77
8.1.200.0080.00317.47
8.1.190.0030.00617.48
8.1.180.0090.00018.10
8.1.170.0030.00518.74
8.1.160.0040.00421.98
8.1.150.0040.00418.95
8.1.140.0060.00317.51
8.1.130.0000.00717.80
8.1.120.0070.00017.46
8.1.110.0000.00817.41
8.1.100.0000.00717.54
8.1.90.0040.00417.57
8.1.80.0040.00417.48
8.1.70.0080.00017.45
8.1.60.0040.00417.70
8.1.50.0000.00717.51
8.1.40.0000.00817.48
8.1.30.0040.00417.58
8.1.20.0030.00517.61
8.1.10.0030.00517.57
8.1.00.0040.00417.54
8.0.300.0040.00418.77
8.0.290.0000.00816.88
8.0.280.0040.00418.52
8.0.270.0040.00417.20
8.0.260.0070.00017.21
8.0.250.0000.00717.14
8.0.240.0000.00816.99
8.0.230.0040.00416.96
8.0.220.0040.00416.96
8.0.210.0050.00316.95
8.0.200.0000.00716.95
8.0.190.0070.00316.98
8.0.180.0000.00716.86
8.0.170.0040.00417.05
8.0.160.0040.00417.04
8.0.150.0000.00816.97
8.0.140.0090.00316.79
8.0.130.0050.00013.44
8.0.120.0030.00516.86
8.0.110.0040.00417.08
8.0.100.0050.00216.84
8.0.90.0050.00217.04
8.0.80.0060.00917.04
8.0.70.0040.00416.99
8.0.60.0040.00417.03
8.0.50.0040.00416.97
8.0.30.0060.01517.25
8.0.20.0100.01017.42
8.0.10.0000.00716.99
8.0.00.0030.01517.02
7.4.330.0020.00215.09
7.4.320.0060.00016.47
7.4.300.0040.00416.55
7.4.290.0030.00316.55
7.4.280.0030.00616.69
7.4.270.0070.00016.68
7.4.260.0030.00516.57
7.4.250.0000.00716.45
7.4.240.0020.00516.64
7.4.230.0030.00516.58
7.4.220.0100.01016.77
7.4.210.0100.01016.72
7.4.200.0080.00016.59
7.4.160.0100.00716.56
7.4.150.0180.00617.40
7.4.140.0110.00717.86
7.4.130.0070.01216.55
7.4.120.0020.01416.68
7.4.110.0100.00716.63
7.4.100.0140.00416.64
7.4.90.0070.01016.67
7.4.80.0150.00619.39
7.4.70.0040.01416.69
7.4.60.0030.01216.57
7.4.50.0060.00316.25
7.4.40.0150.00316.58
7.4.30.0080.00816.42
7.4.00.0090.00914.97
7.3.330.0050.00013.29
7.3.320.0030.00313.43
7.3.310.0020.00516.46
7.3.300.0000.00716.34
7.3.290.0080.00816.46
7.3.280.0080.01216.44
7.3.270.0080.02017.40
7.3.260.0100.00716.63
7.3.250.0130.00416.39
7.3.240.0060.01216.60
7.3.230.0080.00916.64
7.3.210.0090.00916.56
7.3.200.0100.00919.39
7.3.190.0120.01016.55
7.3.180.0100.01016.50
7.3.170.0170.00016.45
7.3.160.0140.00516.70
7.3.120.0120.00614.97
7.3.110.0100.00714.94
7.3.100.0100.00614.61
7.3.90.0020.00915.02
7.3.80.0060.00314.89
7.3.70.0140.00014.80
7.3.60.0110.00015.00
7.3.50.0030.00614.57
7.3.40.0090.00614.96
7.3.30.0060.00615.02
7.3.20.0100.00316.80
7.3.10.0120.00816.77
7.3.00.0170.00716.50
7.2.330.0070.01016.59
7.2.320.0160.00316.82
7.2.310.0090.00916.81
7.2.300.0090.00916.49
7.2.290.0140.00816.79
7.2.250.0110.00715.00
7.2.240.0030.01315.29
7.2.230.0100.01015.07
7.2.220.0050.00515.10
7.2.210.0080.00415.33
7.2.200.0050.00515.25
7.2.190.0070.01015.15
7.2.180.0070.00715.11
7.2.170.0040.01115.03
7.2.130.0180.00616.71
7.2.120.0080.00616.80
7.2.110.0120.00916.60
7.2.100.0080.01016.54
7.2.90.0090.00916.93
7.2.80.0060.00916.91
7.2.70.0070.01116.65
7.2.60.0160.00616.78
7.2.50.0080.00816.69
7.2.40.0090.00916.80
7.2.30.0150.00816.64
7.2.20.0310.00716.61
7.2.10.0110.01016.65
7.2.00.0080.01016.93
7.1.330.0060.00616.01
7.1.320.0040.00715.75
7.1.310.0100.00315.98
7.1.300.0060.00615.67
7.1.290.0100.00315.91
7.1.280.0000.01015.99
7.1.270.0070.00715.84
7.1.260.0000.01515.61
7.1.250.0060.00815.58
7.1.200.0130.00015.96
7.1.100.0040.00817.77
7.1.70.0030.00717.18
7.1.60.0130.00919.32
7.1.50.0100.01317.00
7.1.00.0030.07722.45
7.0.200.0070.00716.92
7.0.140.0030.07321.96
7.0.60.0070.08320.08
7.0.50.0070.07017.98
7.0.40.0070.05320.21
7.0.30.0500.05020.06
7.0.20.0300.04720.33
7.0.10.0000.08320.07
7.0.00.0070.04320.05
5.6.280.0000.07721.01
5.6.210.0130.06020.63
5.6.200.0030.08318.29
5.6.190.0030.04320.68
5.6.180.0470.06720.48
5.6.170.0270.07720.71
5.6.160.0000.09020.60
5.6.150.0100.07318.18
5.6.140.0230.05718.17
5.6.130.0070.04318.16
5.6.120.0100.04020.91
5.6.110.0100.07721.16
5.6.100.0100.08021.02
5.6.90.0100.08321.00
5.6.80.0230.06720.50
5.5.350.0230.07720.46
5.5.340.0070.04318.05
5.5.330.0100.03720.27
5.5.320.0270.04020.31
5.5.310.0270.08020.42
5.5.300.0000.05017.97
5.5.290.0000.06018.04
5.5.280.0070.04720.79
5.5.270.0100.08020.98
5.5.260.0100.06320.89
5.5.250.0100.06020.60
5.5.240.0230.07320.17
5.4.450.0230.05319.50
5.4.440.0700.06019.57
5.4.430.0970.04719.67
5.4.420.0670.00019.46
5.4.410.0630.00019.35
5.4.400.0630.00019.22
5.4.390.0630.00019.07
5.4.380.0670.00019.09
5.4.370.0630.00019.01
5.4.360.0600.00019.13
5.4.350.0630.00019.07
5.4.340.0630.00019.05
5.4.320.0080.03612.52
5.4.310.0080.04012.52
5.4.300.0060.04612.53
5.4.290.0040.04512.52
5.4.280.0120.03312.42
5.4.270.0070.03612.42
5.4.260.0100.03412.42
5.4.250.0050.03812.41
5.4.240.0050.03712.42
5.4.230.0050.04012.41
5.4.220.0070.03612.41
5.4.210.0060.03712.41
5.4.200.0080.04012.41
5.4.190.0050.03712.41
5.4.180.0070.04412.41
5.4.170.0050.04012.41
5.4.160.0080.03712.41
5.4.150.0090.04412.41
5.4.140.0110.03512.09
5.4.130.0070.03612.08
5.4.120.0050.03612.04
5.4.110.0060.04612.03
5.4.100.0080.03612.04
5.4.90.0080.03612.03
5.4.80.0050.03712.03
5.4.70.0070.03312.03
5.4.60.0060.04112.03
5.4.50.0090.03712.03
5.4.40.0010.04512.02
5.4.30.0070.03512.02
5.4.20.0080.03312.01
5.4.10.0060.03712.02
5.4.00.0060.03611.51
5.3.290.0060.05212.80
5.3.280.0070.04012.71
5.3.270.0080.04912.73
5.3.260.0070.05212.73
5.3.250.0080.04112.73
5.3.240.0060.04012.73
5.3.230.0050.04412.73
5.3.220.0080.05212.70
5.3.210.0090.03712.70
5.3.200.0060.03712.69
5.3.190.0090.04812.70
5.3.180.0100.04012.70
5.3.170.0100.04012.69
5.3.160.0130.04612.69
5.3.150.0100.05312.69
5.3.140.0150.04412.68
5.3.130.0080.04412.67
5.3.120.0080.04012.68
5.3.110.0120.03812.68
5.3.100.0110.04412.16
5.3.90.0090.03412.14
5.3.80.0050.04612.13
5.3.70.0100.03412.14
5.3.60.0130.04312.12
5.3.50.0110.03412.07
5.3.40.0100.04112.06
5.3.30.0090.03812.02
5.3.20.0060.04011.80
5.3.10.0100.03711.77
5.3.00.0060.03811.76
5.2.170.0040.0349.26
5.2.160.0060.0289.26
5.2.150.0070.0359.26
5.2.140.0070.0339.25
5.2.130.0080.0459.21
5.2.120.0040.0429.22
5.2.110.0050.0309.22
5.2.100.0100.0349.21
5.2.90.0060.0399.22
5.2.80.0040.0319.21
5.2.70.0040.0319.21
5.2.60.0030.0339.18
5.2.50.0080.0369.14
5.2.40.0060.0359.12
5.2.30.0050.0309.09
5.2.20.0080.0289.07
5.2.10.0060.0278.97
5.2.00.0090.0328.84
5.1.60.0050.0298.12
5.1.50.0040.0338.12
5.1.40.0050.0288.10
5.1.30.0090.0268.45
5.1.20.0090.0258.47
5.1.10.0060.0238.20
5.1.00.0040.0278.20
5.0.50.0050.0216.68
5.0.40.0040.0196.54
5.0.30.0070.0346.35
5.0.20.0050.0186.32
5.0.10.0020.0226.29
5.0.00.0050.0366.29
4.4.90.0050.0154.78
4.4.80.0040.0154.75
4.4.70.0020.0174.76
4.4.60.0040.0174.75
4.4.50.0030.0194.77
4.4.40.0040.0254.71
4.4.30.0050.0144.76
4.4.20.0020.0224.84
4.4.10.0010.0174.85
4.4.00.0040.0284.76
4.3.110.0040.0174.67
4.3.100.0040.0154.67
4.3.90.0030.0154.63
4.3.80.0030.0254.58
4.3.70.0040.0134.63
4.3.60.0030.0154.62
4.3.50.0050.0154.63
4.3.40.0060.0274.53
4.3.30.0030.0193.34
4.3.20.0020.0183.32
4.3.10.0030.0153.27
4.3.00.0000.01316.50

preferences:
46.68 ms | 401 KiB | 5 Q