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', 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/NEanY
function name:  (null)
number of ops:  41
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        INIT_FCALL                                               'mb_detect_encoding'
         24        SEND_VAR                                                 !0
         25        DO_ICALL                                         $10     
         26        SEND_VAR                                                 $10
         27        DO_ICALL                                         $11     
         28        ASSIGN                                                   !1, $11
   11    29        INIT_FCALL                                               'mb_detect_encoding'
         30        SEND_VAR                                                 !1
         31        DO_ICALL                                         $13     
         32        CONCAT                                           ~14     $13, '%0D%0A'
         33        ECHO                                                     ~14
   12    34        INIT_FCALL                                               'var_dump'
         35        INIT_FCALL                                               'json_decode'
         36        SEND_VAR                                                 !1
         37        DO_ICALL                                         $15     
         38        SEND_VAR                                                 $15
         39        DO_ICALL                                                 
         40      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.16 ms | 1396 KiB | 23 Q