3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Profile { private $active = false; public function activate() { $this->active = true; } public function isActive() { return $this->active; } } interface Event { function execute($object); } class ProfileWasActivated implements Event { public function execute($profile) { $profile->activate(); } } $profile = new Profile(); $event = new ProfileWasActivated(); var_dump($profile->isActive()); $event->execute($profile); var_dump($profile->isActive());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dh0pp
function name:  (null)
number of ops:  21
compiled vars:  !0 = $profile, !1 = $event
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   19     0  E >   DECLARE_CLASS                                            'profilewasactivated'
   25     1        NEW                                              $2      'Profile'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   26     4        NEW                                              $5      'ProfileWasActivated'
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !1, $5
   27     7        INIT_FCALL                                               'var_dump'
          8        INIT_METHOD_CALL                                         !0, 'isActive'
          9        DO_FCALL                                      0  $8      
         10        SEND_VAR                                                 $8
         11        DO_ICALL                                                 
   28    12        INIT_METHOD_CALL                                         !1, 'execute'
         13        SEND_VAR_EX                                              !0
         14        DO_FCALL                                      0          
   29    15        INIT_FCALL                                               'var_dump'
         16        INIT_METHOD_CALL                                         !0, 'isActive'
         17        DO_FCALL                                      0  $11     
         18        SEND_VAR                                                 $11
         19        DO_ICALL                                                 
         20      > RETURN                                                   1

Class Profile:
Function activate:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dh0pp
function name:  activate
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN_OBJ                                               'active'
          1        OP_DATA                                                  <true>
    8     2      > RETURN                                                   null

End of function activate

Function isactive:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dh0pp
function name:  isActive
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   FETCH_OBJ_R                                      ~0      'active'
          1      > RETURN                                                   ~0
   12     2*     > RETURN                                                   null

End of function isactive

End of class Profile.

Class Event:
Function execute:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dh0pp
function name:  execute
number of ops:  2
compiled vars:  !0 = $object
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
          1      > RETURN                                                   null

End of function execute

End of class Event.

Class ProfileWasActivated:
Function execute:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dh0pp
function name:  execute
number of ops:  4
compiled vars:  !0 = $profile
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   21     1        INIT_METHOD_CALL                                         !0, 'activate'
          2        DO_FCALL                                      0          
   22     3      > RETURN                                                   null

End of function execute

End of class ProfileWasActivated.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.68 ms | 1400 KiB | 15 Q