3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Aggregation { protected function callAggregation($method, $arguments, $problem = FALSE) { var_dump($method, $arguments); // var_dump($method, $arguments, $problem); } protected function foo() { } } class AggregateWithUse { use Aggregation { Aggregation::callAggregation as public __call; } } class AggregateManually { use Aggregation; public function __call($method, $arguments) { $aguments = 'foo'; $this->callAggregation($method, $arguments); } } (new AggregateWithUse())->onTest(function() {}); (new AggregateManually())->onTest(function() {});
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jqsDo
function name:  (null)
number of ops:  15
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   DECLARE_CLASS                                            'aggregatewithuse'
   19     1        DECLARE_CLASS                                            'aggregatemanually'
   28     2        NEW                                              $0      'AggregateWithUse'
          3        DO_FCALL                                      0          
          4        INIT_METHOD_CALL                                         $0, 'onTest'
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FjqsDo%3A28%242'
          6        SEND_VAL_EX                                              ~2
          7        DO_FCALL                                      0          
   29     8        NEW                                              $4      'AggregateManually'
          9        DO_FCALL                                      0          
         10        INIT_METHOD_CALL                                         $4, 'onTest'
         11        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FjqsDo%3A29%243'
         12        SEND_VAL_EX                                              ~6
         13        DO_FCALL                                      0          
         14      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2FjqsDo%3A28%242:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jqsDo
function name:  {closure}
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FjqsDo%3A28%242

Function %00%7Bclosure%7D%2Fin%2FjqsDo%3A29%243:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jqsDo
function name:  {closure}
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   29     0  E > > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2FjqsDo%3A29%243

Class Aggregation:
Function callaggregation:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/jqsDo
function name:  callAggregation
number of ops:  8
compiled vars:  !0 = $method, !1 = $arguments, !2 = $problem
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        DO_ICALL                                                 
    7     7      > 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/jqsDo
function name:  foo
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     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/jqsDo
function name:  __call
number of ops:  8
compiled vars:  !0 = $method, !1 = $arguments, !2 = $aguments
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   22     0  E >   RECV                                             !0      
          1        RECV                                             !1      
   23     2        ASSIGN                                                   !2, 'foo'
   24     3        INIT_METHOD_CALL                                         'callAggregation'
          4        SEND_VAR_EX                                              !0
          5        SEND_VAR_EX                                              !1
          6        DO_FCALL                                      0          
   25     7      > RETURN                                                   null

End of function __call

End of class AggregateManually.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
154.22 ms | 1400 KiB | 15 Q