3v4l.org

run code in 300+ PHP versions simultaneously
<?php class A {} class B { public function __construct(A $a = null) { } } $r = new ReflectionMethod('B', '__construct'); var_dump($r->getParameters()[0]->getName(), $r->getParameters()[0]->isDefaultValueConstant());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hQuTn
function name:  (null)
number of ops:  20
compiled vars:  !0 = $r
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   NEW                                              $1      'ReflectionMethod'
          1        SEND_VAL_EX                                              'B'
          2        SEND_VAL_EX                                              '__construct'
          3        DO_FCALL                                      0          
          4        ASSIGN                                                   !0, $1
   11     5        INIT_FCALL                                               'var_dump'
          6        INIT_METHOD_CALL                                         !0, 'getParameters'
          7        DO_FCALL                                      0  $4      
          8        FETCH_DIM_R                                      ~5      $4, 0
          9        INIT_METHOD_CALL                                         ~5, 'getName'
         10        DO_FCALL                                      0  $6      
         11        SEND_VAR                                                 $6
         12        INIT_METHOD_CALL                                         !0, 'getParameters'
         13        DO_FCALL                                      0  $7      
         14        FETCH_DIM_R                                      ~8      $7, 0
         15        INIT_METHOD_CALL                                         ~8, 'isDefaultValueConstant'
         16        DO_FCALL                                      0  $9      
         17        SEND_VAR                                                 $9
         18        DO_ICALL                                                 
         19      > RETURN                                                   1

Class A: [no user functions]
Class B:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/hQuTn
function name:  __construct
number of ops:  2
compiled vars:  !0 = $a
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      null
    7     1      > RETURN                                                   null

End of function __construct

End of class B.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
189.41 ms | 1395 KiB | 15 Q