3v4l.org

run code in 300+ PHP versions simultaneously
<?php function readUnsignedVarLong(string $buffer, int &$offset) : int{ $value = 0; for($i = 0; $i <= 63; $i += 7){ if(!isset($buffer[$offset])){ throw new Exception("No bytes left in buffer"); } $b = ord($buffer[$offset++]); $value |= (($b & 0x7f) << $i); if(($b & 0x80) === 0){ return $value; } } throw new Exception("VarLong did not terminate after 10 bytes!"); } var_dump(readUnsignedVarLong(str_repeat("\255", 10)));
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught ArgumentCountError: Too few arguments to function readUnsignedVarLong(), 1 passed in /in/TG3E6 on line 19 and exactly 2 expected in /in/TG3E6:3 Stack trace: #0 /in/TG3E6(19): readUnsignedVarLong('\xAD\xAD\xAD\xAD\xAD\xAD\xAD\xAD\xAD\xAD') #1 {main} thrown in /in/TG3E6 on line 3
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
31.55 ms | 401 KiB | 8 Q