3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php function dec2hex($number) { $number = strval($number); $hexvalues = array( '0','1','2','3','4','5','6','7', '8','9','A','B','C','D','E','F' ); $hexval = ''; while($number != '0') { $hexval = $hexvalues[bcmod($number, '16')] . $hexval; $number = bcdiv($number, '16', 0); } return $hexval; } $id = '14910855968770314426'; var_dump($id); $guid = dec2hex($id); var_dump($guid); $guid = wordwrap($guid, 4, '-'); var_dump($guid);
Output for 4.3.0 - 7.2.6, 7.3.0rc3 - 7.3.0rc4
string(20) "14910855968770314426" string(16) "CEEE0080A39150BA" string(16) "CEEE0080A39150BA"
Output for 7.3.0alpha1 - 7.3.0beta1
string(20) "14910855968770314426" Fatal error: Uncaught Error: Call to undefined function bcmod() in /in/AXjAH:14 Stack trace: #0 /in/AXjAH(23): dec2hex('149108559687703...') #1 {main} thrown in /in/AXjAH on line 14
Process exited with code 255.