3v4l.org

run code in 300+ PHP versions simultaneously
<?php $badValue = array( 'key1' => array( 'irrelevant' => array('nothere'), 'key2' => array( 'goodString' => 'OK', 'badString' => "\xc3\x28foo" ) ) ); $enc = json_encode($badValue); print_r(array('enc' => $enc, 'json_last_error' => json_last_error())); echo "\nafter";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JO6eY
function name:  (null)
number of ops:  14
compiled vars:  !0 = $badValue, !1 = $enc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   ASSIGN                                                   !0, <array>
   12     1        INIT_FCALL                                               'json_encode'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $3      
          4        ASSIGN                                                   !1, $3
   13     5        INIT_FCALL                                               'print_r'
          6        INIT_ARRAY                                       ~5      !1, 'enc'
          7        INIT_FCALL                                               'json_last_error'
          8        DO_ICALL                                         $6      
          9        ADD_ARRAY_ELEMENT                                ~5      $6, 'json_last_error'
         10        SEND_VAL                                                 ~5
         11        DO_ICALL                                                 
   15    12        ECHO                                                     '%0Aafter'
         13      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.33 ms | 1394 KiB | 19 Q