3v4l.org

run code in 300+ PHP versions simultaneously
<?php $body = '£¥$@"\'.,;:_-=+*#%&<>?!¿¡§¤()ÄÖÑÜÉÅßÇÆΦΓΔΛΩΣΠΨΘØΞñüäòøàæåèéöùì{}[]|~^€'; $characters = array( 'Δ'=>'0xD0', 'Φ'=>'0xDE', 'Γ'=>'0xAC', 'Λ'=>'0xC2', 'Ω'=>'0xDB', 'Π'=>'0xBA', 'Ψ'=>'0xDD', 'Σ'=>'0xCA', 'Θ'=>'0xD4', 'Ξ'=>'0xB1', '¡'=>'0xA1', '£'=>'0xA3', '¤'=>'0xA4', '¥'=>'0xA5', '§'=>'0xA7', '¿'=>'0xBF', 'Ä'=>'0xC4', 'Å'=>'0xC5', 'Æ'=>'0xC6', 'Ç'=>'0xC7', 'É'=>'0xC9', 'Ñ'=>'0xD1', 'Ö'=>'0xD6', 'Ø'=>'0xD8', 'Ü'=>'0xDC', 'ß'=>'0xDF', 'à'=>'0xE0', 'ä'=>'0xE4', 'å'=>'0xE5', 'æ'=>'0xE6', 'è'=>'0xE8', 'é'=>'0xE9', 'ì'=>'0xEC', 'ñ'=>'0xF1', 'ò'=>'0xF2', 'ö'=>'0xF6', 'ø'=>'0xF8', 'ù'=>'0xF9', 'ü'=>'0xFC', ); $message = ''; if(mb_detect_encoding($body, 'UTF-8') != 'UTF-8') { $body = utf8_encode($body); } for ($i = 0; $i < mb_strlen($body, 'UTF-8'); $i++) { $c = mb_substr($body, $i, 1, 'UTF-8'); if (isset($characters[$c])) { $message .= chr(hex2dec($characters[$c])); } else { $message .= $c; } } echo $message;
Output for 7.0.0 - 7.0.20, 7.1.0 - 7.1.20, 7.2.0 - 7.2.33, 7.3.16 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.30, 8.2.0 - 8.2.24, 8.3.0 - 8.3.12
Fatal error: Uncaught Error: Call to undefined function hex2dec() in /in/pehtj:24 Stack trace: #0 {main} thrown in /in/pehtj on line 24
Process exited with code 255.
Output for 5.6.0 - 5.6.25
Fatal error: Call to undefined function hex2dec() in /in/pehtj on line 24
Process exited with code 255.

preferences:
81.53 ms | 407 KiB | 5 Q