3v4l.org

run code in 300+ PHP versions simultaneously
<?php function rpc_int_unserialize(&$str, $size = 4) { $res = 0; for ($i = $size - 1; $i >= 0; $i--) { $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); ?>
Output for 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
Fatal error: Array and string offset access syntax with curly braces is no longer supported in /in/qZHqk on line 8
Process exited with code 255.
Output for 7.4.0 - 7.4.33
Deprecated: Array and string offset access syntax with curly braces is deprecated in /in/qZHqk on line 8 1919252337 Notice: Uninitialized string offset: 3 in /in/qZHqk on line 8 Notice: Uninitialized string offset: 2 in /in/qZHqk on line 8 31092
Output for 7.3.32 - 7.3.33
191925233731092
Output for 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 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.31
1919252337 Notice: Uninitialized string offset: 3 in /in/qZHqk on line 8 Notice: Uninitialized string offset: 2 in /in/qZHqk on line 8 31092

preferences:
276.67 ms | 403 KiB | 376 Q