<?php
function encode($to_encode){ return hexdec(bin2hex($to_encode)); }
function decode($numberstr){ return hex2bin(dechex($numberstr)); }
$str="the quick brown fox jumps over the lazy dog こどものじかん";
var_dump($str,encode($str),decode(encode($str)));
Fatal error: Uncaught TypeError: dechex(): Argument #1 ($num) must be of type int, float given in /in/nl8hA:3
Stack trace:
#0 /in/nl8hA(3): dechex(1.5607733310506E+156)
#1 /in/nl8hA(5): decode(1.5607733310506E+156)
#2 {main}
thrown in /in/nl8hA on line 3
Process exited with code 255.
Warning: hex2bin(): Hexadecimal input string must have an even length in /in/nl8hA on line 3
string(65) "the quick brown fox jumps over the lazy dog こどものじかん"
float(1.5607733310506E+156)
bool(false)
Output for 5.4.0 - 5.4.3
string(65) "the quick brown fox jumps over the lazy dog こどものじかん"
float(1.5607733310506E+156)
string(0) ""