3v4l.org

run code in 300+ PHP versions simultaneously
<?php trait Aggregation { protected function callAggregation($method, $arguments, $problem = FALSE) { 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) { $this->callAggregation($method, $arguments); } } (new AggregateWithUse())->onTest(function() {}, array()); (new AggregateManually())->onTest(function() {});
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/urkKV
function name:  (null)
number of ops:  16
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, 'onTest'
          5        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FurkKV%3A26%242'
          6        SEND_VAL_EX                                              ~2
          7        SEND_VAL_EX                                              <array>
          8        DO_FCALL                                      0          
   27     9        NEW                                              $4      'AggregateManually'
         10        DO_FCALL                                      0          
         11        INIT_METHOD_CALL                                         $4, 'onTest'
         12        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2FurkKV%3A27%243'
         13        SEND_VAL_EX                                              ~6
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2FurkKV%3A26%242

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

End of function %00%7Bclosure%7D%2Fin%2FurkKV%3A27%243

Class Aggregation:
Function callaggregation:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/urkKV
function name:  callAggregation
number of ops:  9
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        SEND_VAR                                                 !2
          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/urkKV
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/urkKV
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:
152.32 ms | 1392 KiB | 15 Q