3v4l.org

run code in 300+ PHP versions simultaneously
<?php class myclass{ public function one(){ return 'sth'; } public function two(){ function myfunc($arg, $that){ if ($arg){ return $that->one(); } else { return 'nothing'; } } return myfunc(TRUE, $this); } } $obj = new myclass; echo $obj->two();
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mQFpk
function name:  (null)
number of ops:  7
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'myclass'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     3        INIT_METHOD_CALL                                         !0, 'two'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
          6      > RETURN                                                   1

Function %00myfunc%2Fin%2FmQFpk%3A10%240:
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/mQFpk
function name:  myfunc
number of ops:  9
compiled vars:  !0 = $arg, !1 = $that
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   11     2      > JMPZ                                                     !0, ->7
   12     3    >   INIT_METHOD_CALL                                         !1, 'one'
          4        DO_FCALL                                      0  $2      
          5      > RETURN                                                   $2
          6*       JMP                                                      ->8
   14     7    > > RETURN                                                   'nothing'
   17     8*     > RETURN                                                   null

End of function %00myfunc%2Fin%2FmQFpk%3A10%240

Class myclass:
Function one:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mQFpk
function name:  one
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   'sth'
    7     1*     > RETURN                                                   null

End of function one

Function two:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/mQFpk
function name:  two
number of ops:  8
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   DECLARE_FUNCTION                                         'myfunc'
   18     1        INIT_FCALL_BY_NAME                                       'myfunc'
          2        SEND_VAL_EX                                              <true>
          3        FETCH_THIS                                       $0      
          4        SEND_VAR_EX                                              $0
          5        DO_FCALL                                      0  $1      
          6      > RETURN                                                   $1
   19     7*     > RETURN                                                   null

End of function two

End of class myclass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
145.23 ms | 1395 KiB | 13 Q