3v4l.org

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

Function acme%5Cjson_encode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i3CcQ
function name:  Acme\json_encode
number of ops:  3
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   12     1      > RETURN                                                   'json_encode+mock'
   13     2*     > RETURN                                                   null

End of function acme%5Cjson_encode

Class Globock\JSON:
Function json_encode:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i3CcQ
function name:  json_encode
number of ops:  3
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1      > RETURN                                                   'json_encode+mock'
    6     2*     > RETURN                                                   null

End of function json_encode

End of class Globock\JSON.

Class Acme\Foo:
Function hello:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/i3CcQ
function name:  hello
number of ops:  5
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   16     0  E >   INIT_NS_FCALL_BY_NAME                                    'Acme%5Cjson_encode'
          1        SEND_VAL_EX                                              <array>
          2        DO_FCALL                                      0  $0      
          3      > RETURN                                                   $0
   17     4*     > 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/i3CcQ
function name:  helloTest
number of ops:  7
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   25     0  E >   NEW                                              $1      'Acme%5CFoo'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   26     3        INIT_METHOD_CALL                                         !0, 'hello'
          4        DO_FCALL                                      0  $4      
          5        ECHO                                                     $4
   27     6      > RETURN                                                   null

End of function hellotest

End of class Acme\Test\FooTest.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
152.3 ms | 1400 KiB | 15 Q