3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php // Tell PHP that we're using UTF-8 strings until the end of the script mb_internal_encoding('UTF-8'); // Tell PHP that we'll be outputting UTF-8 to the browser mb_http_output('UTF-8'); // Our UTF-8 test string $string = 'Êl síla erin lû e-govaned vîn.'; $decoded_stuff = utf8_encode("Müller"); echo $decoded_stuff"; $string2 = utf8_encode($string); echo "$string2"; echo "$string"; ?><!doctype html> <html> <head> <meta charset="UTF-8" /> <title>UTF-8 test page</title> </head> <body> <?php foreach($result as $row){ print($row->Body); // This should correctly output our transformed UTF-8 string to the browser } ?> </body> </html>
based on TTthk
Output for 4.4.2 - 4.4.9, 5.1.0 - 5.4.35
Parse error: syntax error, unexpected '"', expecting ',' or ';' in /in/ZipPF on line 13
Process exited with code 255.
Output for 4.3.0 - 4.3.1, 4.3.5 - 4.4.1, 5.0.0 - 5.0.5
Parse error: parse error, unexpected '\"', expecting ',' or ';' in /in/ZipPF on line 13
Process exited with code 255.
Output for 4.3.2 - 4.3.4
Parse error: parse error, expecting `','' or `';'' in /in/ZipPF on line 13
Process exited with code 255.