3v4l.org

run code in 300+ PHP versions simultaneously
<?php class MyRealLogic { public function myAction() { return "Action!"; } } class MyRealAwesomeLogic extends MyRealLogic { public function myAction() { return "Awesome Action!"; } } class MyLogic { private $myLogic; public function getMyLogic() { if (null === $this->myLogic) $this->myLogic = new MyRealLogic(); return $this->myLogic; } public function setMyLogic($logic) { $this->myLogic = $logic; return $this; } } echo (new MyLogic()) ->setMyLogic(new MyRealAwesomeLogic()) ->getMyLogic() ->myAction(); // "Awesome Action!" ;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qmGMp
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E >   NEW                                              $0      'MyLogic'
          1        DO_FCALL                                      0          
   30     2        INIT_METHOD_CALL                                         $0, 'setMyLogic'
          3        NEW                                              $2      'MyRealAwesomeLogic'
          4        DO_FCALL                                      0          
          5        SEND_VAR_NO_REF_EX                                       $2
          6        DO_FCALL                                      0  $4      
   31     7        INIT_METHOD_CALL                                         $4, 'getMyLogic'
          8        DO_FCALL                                      0  $5      
   32     9        INIT_METHOD_CALL                                         $5, 'myAction'
         10        DO_FCALL                                      0  $6      
         11        ECHO                                                     $6
   33    12      > RETURN                                                   1

Class MyRealLogic:
Function myaction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qmGMp
function name:  myAction
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   'Action%21'
    6     1*     > RETURN                                                   null

End of function myaction

End of class MyRealLogic.

Class MyRealAwesomeLogic:
Function myaction:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qmGMp
function name:  myAction
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E > > RETURN                                                   'Awesome+Action%21'
   12     1*     > RETURN                                                   null

End of function myaction

End of class MyRealAwesomeLogic.

Class MyLogic:
Function getmylogic:
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
filename:       /in/qmGMp
function name:  getMyLogic
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   FETCH_OBJ_R                                      ~0      'myLogic'
          1        TYPE_CHECK                                    2          ~0
          2      > JMPZ                                                     ~1, ->7
          3    >   NEW                                              $3      'MyRealLogic'
          4        DO_FCALL                                      0          
          5        ASSIGN_OBJ                                               'myLogic'
          6        OP_DATA                                                  $3
   20     7    >   FETCH_OBJ_R                                      ~5      'myLogic'
          8      > RETURN                                                   ~5
   21     9*     > RETURN                                                   null

End of function getmylogic

Function setmylogic:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/qmGMp
function name:  setMyLogic
number of ops:  6
compiled vars:  !0 = $logic
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   RECV                                             !0      
   24     1        ASSIGN_OBJ                                               'myLogic'
          2        OP_DATA                                                  !0
   25     3        FETCH_THIS                                       ~2      
          4      > RETURN                                                   ~2
   26     5*     > RETURN                                                   null

End of function setmylogic

End of class MyLogic.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.3 ms | 1403 KiB | 13 Q