3v4l.org

run code in 300+ PHP versions simultaneously
<?php $str = array('hello' => 'json' . pack("H*" ,'c32e') ); // var_dump(json_encode($str)); // $str['test'] = htmlentities( (string) $str['test'], ENT_QUOTES, 'utf-8', FALSE); // $str['hello'] = iconv('UTF-8', 'UTF-8//IGNORE', $str['hello']); $str['hello'] = utf8_encode( $str['hello'] ); var_dump(json_encode($str));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/OjkAe
function name:  (null)
number of ops:  20
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   INIT_FCALL                                               'pack'
          1        SEND_VAL                                                 'H%2A'
          2        SEND_VAL                                                 'c32e'
          3        DO_ICALL                                         $1      
          4        CONCAT                                           ~2      'json', $1
          5        INIT_ARRAY                                       ~3      ~2, 'hello'
          6        ASSIGN                                                   !0, ~3
   10     7        INIT_FCALL                                               'utf8_encode'
          8        FETCH_DIM_R                                      ~6      !0, 'hello'
          9        SEND_VAL                                                 ~6
         10        DO_ICALL                                         $7      
         11        ASSIGN_DIM                                               !0, 'hello'
         12        OP_DATA                                                  $7
   12    13        INIT_FCALL                                               'var_dump'
         14        INIT_FCALL                                               'json_encode'
         15        SEND_VAR                                                 !0
         16        DO_ICALL                                         $8      
         17        SEND_VAR                                                 $8
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.61 ms | 1394 KiB | 21 Q