3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php $o = ""; $escape_char = $allowed_chars = array_fill_keys(range('a','z'), "a"); $string = "hzgtfrzutrdetzttedcuztivcretfuzrtzt"; for ($i = 0; $i < strlen($string); $i++) { $ch = $string[$i]; if (isset($allowed_chars[ord($ch)])) { $o.=$allowed_chars[ord($ch)]; } else if (ord($ch) == 27) { $i++; $ch = $string[$i]; if (isset($escape_char[ord($ch)])) { $o.=$escape_char[ord($ch)]; } } } echo $o;
Output for 5.2.0 - 5.6.28, hhvm-3.10.0 - 3.13.2, 7.0.0 - 7.1.0
Output for 5.0.0 - 5.1.6
Fatal error: Call to undefined function array_fill_keys() in /in/MqNMJ on line 4
Process exited with code 255.
Output for 4.4.5 - 4.4.9
Fatal error: Call to undefined function: array_fill_keys() in /in/MqNMJ on line 4
Process exited with code 255.
Output for 4.3.2 - 4.4.4
Fatal error: Call to undefined function: array_fill_keys() in /in/MqNMJ on line 4
Process exited with code 255.
Output for 4.3.0 - 4.3.1
Fatal error: Call to undefined function: array_fill_keys() in /in/MqNMJ on line 4