3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { } $f = (new ReflectionFunction('foo'))->getClosure(); $r = new ReflectionFunction($f); var_dump($r->getStartLine(), $r->getFileName());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HfUKn
function name:  (null)
number of ops:  19
compiled vars:  !0 = $f, !1 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    8     0  E >   NEW                                              $2      'ReflectionFunction'
          1        SEND_VAL_EX                                              'foo'
          2        DO_FCALL                                      0          
          3        INIT_METHOD_CALL                                         $2, 'getClosure'
          4        DO_FCALL                                      0  $4      
          5        ASSIGN                                                   !0, $4
    9     6        NEW                                              $6      'ReflectionFunction'
          7        SEND_VAR_EX                                              !0
          8        DO_FCALL                                      0          
          9        ASSIGN                                                   !1, $6
   11    10        INIT_FCALL                                               'var_dump'
         11        INIT_METHOD_CALL                                         !1, 'getStartLine'
         12        DO_FCALL                                      0  $9      
         13        SEND_VAR                                                 $9
         14        INIT_METHOD_CALL                                         !1, 'getFileName'
         15        DO_FCALL                                      0  $10     
         16        SEND_VAR                                                 $10
         17        DO_ICALL                                                 
         18      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HfUKn
function name:  foo
number of ops:  1
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    6     0  E > > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
147.08 ms | 1010 KiB | 14 Q