3v4l.org

run code in 300+ PHP versions simultaneously
<?php class B implements JsonSerializable { public function jsonSerialize() { return array( 'Recursion' => array( 'across' => array( 'multiple' => array('levels' => $this) ) ) ); } } var_dump(json_encode(new B(), JSON_PARTIAL_OUTPUT_ON_ERROR));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ldd3X
function name:  (null)
number of ops:  11
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   DECLARE_CLASS                                            'b'
   16     1        INIT_FCALL                                               'var_dump'
          2        INIT_FCALL                                               'json_encode'
          3        NEW                                              $0      'B'
          4        DO_FCALL                                      0          
          5        SEND_VAR                                                 $0
          6        SEND_VAL                                                 512
          7        DO_ICALL                                         $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                                 
         10      > RETURN                                                   1

Class B:
Function jsonserialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Ldd3X
function name:  jsonSerialize
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_THIS                                       ~0      
          1        INIT_ARRAY                                       ~1      ~0, 'levels'
          2        INIT_ARRAY                                       ~2      ~1, 'multiple'
          3        INIT_ARRAY                                       ~3      ~2, 'across'
          4        INIT_ARRAY                                       ~4      ~3, 'Recursion'
          5      > RETURN                                                   ~4
   12     6*     > RETURN                                                   null

End of function jsonserialize

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.15 ms | 1395 KiB | 17 Q