3v4l.org

run code in 300+ PHP versions simultaneously
<?php class C implements JsonSerializable { var $a = 'lol'; var $b = 'fa'; public function jsonSerialize() { $aux = clone($this); unset($aux->a); return $aux; } } echo json_encode(new C());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TSgMV
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   DECLARE_CLASS                                            'c'
   13     1        INIT_FCALL                                               'json_encode'
          2        NEW                                              $0      'C'
          3        DO_FCALL                                      0          
          4        SEND_VAR                                                 $0
          5        DO_ICALL                                         $2      
          6        ECHO                                                     $2
          7      > RETURN                                                   1

Class C:
Function jsonserialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/TSgMV
function name:  jsonSerialize
number of ops:  6
compiled vars:  !0 = $aux
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_THIS                                       ~1      
          1        CLONE                                            ~2      ~1
          2        ASSIGN                                                   !0, ~2
    9     3        UNSET_OBJ                                                !0, 'a'
   10     4      > RETURN                                                   !0
   11     5*     > RETURN                                                   null

End of function jsonserialize

End of class C.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.57 ms | 1394 KiB | 15 Q