3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $st = chr(84).chr(66).chr(78).chr(80).chr(36).chr(0).chr(0).chr(0).chr(0).chr(0).chr(0).chr(0); echo(st); function rpc_int_unserialize(&$str, $size = 4) { $res = 0; for ($i = $size - 1; $i >= 0; $i--) { echo($str{$i}); echo("\n"); echo("i"); echo("\n"); $res = ($res * 256) + ord($str{$i}); }; $str = substr($str, $size); return $res; } $head = "qwerty"; echo(rpc_int_unserialize($head)); echo(rpc_int_unserialize($head)); echo($head); ?>
based on X216P
Output for 7.2.0
Warning: Use of undefined constant st - assumed 'st' (this will throw an Error in a future version of PHP) in /in/Ochh4 on line 3 str i e i w i q i 1919252337 Notice: Uninitialized string offset: 3 in /in/Ochh4 on line 9 i Notice: Uninitialized string offset: 3 in /in/Ochh4 on line 13 Notice: Uninitialized string offset: 2 in /in/Ochh4 on line 9 i Notice: Uninitialized string offset: 2 in /in/Ochh4 on line 13 y i t i 31092
Output for 5.3.18 - 7.1.10
Notice: Use of undefined constant st - assumed 'st' in /in/Ochh4 on line 3 str i e i w i q i 1919252337 Notice: Uninitialized string offset: 3 in /in/Ochh4 on line 9 i Notice: Uninitialized string offset: 3 in /in/Ochh4 on line 13 Notice: Uninitialized string offset: 2 in /in/Ochh4 on line 9 i Notice: Uninitialized string offset: 2 in /in/Ochh4 on line 13 y i t i 31092