3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A implements JsonSerializable { public function jsonSerialize() { return new A; } } echo "AAA\n"; var_dump( json_encode( new A ) ); echo "BBB\n";
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AtfmY
function name:  (null)
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'a'
    9     1        ECHO                                                     'AAA%0A'
   10     2        INIT_FCALL                                               'var_dump'
          3        INIT_FCALL                                               'json_encode'
          4        NEW                                              $0      'A'
          5        DO_FCALL                                      0          
          6        SEND_VAR                                                 $0
          7        DO_ICALL                                         $2      
          8        SEND_VAR                                                 $2
          9        DO_ICALL                                                 
   11    10        ECHO                                                     'BBB%0A'
         11      > RETURN                                                   1

Class A:
Function jsonserialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/AtfmY
function name:  jsonSerialize
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   NEW                                              $0      'A'
          1        DO_FCALL                                      0          
          2      > RETURN                                                   $0
    6     3*     > RETURN                                                   null

End of function jsonserialize

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.71 ms | 1399 KiB | 17 Q