3v4l.org

run code in 300+ PHP versions simultaneously
<?php function x($o) { return get_object_vars($o); } class A { public $a; public $b; private $c; public function __construct($a, $b, $c) { $this->a = $a; $this->b = $b; $this->c = $c; } public function toArray() { return $this->getVars(); } public function getVars() { return x($this); } } $o = new A(1,2,3); var_dump($o->toArray());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/31X1V
function name:  (null)
number of ops:  12
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'A'
          1        SEND_VAL_EX                                              1
          2        SEND_VAL_EX                                              2
          3        SEND_VAL_EX                                              3
          4        DO_FCALL                                      0          
          5        ASSIGN                                                   !0, $1
   22     6        INIT_FCALL                                               'var_dump'
          7        INIT_METHOD_CALL                                         !0, 'toArray'
          8        DO_FCALL                                      0  $4      
          9        SEND_VAR                                                 $4
         10        DO_ICALL                                                 
         11      > RETURN                                                   1

Function x:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/31X1V
function name:  x
number of ops:  6
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        INIT_FCALL                                               'get_object_vars'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
          5*     > RETURN                                                   null

End of function x

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/31X1V
function name:  __construct
number of ops:  10
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    9     3        ASSIGN_OBJ                                               'a'
          4        OP_DATA                                                  !0
   10     5        ASSIGN_OBJ                                               'b'
          6        OP_DATA                                                  !1
   11     7        ASSIGN_OBJ                                               'c'
          8        OP_DATA                                                  !2
   12     9      > RETURN                                                   null

End of function __construct

Function toarray:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/31X1V
function name:  toArray
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_METHOD_CALL                                         'getVars'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   15     3*     > RETURN                                                   null

End of function toarray

Function getvars:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/31X1V
function name:  getVars
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'x'
          1        FETCH_THIS                                       ~0      
          2        SEND_VAL                                                 ~0
          3        DO_FCALL                                      0  $1      
          4      > RETURN                                                   $1
   18     5*     > RETURN                                                   null

End of function getvars

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.93 ms | 1403 KiB | 18 Q