3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Outer { private $prop = 1; protected $prop2 = 2; protected function func1() { return 3; } public function func2() { return new class($this->prop) extends Outer { private $prop3; public function __construct($prop) { $this->prop3 = $prop; } public function func3() { return $this->prop2 + $this->prop3 + $this->func1(); } }; } } echo (new Outer)->func2()->func3();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mMHR7
function name:  (null)
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   NEW                                              $0      'Outer'
          1        DO_FCALL                                      0          
          2        INIT_METHOD_CALL                                         $0, 'func2'
          3        DO_FCALL                                      0  $2      
          4        INIT_METHOD_CALL                                         $2, 'func3'
          5        DO_FCALL                                      0  $3      
          6        ECHO                                                     $3
          7      > RETURN                                                   1

Class Outer@anonymous:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mMHR7
function name:  __construct
number of ops:  4
compiled vars:  !0 = $prop
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   20     1        ASSIGN_OBJ                                               'prop3'
          2        OP_DATA                                                  !0
   21     3      > RETURN                                                   null

End of function __construct

Function func3:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mMHR7
function name:  func3
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   FETCH_OBJ_R                                      ~0      'prop2'
          1        FETCH_OBJ_R                                      ~1      'prop3'
          2        ADD                                              ~2      ~0, ~1
          3        INIT_METHOD_CALL                                         'func1'
          4        DO_FCALL                                      0  $3      
          5        ADD                                              ~4      ~2, $3
          6      > RETURN                                                   ~4
   26     7*     > RETURN                                                   null

End of function func3

End of class Outer@anonymous.

Class Outer:
Function func1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mMHR7
function name:  func1
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E > > RETURN                                                   3
   11     1*     > RETURN                                                   null

End of function func1

Function func2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mMHR7
function name:  func2
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   DECLARE_ANON_CLASS                               <unknown> 'outer'
          1        NEW                                              $1      $0
          2        CHECK_FUNC_ARG                                           
          3        FETCH_OBJ_FUNC_ARG                               $2      'prop'
          4        SEND_FUNC_ARG                                            $2
          5        DO_FCALL                                      0          
          6      > RETURN                                                   $1
   28     7*     > RETURN                                                   null

End of function func2

End of class Outer.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.39 ms | 1399 KiB | 13 Q