3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Aggregation { protected function callAggregation($method, $arguments, $triggger = FALSE) { var_dump($method, $arguments, $trigger); } protected function foo() { } } class AggregateWithUse { use Aggregation { Aggregation::callAggregation as public __call; } } class AggregateManually { use Aggregation; public function __call($method, $arguments) { $this->callAggregation($method, $arguments); } } (new AggregateWithUse())->test(42); (new AggregateManually())->test(42);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EZ2uZ
function name:  (null)
number of ops:  13
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   DECLARE_CLASS                                            'aggregatewithuse'
   18     1        DECLARE_CLASS                                            'aggregatemanually'
   26     2        NEW                                              $0      'AggregateWithUse'
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $0, 'test'
          5        SEND_VAL_EX                                              42
          6        DO_FCALL                                      0          
   27     7        NEW                                              $3      'AggregateManually'
          8        DO_FCALL                                      0          
          9        INIT_METHOD_CALL                                         $3, 'test'
         10        SEND_VAL_EX                                              42
         11        DO_FCALL                                      0          
         12      > RETURN                                                   1

Class Aggregation:
Function callaggregation:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EZ2uZ
function name:  callAggregation
number of ops:  9
compiled vars:  !0 = $method, !1 = $arguments, !2 = $triggger, !3 = $trigger
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
          2        RECV_INIT                                        !2      <false>
    5     3        INIT_FCALL                                               'var_dump'
          4        SEND_VAR                                                 !0
          5        SEND_VAR                                                 !1
          6        SEND_VAR                                                 !3
          7        DO_ICALL                                                 
    6     8      > RETURN                                                   null

End of function callaggregation

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EZ2uZ
function name:  foo
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E > > RETURN                                                   null

End of function foo

End of class Aggregation.

Class AggregateWithUse: [no user functions]
Class AggregateManually:
Function __call:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/EZ2uZ
function name:  __call
number of ops:  7
compiled vars:  !0 = $method, !1 = $arguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   22     2        INIT_METHOD_CALL                                         'callAggregation'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
   23     6      > RETURN                                                   null

End of function __call

End of class AggregateManually.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.54 ms | 1400 KiB | 15 Q