3v4l.org

run code in 300+ PHP versions simultaneously
<?php class foo { private $data; private $relations; public function __construct() { $this->data = ['foo' => 'test', 'body' => 'content']; } public function test() { $function = debug_backtrace()[1]['function']; $this->relations[$function] = ['a' =>'aa', 'b' =>'bb']; return $this; } } class bar extends foo{ public function aa(){ return $this->test(); } } $bar = new bar(); $bar->aa(); print_r($bar);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/esJm1
function name:  (null)
number of ops:  9
compiled vars:  !0 = $bar
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   NEW                                              $1      'bar'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   38     3        INIT_METHOD_CALL                                         !0, 'aa'
          4        DO_FCALL                                      0          
   40     5        INIT_FCALL                                               'print_r'
          6        SEND_VAR                                                 !0
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class foo:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/esJm1
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN_OBJ                                               'data'
          1        OP_DATA                                                  <array>
   12     2      > RETURN                                                   null

End of function __construct

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/esJm1
function name:  test
number of ops:  11
compiled vars:  !0 = $function
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'debug_backtrace'
          1        DO_ICALL                                         $1      
          2        FETCH_DIM_R                                      ~2      $1, 1
          3        FETCH_DIM_R                                      ~3      ~2, 'function'
          4        ASSIGN                                                   !0, ~3
   18     5        FETCH_OBJ_W                                      $5      'relations'
          6        ASSIGN_DIM                                               $5, !0
          7        OP_DATA                                                  <array>
   20     8        FETCH_THIS                                       ~7      
          9      > RETURN                                                   ~7
   21    10*     > RETURN                                                   null

End of function test

End of class foo.

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

End of function aa

Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/esJm1
function name:  __construct
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ASSIGN_OBJ                                               'data'
          1        OP_DATA                                                  <array>
   12     2      > RETURN                                                   null

End of function __construct

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/esJm1
function name:  test
number of ops:  11
compiled vars:  !0 = $function
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_FCALL                                               'debug_backtrace'
          1        DO_ICALL                                         $1      
          2        FETCH_DIM_R                                      ~2      $1, 1
          3        FETCH_DIM_R                                      ~3      ~2, 'function'
          4        ASSIGN                                                   !0, ~3
   18     5        FETCH_OBJ_W                                      $5      'relations'
          6        ASSIGN_DIM                                               $5, !0
          7        OP_DATA                                                  <array>
   20     8        FETCH_THIS                                       ~7      
          9      > RETURN                                                   ~7
   21    10*     > RETURN                                                   null

End of function test

End of class bar.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.9 ms | 1400 KiB | 17 Q