3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $text = 'Hello world'; $result = str_split($text); $result = array_map('ord', $result); $result = array_map('dechex', $result); var_dump("0x" . implode('', $result)); var_dump(unpack('H*', $text));
based on aGoiZ
Output for 5.0.0 - 5.0.2, 5.0.5 - 5.1.1, 5.1.3 - 7.1.0
string(24) "0x48656c6c6f20776f726c64" array(1) { [1]=> string(22) "48656c6c6f20776f726c64" }
Output for 5.1.2
string(24) "0x48656c6c6f20776f726c64" array(1) { [1]=> string(23) "48656c6c6f20776f726c640" }
Output for 5.0.3 - 5.0.4
string(24) "0x48656c6c6f20776f726c64" Warning: unpack(): Type H: outside of string in /in/pMorY on line 8 array(1) { [1]=> string(22) "48656c6c6f20776f726c64" }
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: str_split() in /in/pMorY on line 3
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: str_split() in /in/pMorY on line 3
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: str_split() in /in/pMorY on line 3