3v4l.org

run code in 300+ PHP versions simultaneously
<?php $word = 'base64_decode'; echo 'bin2hex: ' . PHP_EOL; echo implode(array_map(function($char) { return '\x' . bin2hex($char); }, str_split($word))) . PHP_EOL . PHP_EOL; echo 'unpack: ' . PHP_EOL; echo implode(array_map(function($char) { return '\x' . implode(unpack('H*', $char)); }, str_split($word))) . PHP_EOL . PHP_EOL; echo 'sprintf: ' . PHP_EOL; echo implode(array_map(function($char) { return sprintf('\x%02X', ord($char)); }, (array) str_split($word)));
Output for git.master, git.master_jit, rfc.property-hooks
bin2hex: \x62\x61\x73\x65\x36\x34\x5f\x64\x65\x63\x6f\x64\x65 unpack: \x62\x61\x73\x65\x36\x34\x5f\x64\x65\x63\x6f\x64\x65 sprintf: \x62\x61\x73\x65\x36\x34\x5F\x64\x65\x63\x6F\x64\x65

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:
189 ms | 406 KiB | 5 Q