3v4l.org

run code in 300+ PHP versions simultaneously
<?php mb_internal_encoding('UTF-8'); $someFoo = '{ "Foo" : "Bar" }'; $someFoo = mb_convert_encoding($someFoo, 'ASCII'); echo mb_detect_encoding($someFoo) . "\r\n"; var_dump(json_decode($someFoo)); $data= mb_convert_encoding($someFoo, 'UTF-8'); echo mb_detect_encoding($data) . "\r\n"; var_dump(json_decode($data));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/ik4Jc
function name:  (null)
number of ops:  37
compiled vars:  !0 = $someFoo, !1 = $data
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                                                 
    4     3        ASSIGN                                                   !0, '%7B+%22Foo%22+%3A+%22Bar%22+%7D'
    6     4        INIT_FCALL                                               'mb_convert_encoding'
          5        SEND_VAR                                                 !0
          6        SEND_VAL                                                 'ASCII'
          7        DO_ICALL                                         $4      
          8        ASSIGN                                                   !0, $4
    7     9        INIT_FCALL                                               'mb_detect_encoding'
         10        SEND_VAR                                                 !0
         11        DO_ICALL                                         $6      
         12        CONCAT                                           ~7      $6, '%0D%0A'
         13        ECHO                                                     ~7
    8    14        INIT_FCALL                                               'var_dump'
         15        INIT_FCALL                                               'json_decode'
         16        SEND_VAR                                                 !0
         17        DO_ICALL                                         $8      
         18        SEND_VAR                                                 $8
         19        DO_ICALL                                                 
   10    20        INIT_FCALL                                               'mb_convert_encoding'
         21        SEND_VAR                                                 !0
         22        SEND_VAL                                                 'UTF-8'
         23        DO_ICALL                                         $10     
         24        ASSIGN                                                   !1, $10
   11    25        INIT_FCALL                                               'mb_detect_encoding'
         26        SEND_VAR                                                 !1
         27        DO_ICALL                                         $12     
         28        CONCAT                                           ~13     $12, '%0D%0A'
         29        ECHO                                                     ~13
   12    30        INIT_FCALL                                               'var_dump'
         31        INIT_FCALL                                               'json_decode'
         32        SEND_VAR                                                 !1
         33        DO_ICALL                                         $14     
         34        SEND_VAR                                                 $14
         35        DO_ICALL                                                 
         36      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
186.25 ms | 1396 KiB | 23 Q