3v4l.org

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

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
158.33 ms | 1396 KiB | 25 Q