3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $a = (object) array();$b = (object) array();function object_handle($object){ static $mask = 0; if (!$mask) { $obj = (object) array(); $mask = hexdec(substr(spl_object_hash($obj), 0, 16)); 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'), true)) { $frame = false; break; } } if ($frame) { ob_start(); debug_zval_dump($obj); $mask ^= substr(ob_get_clean(), 17); } } return hexdec(substr(spl_object_hash($object), 0, 16)) ^ $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; return object_handle($a);}
based on c9BfP
Output for 5.3.0 - 5.6.28, 7.0.0 - 7.1.0
20 7 6 5 4 11 10 1 2
Output for hhvm-3.12.0
Fatal error: Uncaught Error: ob_start(): Cannot use output buffering in output buffering display handlers in /in/C8jcB:1 Stack trace: #0 /in/C8jcB(1): ob_start() #1 /in/C8jcB(1): object_handle() #2 /in/C8jcB(1): abc() #3 {main}
Process exited with code 255.
Output for hhvm-3.10.0
Fatal error: ob_start(): Cannot use output buffering in output buffering display handlers in /in/C8jcB on line 1
Process exited with code 255.
Output for 5.2.17
-9262556800433267120 646651124742252378 -8112493651621115128 1338268379664870685 6311218207571760801 -6126977096756796664 -4086055720612332792 7998300702265526661 -926255680043326712
Output for 5.2.15 - 5.2.16
472525002808340480 1369030309227628544 -4272520957214657777 -1207636683197674879 -7839804309830063558 1641146583512653824 -8097040516441803363 -1403856451194363531 47252500280834048
Output for 5.2.14
68799668057522265700 6315953780813613791 -7544889655350144418 6811204131711891808 1829221147837277834 -1129716611821956514 2891351330647574385 6304467373828594555 6879966805752226570
Output for 5.2.13
-87513780633101729240 -2938194988057590054 -4508403572908751451 -5826124337055422271 -1303113895808029973 5326583321841082368 538850606130513920 -560030245246270068 -8751378063310172924
Output for 5.2.12
-16368626521463255290 8321179991781576704 7169674841697026048 -4668264912101120012 -5717633775866899276 -7891626081783025417 -6788516005782734394 -86431807776459434 -1636862652146325529
Output for 5.2.9, 5.2.11
-80024014550919882080 4099526925510424576 -4205762090641188837 -8134068360507401621 -1333798797741021869 -8553509417770043403 -4396094316887938458 -5297998294899966773 -8002401455091988208
Output for 5.2.10
-46342106497787694180 4186664461334715341 -8952120348891907594 6353407931134863419 -1238896391284299274 -6088967371557778954 4902603096799176409 -7376654622809021962 -4634210649778769418
Output for 5.2.7 - 5.2.8
-25931675179482976860 6816473773669120945 60118815818230162 -2155032083981533654 -6121758465896139222 364708338464845289 -8825120142754884054 5950309269566349366 -2593167517948297686
Output for 5.2.6
-31007829092802896970 -8973761843691766689 -735313583858695073 -5615666042234760097 -7197519816959073185 -1271618248636056481 -2355973905722809249 -3702957449453599649 -3100782909280289697
Output for 5.2.5
54176187982573281280 4670471857457313792 5085718707131170816 -8135681385271556264 1482053150064947200 342286828346355712 -3585074254187332934 -6599677603428457849 5417618798257328128
Output for 5.2.4
-89693211890282729630 3987151376275992576 8463957760175159296 21546112098652160 1636006665782538240 4709581506521255936 -232682067582228293 7882366297991297024 -8969321189028272963
Output for 5.2.3
71126704851094712320 -3186625279786954649 -5784308647273914153 -7023542697447661396 -887045296204347525 -2212136614220044001 -1598976496509260049 -8372632711571524019 7112670485109471232
Output for 5.2.2
-11916200215117751400 -8958158233037149092 8416246647151260855 -5291561631125402532 1178510643502651163 6235941678896488877 8126595315197753433 7731521595134719186 -1191620021511775140
Output for 5.2.1
-77122483189990011090 7182752893935687680 1990618189945817088 1450203878242383872 -2158377744804008746 8721916604609867776 -6983654501208123502 265166992983263232 -7712248318999001109
Output for 5.2.0
26217819370772353750 -5036749041073935108 8796170226182150981 8362117748442424674 -5661860787688747780 -5945065033048779524 -2770497993196077828 6943519020815732015 2621781937077235375
Output for 4.3.2 - 5.1.6

Process exited with code 255.
Output for 4.3.0 - 4.3.1