3v4l.org

run code in 300+ PHP versions simultaneously
<?php // Everything you enter here will be executed by our servers. Try it! interface PaymentGatewayInterface { public function pay(array $bill); public function processNotification($notification); } class Payment { protected $gateway; public function __construct(PaymentGatewayInteface $gateway) { $this->gateway = $gateway; } public function pay(array $bill) { return $this->gateway->pay($bill); } public function processNotification($notification) { return $this->gateway->processNotification($notification); } } class Paypal implements PaymentGatewayInterface { public function pay(array $bill) { } public function processNotification($notification) { } } $a = new Payment(new Paypal);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IcQ6m
function name:  (null)
number of ops:  8
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   32     0  E >   DECLARE_CLASS                                            'paypal'
   44     1        NEW                                              $1      'Payment'
          2        NEW                                              $2      'Paypal'
          3        DO_FCALL                                      0          
          4        SEND_VAR_NO_REF_EX                                       $2
          5        DO_FCALL                                      0          
          6        ASSIGN                                                   !0, $1
          7      > RETURN                                                   1

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

End of function pay

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

End of function processnotification

End of class PaymentGatewayInterface.

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

End of function __construct

Function pay:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IcQ6m
function name:  pay
number of ops:  7
compiled vars:  !0 = $bill
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   RECV                                             !0      
   22     1        FETCH_OBJ_R                                      ~1      'gateway'
          2        INIT_METHOD_CALL                                         ~1, 'pay'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $2      
          5      > RETURN                                                   $2
   23     6*     > RETURN                                                   null

End of function pay

Function processnotification:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IcQ6m
function name:  processNotification
number of ops:  7
compiled vars:  !0 = $notification
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   RECV                                             !0      
   27     1        FETCH_OBJ_R                                      ~1      'gateway'
          2        INIT_METHOD_CALL                                         ~1, 'processNotification'
          3        SEND_VAR_EX                                              !0
          4        DO_FCALL                                      0  $2      
          5      > RETURN                                                   $2
   28     6*     > RETURN                                                   null

End of function processnotification

End of class Payment.

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

End of function pay

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

End of function processnotification

End of class Paypal.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.4 ms | 1399 KiB | 13 Q