3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Aggregation { protected function callAggregation($method, $arguments) { var_dump($method, $arguments); } protected function foo() { } } class AggregateWithUse { use Aggregation { Aggregation::foo as public; Aggregation::callAggregation as __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/cFTqs
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'
   19     1        DECLARE_CLASS                                            'aggregatemanually'
   27     2        NEW                                              $0      'AggregateWithUse'
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $0, 'test'
          5        SEND_VAL_EX                                              42
          6        DO_FCALL                                      0          
   28     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/cFTqs
function name:  callAggregation
number of ops:  7
compiled vars:  !0 = $method, !1 = $arguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
          1        RECV                                             !1      
    5     2        INIT_FCALL                                               'var_dump'
          3        SEND_VAR                                                 !0
          4        SEND_VAR                                                 !1
          5        DO_ICALL                                                 
    6     6      > 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/cFTqs
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/cFTqs
function name:  __call
number of ops:  7
compiled vars:  !0 = $method, !1 = $arguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   23     2        INIT_METHOD_CALL                                         'callAggregation'
          3        SEND_VAR_EX                                              !0
          4        SEND_VAR_EX                                              !1
          5        DO_FCALL                                      0          
   24     6      > RETURN                                                   null

End of function __call

End of class AggregateManually.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
146.94 ms | 1396 KiB | 15 Q