3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Some\TestNamespace; trait trait1 { public function method1() { echo __CLASS__; } } trait trait2 { public function method2($obj) { $obj->method1(); } } class class1 { use trait1; use trait2; } $obj = new class1; $closure = function ($instance) use ($obj) { $instance->method2($obj); }; $closure($obj);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kCPhu
function name:  (null)
number of ops:  11
compiled vars:  !0 = $obj, !1 = $closure
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   20     0  E >   DECLARE_CLASS                                            'some%5Ctestnamespace%5Cclass1'
   26     1        NEW                                              $2      'Some%5CTestNamespace%5Cclass1'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   28     4        DECLARE_LAMBDA_FUNCTION                                  '%00some%5Ctestnamespace%5C%7Bclosure%7D%2Fin%2FkCPhu%3A28%241'
          5        BIND_LEXICAL                                             ~5, !0
          6        ASSIGN                                                   !1, ~5
   32     7        INIT_DYNAMIC_CALL                                        !1
          8        SEND_VAR_EX                                              !0
          9        DO_FCALL                                      0          
         10      > RETURN                                                   1

Function %00some%5Ctestnamespace%5C%7Bclosure%7D%2Fin%2FkCPhu%3A28%241:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kCPhu
function name:  Some\TestNamespace\{closure}
number of ops:  6
compiled vars:  !0 = $instance, !1 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E >   RECV                                             !0      
          1        BIND_STATIC                                              !1
   29     2        INIT_METHOD_CALL                                         !0, 'method2'
          3        SEND_VAR_EX                                              !1
          4        DO_FCALL                                      0          
   30     5      > RETURN                                                   null

End of function %00some%5Ctestnamespace%5C%7Bclosure%7D%2Fin%2FkCPhu%3A28%241

Class Some\TestNamespace\trait1:
Function method1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kCPhu
function name:  method1
number of ops:  3
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   FETCH_CLASS_NAME                                 ~0      
          1        ECHO                                                     ~0
    9     2      > RETURN                                                   null

End of function method1

End of class Some\TestNamespace\trait1.

Class Some\TestNamespace\trait2:
Function method2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/kCPhu
function name:  method2
number of ops:  4
compiled vars:  !0 = $obj
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   RECV                                             !0      
   16     1        INIT_METHOD_CALL                                         !0, 'method1'
          2        DO_FCALL                                      0          
   17     3      > RETURN                                                   null

End of function method2

End of class Some\TestNamespace\trait2.

Class Some\TestNamespace\class1: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
169.19 ms | 1395 KiB | 13 Q