3v4l.org

run code in 300+ PHP versions simultaneously
<?php $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/U8kcu
function name:  (null)
number of ops:  34
compiled vars:  !0 = $someFoo, !1 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, '%7B+%22Foo%22+%3A+%22Bar%22+%7D'
    4     1        INIT_FCALL                                               'mb_convert_encoding'
          2        SEND_VAR                                                 !0
          3        SEND_VAL                                                 'ASCII'
          4        DO_ICALL                                         $3      
          5        ASSIGN                                                   !0, $3
    5     6        INIT_FCALL                                               'mb_detect_encoding'
          7        SEND_VAR                                                 !0
          8        DO_ICALL                                         $5      
          9        CONCAT                                           ~6      $5, '%0D%0A'
         10        ECHO                                                     ~6
    6    11        INIT_FCALL                                               'var_dump'
         12        INIT_FCALL                                               'json_decode'
         13        SEND_VAR                                                 !0
         14        DO_ICALL                                         $7      
         15        SEND_VAR                                                 $7
         16        DO_ICALL                                                 
    8    17        INIT_FCALL                                               'mb_convert_encoding'
         18        SEND_VAR                                                 !0
         19        SEND_VAL                                                 'UTF-8'
         20        DO_ICALL                                         $9      
         21        ASSIGN                                                   !1, $9
    9    22        INIT_FCALL                                               'mb_detect_encoding'
         23        SEND_VAR                                                 !1
         24        DO_ICALL                                         $11     
         25        CONCAT                                           ~12     $11, '%0D%0A'
         26        ECHO                                                     ~12
   10    27        INIT_FCALL                                               'var_dump'
         28        INIT_FCALL                                               'json_decode'
         29        SEND_VAR                                                 !1
         30        DO_ICALL                                         $13     
         31        SEND_VAR                                                 $13
         32        DO_ICALL                                                 
         33      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.71 ms | 1401 KiB | 21 Q