3v4l.org

run code in 300+ PHP versions simultaneously
<?php namespace A { class T {} } namespace { $hello = 42; class Test { public function first(string $str): Closure { return function() use ($hello) { }; } public function second(int $i): int { } } }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3EF5b
function name:  (null)
number of ops:  2
compiled vars:  !0 = $hello
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 42
   23     1      > RETURN                                                   1

Function %00%7Bclosure%7D%2Fin%2F3EF5b%3A13%240:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3EF5b
function name:  {closure}
number of ops:  2
compiled vars:  !0 = $hello
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   13     0  E >   BIND_STATIC                                              !0
   15     1      > RETURN                                                   null

End of function %00%7Bclosure%7D%2Fin%2F3EF5b%3A13%240

Class A\T: [no user functions]
Class Test:
Function first:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3EF5b
function name:  first
number of ops:  7
compiled vars:  !0 = $str, !1 = $hello
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F3EF5b%3A13%240'
          2        BIND_LEXICAL                                             ~2, !1
   15     3        VERIFY_RETURN_TYPE                                       ~2
          4      > RETURN                                                   ~2
   16     5*       VERIFY_RETURN_TYPE                                       
          6*     > RETURN                                                   null

End of function first

Function second:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/3EF5b
function name:  second
number of ops:  3
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   18     0  E >   RECV                                             !0      
   21     1        VERIFY_RETURN_TYPE                                       
          2      > RETURN                                                   null

End of function second

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166.2 ms | 1394 KiB | 13 Q