3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo implements JsonSerializable { private $abc; private $xyu; public function setAbc($abc) { $this->abc = $abc; } public function jsonSerialize() { return [$this->abc]; } } $foo = new Foo(); $foo->setAbc('qwerty'); echo json_serialize($foo);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QZQLa
function name:  (null)
number of ops:  12
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CLASS                                            'foo'
   21     1        NEW                                              $1      'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   22     4        INIT_METHOD_CALL                                         !0, 'setAbc'
          5        SEND_VAL_EX                                              'qwerty'
          6        DO_FCALL                                      0          
   23     7        INIT_FCALL_BY_NAME                                       'json_serialize'
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0  $5      
         10        ECHO                                                     $5
         11      > RETURN                                                   1

Class Foo:
Function setabc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QZQLa
function name:  setAbc
number of ops:  4
compiled vars:  !0 = $abc
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   RECV                                             !0      
   11     1        ASSIGN_OBJ                                               'abc'
          2        OP_DATA                                                  !0
   12     3      > RETURN                                                   null

End of function setabc

Function jsonserialize:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QZQLa
function name:  jsonSerialize
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   FETCH_OBJ_R                                      ~0      'abc'
          1        INIT_ARRAY                                       ~1      ~0
          2      > RETURN                                                   ~1
   17     3*     > RETURN                                                   null

End of function jsonserialize

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
143.46 ms | 1394 KiB | 13 Q