3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php function strToHex($string) { $hex=''; for ($i=0; $i < strlen($string); $i++) { $hex .= dechex(ord($string[$i])); } return $hex; } echo strToHex('moron123'); echo dec2hex('moron123');
based on iPjXj
Output for 7.0.0 - 7.1.0
6d6f726f6e313233 Fatal error: Uncaught Error: Call to undefined function dec2hex() in /in/hi1qD:13 Stack trace: #0 {main} thrown in /in/hi1qD on line 13
Process exited with code 255.
Output for 5.0.0 - 5.6.28, hhvm-3.12.0
6d6f726f6e313233 Fatal error: Call to undefined function dec2hex() in /in/hi1qD on line 13
Process exited with code 255.
Output for hhvm-3.10.0

Process exited with code 153.
Output for 4.4.5 - 4.4.9
6d6f726f6e313233 Fatal error: Call to undefined function: dec2hex() in /in/hi1qD on line 13
Process exited with code 255.
Output for 4.3.2 - 4.4.4
6d6f726f6e313233 Fatal error: Call to undefined function: dec2hex() in /in/hi1qD on line 13
Process exited with code 255.
Output for 4.3.0 - 4.3.1
6d6f726f6e313233 Fatal error: Call to undefined function: dec2hex() in /in/hi1qD on line 13