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>';
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/MXMmo
function name:  (null)
number of ops:  25
compiled vars:  !0 = $lang, !1 = $codeset
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   ASSIGN                                                   !0, 'en'
    5     1        ASSIGN                                                   !1, 'UTF8'
    9     2        INIT_FCALL                                               'putenv'
          3        CONCAT                                           ~4      'LANG%3D', !0
          4        CONCAT                                           ~5      ~4, '.'
          5        CONCAT                                           ~6      ~5, !1
          6        SEND_VAL                                                 ~6
          7        DO_ICALL                                                 
   10     8        INIT_FCALL                                               'putenv'
          9        CONCAT                                           ~8      'LANGUAGE%3D', !0
         10        CONCAT                                           ~9      ~8, '.'
         11        CONCAT                                           ~10     ~9, !1
         12        SEND_VAL                                                 ~10
         13        DO_ICALL                                                 
   15    14        INIT_FCALL                                               'setlocale'
         15        SEND_VAL                                                 6
         16        CONCAT                                           ~12     !0, '.'
         17        CONCAT                                           ~13     ~12, !1
         18        SEND_VAL                                                 ~13
         19        DO_ICALL                                                 
   22    20        CAST                                          5  ~15     3.14
         21        CONCAT                                           ~16     '%3Cscript%3E%0A++++var+pi+%3D+', ~15
         22        CONCAT                                           ~17     ~16, '%3B%0A++++alert%28%22pi%3A+%22+%2B+pi%29%0A%3C%2Fscript%3E'
         23        ECHO                                                     ~17
   24    24      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
142.32 ms | 1395 KiB | 17 Q