3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Test { public function foo(int $id = 1, string $str) {} public function bar(int $id = 1, string $str = '') {} } var_dump((string) new \ReflectionMethod(new Test(), 'foo')); var_dump((string) new \ReflectionMethod(new Test(), 'bar'));
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Za9kK
function name:  (null)
number of ops:  21
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    8     0  E >   INIT_FCALL                                                   'var_dump'
          1        NEW                                                  $0      'ReflectionMethod'
          2        NEW                                                  $1      'Test'
          3        DO_FCALL                                          0          
          4        SEND_VAR_NO_REF_EX                                           $1
          5        SEND_VAL_EX                                                  'foo'
          6        DO_FCALL                                          0          
          7        CAST                                              6  ~4      $0
          8        SEND_VAL                                                     ~4
          9        DO_ICALL                                                     
    9    10        INIT_FCALL                                                   'var_dump'
         11        NEW                                                  $6      'ReflectionMethod'
         12        NEW                                                  $7      'Test'
         13        DO_FCALL                                          0          
         14        SEND_VAR_NO_REF_EX                                           $7
         15        SEND_VAL_EX                                                  'bar'
         16        DO_FCALL                                          0          
         17        CAST                                              6  ~10     $6
         18        SEND_VAL                                                     ~10
         19        DO_ICALL                                                     
         20      > RETURN                                                       1

Class Test:
Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Za9kK
function name:  foo
number of ops:  3
compiled vars:  !0 = $id, !1 = $str
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    4     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2      > RETURN                                                       null

End of function foo

Function bar:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/Za9kK
function name:  bar
number of ops:  3
compiled vars:  !0 = $id, !1 = $str
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                            !0      1
          1        RECV_INIT                                            !1      ''
          2      > RETURN                                                       null

End of function bar

End of class Test.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
130.57 ms | 478 KiB | 8 Q