3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace Globock { trait Test { function toTest() { return 'toTest mock'; } } } namespace { function toTest() { return 'toTest'; } class Foo { public function hello() { echo toTest(); } } $a = new Foo(); echo $a->hello(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c1j3c
function name:  (null)
number of ops:  7
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   21     0  E >   NEW                                              $1      'Foo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   22     3        INIT_METHOD_CALL                                         !0, 'hello'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
   23     6      > RETURN                                                   1

Function totest:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c1j3c
function name:  toTest
number of ops:  2
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   12     0  E > > RETURN                                                   'toTest'
   13     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/c1j3c
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 Foo:
Function hello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/c1j3c
function name:  hello
number of ops:  4
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'totest'
          1        DO_FCALL                                      0  $0      
          2        ECHO                                                     $0
   18     3      > RETURN                                                   null

End of function hello

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
164.91 ms | 1398 KiB | 14 Q