3v4l.org

run code in 300+ PHP versions simultaneously
<?php declare(strict_types=1); $bytes32 = [144, 204, 205, 119, 77, 176, 172, 140, 110, 162, 222, 255, 14, 38, 252, 82, 118, 138, 130, 124, 145, 199, 55, 162, 224, 80, 102, 141, 140, 57, 194, 36]; $string32 = \pack('C*', ...$bytes32); $string32Utf8 = \mb_convert_encoding($string32, 'ASCII', 'UTF-8'); $bytes70 = [239, 191, 189, 239, 191, 189, 239, 191, 189, 119, 77, 239, 191, 189, 239, 191, 189, 239, 191, 189, 110, 239, 191, 189, 239, 191, 189, 239, 191, 189, 14, 38, 239, 191, 189, 82, 118, 239, 191, 189, 239, 191, 189, 124, 239, 191, 189, 239, 191, 189, 55, 239, 191, 189, 239, 191, 189, 80, 102, 239, 191, 189, 239, 191, 189, 57, 239, 191, 189, 36]; $string70 = \pack('C*', ...$bytes70); $string70Utf8 = \mb_convert_encoding($string70, 'ASCII', 'UTF-8'); \var_dump($string32Utf8, $string70Utf8, $string32Utf8 === $string70Utf8);
Output for 7.2.0 - 7.2.34, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.6 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.4, 8.3.6
string(32) "???wM???n???&?Rv??|??7??Pf??9?$" string(32) "???wM???n???&?Rv??|??7??Pf??9?$" bool(true)
Output for 8.3.5
Warning: PHP Startup: Unable to load dynamic library 'sodium.so' (tried: /usr/lib/php/8.3.5/modules/sodium.so (libsodium.so.23: cannot open shared object file: No such file or directory), /usr/lib/php/8.3.5/modules/sodium.so.so (/usr/lib/php/8.3.5/modules/sodium.so.so: cannot open shared object file: No such file or directory)) in Unknown on line 0 string(32) "???wM???n???&?Rv??|??7??Pf??9?$" string(32) "???wM???n???&?Rv??|??7??Pf??9?$" bool(true)
Output for 8.1.0 - 8.1.5
string(31) "???wM???n??&?Rv??|??7??Pf??9?$" string(32) "???wM???n???&?Rv??|??7??Pf??9?$" bool(false)

preferences:
150.89 ms | 401 KiB | 191 Q