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($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/aYsLj
function name:  (null)
number of ops:  43
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        SEND_VAR_EX                                              !0
         29        DO_FCALL                                      0  $13     
         30        ASSIGN                                                   !2, $13
   14    31        INIT_FCALL                                               'mb_detect_encoding'
         32        SEND_VAR                                                 !2
         33        DO_ICALL                                         $15     
         34        CONCAT                                           ~16     $15, '%0D%0A'
         35        ECHO                                                     ~16
   15    36        INIT_FCALL                                               'var_dump'
         37        INIT_FCALL                                               'json_decode'
         38        SEND_VAR                                                 !2
         39        DO_ICALL                                         $17     
         40        SEND_VAR                                                 $17
         41        DO_ICALL                                                 
         42      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
161.61 ms | 1396 KiB | 26 Q