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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.32 ms | 1396 KiB | 21 Q