3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.46 ms | 1396 KiB | 23 Q