3v4l.org

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

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


Dynamic Functions:
Dynamic Function 0
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 2, Position 2 = 9
Branch analysis from position: 2
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 9
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/sl4eq
function name:  myfunc
number of ops:  11
compiled vars:  !0 = $arg, !1 = $newobj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV                                             !0      
   11     1      > JMPZ                                                     !0, ->9
   12     2    >   NEW                                              $2      'myclass'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !1, $2
   13     5        INIT_METHOD_CALL                                         !1, 'one'
          6        DO_FCALL                                      0  $5      
          7      > RETURN                                                   $5
   11     8*       JMP                                                      ->10
   15     9    > > RETURN                                                   'nothing'
   18    10*     > RETURN                                                   null

End of Dynamic Function 0

End of function two

End of class myclass.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.88 ms | 1008 KiB | 13 Q