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() { $func = function($o) { return get_object_vars($o); }; return $func($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/3Af4o
function name:  (null)
number of ops:  12
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     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
   23     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 %00%7Bclosure%7D%2Fin%2F3Af4o%3A15%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Af4o
function name:  {closure}
number of ops:  6
compiled vars:  !0 = $o
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   RECV                                             !0      
   16     1        INIT_FCALL                                               'get_object_vars'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                         $1      
          4      > RETURN                                                   $1
   17     5*     > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F3Af4o%3A15%240

Class A:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3Af4o
function name:  __construct
number of ops:  10
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV                                             !2      
    7     3        ASSIGN_OBJ                                               'a'
          4        OP_DATA                                                  !0
    8     5        ASSIGN_OBJ                                               'b'
          6        OP_DATA                                                  !1
    9     7        ASSIGN_OBJ                                               'c'
          8        OP_DATA                                                  !2
   10     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/3Af4o
function name:  toArray
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   INIT_METHOD_CALL                                         'getVars'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   13     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/3Af4o
function name:  getVars
number of ops:  8
compiled vars:  !0 = $func
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3Af4o%3A15%240'
          1        ASSIGN                                                   !0, ~1
   18     2        INIT_DYNAMIC_CALL                                        !0
          3        FETCH_THIS                                       $3      
          4        SEND_VAR_EX                                              $3
          5        DO_FCALL                                      0  $4      
          6      > RETURN                                                   $4
   19     7*     > RETURN                                                   null

End of function getvars

End of class A.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.12 ms | 1400 KiB | 17 Q