3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Generic\Space { function bar() { echo "bar over here!"; } } namespace Some\Other { class Foo { use \My\TraitSpace\NiceTrait; function baz() { $this->bar = function() {echo 'im a callable bar';}; } } } namespace My\TraitSpace { use \Generic\Space; trait NiceTrait { function bar() { echo "within the trait!"; } } } namespace { $foo = new Some\Other\Foo(); $foo->baz(); $foo->bar(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nXOnn
function name:  (null)
number of ops:  9
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E >   DECLARE_CLASS                                            'some%5Cother%5Cfoo'
   32     1        NEW                                              $1      'Some%5COther%5CFoo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   33     4        INIT_METHOD_CALL                                         !0, 'baz'
          5        DO_FCALL                                      0          
   34     6        INIT_METHOD_CALL                                         !0, 'bar'
          7        DO_FCALL                                      0          
   36     8      > RETURN                                                   1

Function generic%5Cspace%5Cbar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nXOnn
function name:  Generic\Space\bar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E >   ECHO                                                     'bar+over+here%21'
          1      > RETURN                                                   null

End of function generic%5Cspace%5Cbar

Function %00some%5Cother%5C%7Bclosure%7D%2Fin%2FnXOnn%3A17%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nXOnn
function name:  Some\Other\{closure}
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   ECHO                                                     'im+a+callable+bar'
          1      > RETURN                                                   null

End of function %00some%5Cother%5C%7Bclosure%7D%2Fin%2FnXOnn%3A17%240

Class Some\Other\Foo:
Function baz:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nXOnn
function name:  baz
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
          0  E >   DECLARE_LAMBDA_FUNCTION                                  '%00some%5Cother%5C%7Bclosure%7D%2Fin%2FnXOnn%3A17%240'
          1        ASSIGN_OBJ                                               'bar'
          2        OP_DATA                                                  ~1
   18     3      > RETURN                                                   null

End of function baz

End of class Some\Other\Foo.

Class My\TraitSpace\NiceTrait:
Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/nXOnn
function name:  bar
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   ECHO                                                     'within+the+trait%21'
          1      > RETURN                                                   null

End of function bar

End of class My\TraitSpace\NiceTrait.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.17 ms | 1395 KiB | 13 Q