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 ($str):int { return strlen($str); }; } public function second(int $i): int { } } $t = new Test; echo ($t->first("hello"))(); }
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2GLkG
function name:  (null)
number of ops:  11
compiled vars:  !0 = $hello, !1 = $t
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   ASSIGN                                                   !0, 42
   24     1        NEW                                              $3      'Test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !1, $3
   25     4        INIT_METHOD_CALL                                         !1, 'first'
          5        SEND_VAL_EX                                              'hello'
          6        DO_FCALL                                      0  $6      
          7        INIT_DYNAMIC_CALL                                        $6
          8        DO_FCALL                                      0  $7      
          9        ECHO                                                     $7
   26    10      > RETURN                                                   1

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

End of function %00%7Bclosure%7D%2Fin%2F2GLkG%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/2GLkG
function name:  first
number of ops:  7
compiled vars:  !0 = $str
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   RECV                                             !0      
   13     1        DECLARE_LAMBDA_FUNCTION                                  '%00%7Bclosure%7D%2Fin%2F2GLkG%3A13%240'
          2        BIND_LEXICAL                                             ~1, !0
   15     3        VERIFY_RETURN_TYPE                                       ~1
          4      > RETURN                                                   ~1
   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/2GLkG
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:
169.21 ms | 1395 KiB | 13 Q