3v4l.org

run code in 300+ PHP versions simultaneously
<?php $text="ála"; for($d=0;$d<strlen($text);$d++) { echo $text[$d] . "<br>"; } $char = 'á'; var_dump(chr($char));
Output for 8.0.1 - 8.0.19, 8.1.0 - 8.1.6
�<br>�<br>l<br>a<br> Fatal error: Uncaught TypeError: chr(): Argument #1 ($codepoint) must be of type int, string given in /in/fmNah:13 Stack trace: #0 /in/fmNah(13): chr('\xC3\xA1') #1 {main} thrown in /in/fmNah on line 13
Process exited with code 255.
Output for 7.4.0 - 7.4.29
�<br>�<br>l<br>a<br> Warning: chr() expects parameter 1 to be int, string given in /in/fmNah on line 13 string(1) ""

preferences:
19.3 ms | 410 KiB | 5 Q