3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Globock { trait Test { function toTest() { return 'toTest mock'; } } } namespace Acme { class Foo { public function hello() { echo toTest(); } } } namespace Acme\Test { class FooTest { public function helloTest() { echo toTest(); } } } namespace { function toTest() { return 'toTest'; } $a = new Acme\Foo(); echo $a->hello(); $b = new Acme\Test\FooTest(); $b->helloTest(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/20jc3
function name:  (null)
number of ops:  12
compiled vars:  !0 = $a, !1 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E >   NEW                                              $2      'Acme%5CFoo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $2
   32     3        INIT_METHOD_CALL                                         !0, 'hello'
          4        DO_FCALL                                      0  $5      
          5        ECHO                                                     $5
   33     6        NEW                                              $6      'Acme%5CTest%5CFooTest'
          7        DO_FCALL                                      0          
          8        ASSIGN                                                   !1, $6
   34     9        INIT_METHOD_CALL                                         !1, 'helloTest'
         10        DO_FCALL                                      0          
   35    11      > RETURN                                                   1

Function totest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/20jc3
function name:  toTest
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   28     0  E > > RETURN                                                   'toTest'
   29     1*     > RETURN                                                   null

End of function totest

Class Globock\Test:
Function totest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/20jc3
function name:  toTest
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E > > RETURN                                                   'toTest+mock'
    6     1*     > RETURN                                                   null

End of function totest

End of class Globock\Test.

Class Acme\Foo:
Function hello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/20jc3
function name:  hello
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   INIT_NS_FCALL_BY_NAME                                    'Acme%5CtoTest'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
   14     3      > RETURN                                                   null

End of function hello

End of class Acme\Foo.

Class Acme\Test\FooTest:
Function hellotest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/20jc3
function name:  helloTest
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   INIT_NS_FCALL_BY_NAME                                    'Acme%5CTest%5CtoTest'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
   22     3      > RETURN                                                   null

End of function hellotest

End of class Acme\Test\FooTest.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.52 ms | 1403 KiB | 15 Q