3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Globock { trait Test { function toTest() { return 'toTest mock'; } } } namespace Acme { use Globock\Test; class Foo { public function hello() { return toTest(); } } } namespace Acme\Test { use Acme\Foo; class FooTest { public function helloTest() { $a = new Foo(); echo $a->hello(); } } } 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/NbUHa
function name:  (null)
number of ops:  6
compiled vars:  !0 = $b
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   NEW                                              $1      'Acme%5CTest%5CFooTest'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   37     3        INIT_METHOD_CALL                                         !0, 'helloTest'
          4        DO_FCALL                                      0          
   38     5      > RETURN                                                   1

Function totest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/NbUHa
function name:  toTest
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   31     0  E > > RETURN                                                   'toTest'
   32     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/NbUHa
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/NbUHa
function name:  hello
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   14     0  E >   INIT_NS_FCALL_BY_NAME                                    'Acme%5CtoTest'
          1        DO_FCALL                                      0  $0      
          2      > RETURN                                                   $0
   15     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/NbUHa
function name:  helloTest
number of ops:  7
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   23     0  E >   NEW                                              $1      'Acme%5CFoo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   24     3        INIT_METHOD_CALL                                         !0, 'hello'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
   25     6      > RETURN                                                   null

End of function hellotest

End of class Acme\Test\FooTest.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
148.6 ms | 1399 KiB | 14 Q