3v4l.org

run code in 300+ PHP versions simultaneously
<?php class one{ public function index($called_from = null){ if ( $called_from != 'myfunc') { return $this->myfunc(__FUNCTION__); } echo 'parent'; } public function myfunc($called_from){ return $this->index(__FUNCTION__); } } class two extends one{ function index($called_from = null){ if ( $called_from != 'myfunc') { return $this->myfunc(__FUNCTION__); } echo 'child'; } } $obj = new one; $obj->index();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BYvgQ
function name:  (null)
number of ops:  6
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   NEW                                              $1      'one'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   30     3        INIT_METHOD_CALL                                         !0, 'index'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Class one:
Function index:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BYvgQ
function name:  index
number of ops:  9
compiled vars:  !0 = $called_from
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      null
    6     1        IS_NOT_EQUAL                                             !0, 'myfunc'
          2      > JMPZ                                                     ~1, ->7
    7     3    >   INIT_METHOD_CALL                                         'myfunc'
          4        SEND_VAL_EX                                              'index'
          5        DO_FCALL                                      0  $2      
          6      > RETURN                                                   $2
    9     7    >   ECHO                                                     'parent'
   11     8      > RETURN                                                   null

End of function index

Function myfunc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BYvgQ
function name:  myfunc
number of ops:  6
compiled vars:  !0 = $called_from
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        INIT_METHOD_CALL                                         'index'
          2        SEND_VAL_EX                                              'myfunc'
          3        DO_FCALL                                      0  $1      
          4      > RETURN                                                   $1
   15     5*     > RETURN                                                   null

End of function myfunc

End of class one.

Class two:
Function index:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 3, Position 2 = 7
Branch analysis from position: 3
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 7
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BYvgQ
function name:  index
number of ops:  9
compiled vars:  !0 = $called_from
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV_INIT                                        !0      null
   21     1        IS_NOT_EQUAL                                             !0, 'myfunc'
          2      > JMPZ                                                     ~1, ->7
   22     3    >   INIT_METHOD_CALL                                         'myfunc'
          4        SEND_VAL_EX                                              'index'
          5        DO_FCALL                                      0  $2      
          6      > RETURN                                                   $2
   24     7    >   ECHO                                                     'child'
   26     8      > RETURN                                                   null

End of function index

Function myfunc:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BYvgQ
function name:  myfunc
number of ops:  6
compiled vars:  !0 = $called_from
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   RECV                                             !0      
   14     1        INIT_METHOD_CALL                                         'index'
          2        SEND_VAL_EX                                              'myfunc'
          3        DO_FCALL                                      0  $1      
          4      > RETURN                                                   $1
   15     5*     > RETURN                                                   null

End of function myfunc

End of class two.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
165.67 ms | 1399 KiB | 13 Q