3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Some\Other { class Foo { use \NiceTrait; function baz() { $this->bar = function() {echo 'im a callable bar';}; } } } namespace { trait NiceTrait { function bar() { echo "bar over here!"; } } $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/ZDTMu
function name:  (null)
number of ops:  9
compiled vars:  !0 = $foo
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   DECLARE_CLASS                                            'some%5Cother%5Cfoo'
   26     1        NEW                                              $1      'Some%5COther%5CFoo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $1
   27     4        INIT_METHOD_CALL                                         !0, 'baz'
          5        DO_FCALL                                      0          
   28     6        INIT_METHOD_CALL                                         !0, 'bar'
          7        DO_FCALL                                      0          
   30     8      > RETURN                                                   1

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

End of function %00some%5Cother%5C%7Bclosure%7D%2Fin%2FZDTMu%3A12%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/ZDTMu
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%2FZDTMu%3A12%240'
          1        ASSIGN_OBJ                                               'bar'
          2        OP_DATA                                                  ~1
   13     3      > RETURN                                                   null

End of function baz

End of class Some\Other\Foo.

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

End of function bar

End of class NiceTrait.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.34 ms | 1395 KiB | 13 Q