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.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.7
�<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.33
�<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:
131.04 ms | 401 KiB | 122 Q