3v4l.org

run code in 300+ PHP versions simultaneously
<?php 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 array_filter((array)$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/HQ1dc
function name:  (null)
number of ops:  12
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     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
   21     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

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HQ1dc
function name:  __construct
number of ops:  10
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    8     3        ASSIGN_OBJ                                               'a'
          4        OP_DATA                                                  !0
    9     5        ASSIGN_OBJ                                               'b'
          6        OP_DATA                                                  !1
   10     7        ASSIGN_OBJ                                               'c'
          8        OP_DATA                                                  !2
   11     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/HQ1dc
function name:  toArray
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_METHOD_CALL                                         'getVars'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   14     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/HQ1dc
function name:  getVars
number of ops:  7
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'array_filter'
          1        FETCH_THIS                                       ~0      
          2        CAST                                          7  ~1      ~0
          3        SEND_VAL                                                 ~1
          4        DO_ICALL                                         $2      
          5      > RETURN                                                   $2
   17     6*     > RETURN                                                   null

End of function getvars

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
159.63 ms | 1400 KiB | 17 Q