3v4l.org

run code in 150+ php & hhvm versions
Bugs & Features
<?php // http://www.php.net/manual/en/language.types.string.php#language.types.string.casting - note $lang = "tr"; $codeset = "UTF8"; // warning ! not UTF-8 with dash '-' // for windows compatibility (e.g. xampp) : theses 3 lines are useless for linux systems putenv('LANG='.$lang.'.'.$codeset); putenv('LANGUAGE='.$lang.'.'.$codeset); //bind_textdomain_codeset('mydomain', $codeset); // set locale //bindtextdomain('mydomain', ABSPATH.'/locale/'); setlocale(LC_ALL, $lang.'.'.$codeset); //textdomain('mydomain'); //setlocale(LC_ALL, null); echo '<script> var pi = ' . (float)3.14 . '; alert("pi: " + pi) </script>';
Output for 4.3.0 - 7.1.0
<script> var pi = 3.14; alert("pi: " + pi) </script>