3v4l.org

run code in 300+ PHP versions simultaneously
<?php mb_internal_encoding('UTF-8'); mb_http_output('UTF-8'); $someFoo = '{ "Foo" : "Bar" }'; $asciiData = iconv(mb_detect_encoding($someFoo), "ASCII", $someFoo); echo mb_detect_encoding($asciiData) . "\r\n"; var_dump(json_decode($asciiData)); $utf8Data = utf8_encode(iconv(mb_detect_encoding($someFoo), "UTF-8", $someFoo));echo mb_detect_encoding($utf8Data) . "\r\n"; var_dump(json_decode($utf8Data));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/CPtW7
function name:  (null)
number of ops:  51
compiled vars:  !0 = $someFoo, !1 = $asciiData, !2 = $utf8Data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   INIT_FCALL                                               'mb_internal_encoding'
          1        SEND_VAL                                                 'UTF-8'
          2        DO_ICALL                                                 
    3     3        INIT_FCALL                                               'mb_http_output'
          4        SEND_VAL                                                 'UTF-8'
          5        DO_ICALL                                                 
    6     6        ASSIGN                                                   !0, '%7B+%22Foo%22+%3A+%22Bar%22+%7D'
    8     7        INIT_FCALL_BY_NAME                                       'iconv'
          8        INIT_FCALL                                               'mb_detect_encoding'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $6      
         11        SEND_VAR_NO_REF_EX                                       $6
         12        SEND_VAL_EX                                              'ASCII'
         13        SEND_VAR_EX                                              !0
         14        DO_FCALL                                      0  $7      
         15        ASSIGN                                                   !1, $7
    9    16        INIT_FCALL                                               'mb_detect_encoding'
         17        SEND_VAR                                                 !1
         18        DO_ICALL                                         $9      
         19        CONCAT                                           ~10     $9, '%0D%0A'
         20        ECHO                                                     ~10
   10    21        INIT_FCALL                                               'var_dump'
         22        INIT_FCALL                                               'json_decode'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                         $11     
         25        SEND_VAR                                                 $11
         26        DO_ICALL                                                 
   12    27        INIT_FCALL_BY_NAME                                       '%C2%A0utf8_encode'
         28        INIT_FCALL_BY_NAME                                       'iconv'
         29        INIT_FCALL                                               'mb_detect_encoding'
         30        SEND_VAR                                                 !0
         31        DO_ICALL                                         $13     
         32        SEND_VAR_NO_REF_EX                                       $13
         33        SEND_VAL_EX                                              'UTF-8'
         34        SEND_VAR_EX                                              !0
         35        DO_FCALL                                      0  $14     
         36        SEND_VAR_NO_REF_EX                                       $14
         37        DO_FCALL                                      0  $15     
         38        ASSIGN                                                   !2, $15
         39        INIT_FCALL                                               'mb_detect_encoding'
         40        SEND_VAR                                                 !2
         41        DO_ICALL                                         $17     
         42        CONCAT                                           ~18     $17, '%0D%0A'
         43        ECHO                                                     ~18
   13    44        INIT_FCALL                                               'var_dump'
         45        INIT_FCALL                                               'json_decode'
         46        SEND_VAR                                                 !2
         47        DO_ICALL                                         $19     
         48        SEND_VAR                                                 $19
         49        DO_ICALL                                                 
         50      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.54 ms | 1400 KiB | 23 Q