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/Mrtpt
function name:  (null)
number of ops:  26
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
    5     7        INIT_FCALL                                               'var_dump'
          8        INIT_FCALL                                               'json_encode'
          9        SEND_VAR                                                 !0
         10        DO_ICALL                                         $5      
         11        SEND_VAR                                                 $5
         12        DO_ICALL                                                 
   10    13        INIT_FCALL                                               'utf8_encode'
         14        FETCH_DIM_R                                      ~8      !0, 'hello'
         15        SEND_VAL                                                 ~8
         16        DO_ICALL                                         $9      
         17        ASSIGN_DIM                                               !0, 'hello'
         18        OP_DATA                                                  $9
   12    19        INIT_FCALL                                               'var_dump'
         20        INIT_FCALL                                               'json_encode'
         21        SEND_VAR                                                 !0
         22        DO_ICALL                                         $10     
         23        SEND_VAR                                                 $10
         24        DO_ICALL                                                 
         25      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.53 ms | 1395 KiB | 21 Q