3v4l.org

run code in 300+ PHP versions simultaneously
<?php class SendGrid { public static function send() { echo "Using SG send method"; } } class ZendGrid { public static function send() { echo "Using ZG send method"; } } class Emailer { public function setSendMethod($method) { $this->send = $method; } } $emailer = new Emailer(); $emailer->setSendMethod(ZendGrid::send); $emailer->send;
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BZ7J9
function name:  (null)
number of ops:  10
compiled vars:  !0 = $emailer
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   NEW                                              $1      'Emailer'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   23     3        INIT_METHOD_CALL                                         !0, 'setSendMethod'
          4        FETCH_CLASS_CONSTANT                             ~4      'ZendGrid', 'send'
          5        SEND_VAL_EX                                              ~4
          6        DO_FCALL                                      0          
   25     7        FETCH_OBJ_R                                      ~6      !0, 'send'
          8        FREE                                                     ~6
          9      > RETURN                                                   1

Class SendGrid:
Function send:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BZ7J9
function name:  send
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   ECHO                                                     'Using+SG+send+method'
    6     1      > RETURN                                                   null

End of function send

End of class SendGrid.

Class ZendGrid:
Function send:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BZ7J9
function name:  send
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   ECHO                                                     'Using+ZG+send+method'
   12     1      > RETURN                                                   null

End of function send

End of class ZendGrid.

Class Emailer:
Function setsendmethod:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/BZ7J9
function name:  setSendMethod
number of ops:  4
compiled vars:  !0 = $method
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   RECV                                             !0      
   18     1        ASSIGN_OBJ                                               'send'
          2        OP_DATA                                                  !0
   19     3      > RETURN                                                   null

End of function setsendmethod

End of class Emailer.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.82 ms | 1395 KiB | 13 Q