3v4l.org

run code in 300+ PHP versions simultaneously
<?php $a1 = new stdclass; $a2 = new stdclass; $a3 = new stdclass; $a4 = new stdclass; $a5 = new stdclass; $a6 = new stdclass; $a7 = new stdclass; $a8 = new stdclass; $a9 = new stdclass; function bla($o){ return substr(spl_object_hash($o), 0, 16); } for($i = 1; $i < 10; $i++){ $var = ${'a' . $i}; var_dump($var); $r = hex2bin(bla($var)) ^ hex2bin(bla($a1)); $i = (int)bin2hex($r); $i += ($i % 2) === 0 ? 1 : -1; echo $i . "\n"; echo "-------------------\n"; }
Output for 5.6.0 - 5.6.40, 7.0.0 - 7.0.33, 7.1.0 - 7.1.33, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.0 - 8.3.27, 8.4.1 - 8.4.14
object(stdClass)#1 (0) { } 1 ------------------- object(stdClass)#2 (0) { } 2 ------------------- object(stdClass)#3 (0) { } 3 ------------------- object(stdClass)#4 (0) { } 4 ------------------- object(stdClass)#5 (0) { } 5 ------------------- object(stdClass)#6 (0) { } 6 ------------------- object(stdClass)#7 (0) { } 7 ------------------- object(stdClass)#8 (0) { } 8 ------------------- object(stdClass)#9 (0) { } 9 -------------------

preferences:
130.4 ms | 409 KiB | 5 Q