3v4l.org

run code in 300+ PHP versions simultaneously
<?php // http://www.php.net/manual/en/language.types.string.php#language.types.string.casting - note $lang = "en"; $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 - 4.3.11, 4.4.0 - 4.4.9, 5.0.0 - 5.0.5, 5.1.0 - 5.1.6, 5.2.0 - 5.2.17, 5.3.0 - 5.3.29, 5.4.0 - 5.4.45, 5.5.0 - 5.5.38, 5.6.0 - 5.6.28, 7.0.0 - 7.0.20, 7.1.0 - 7.1.25, 7.2.0 - 7.2.33, 7.3.0 - 7.3.33, 7.4.0 - 7.4.33, 8.0.0 - 8.0.30, 8.1.0 - 8.1.28, 8.2.0 - 8.2.18, 8.3.0 - 8.3.6
<script> var pi = 3.14; alert("pi: " + pi) </script>

preferences:
251.12 ms | 405 KiB | 371 Q