3v4l.org

run code in 300+ PHP versions simultaneously
<?php const DEFAULT_VALUE = null; function foo(\stdClass $arg = DEFAULT_VALUE) { var_dump($arg); } var_dump((new ReflectionFunction('foo'))->getParameters()[0]->getDefaultValue()); foo(null);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/R8WYD
function name:  (null)
number of ops:  16
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   DECLARE_CONST                                            'DEFAULT_VALUE', null
   10     1        INIT_FCALL                                               'var_dump'
          2        NEW                                              $0      'ReflectionFunction'
          3        SEND_VAL_EX                                              'foo'
          4        DO_FCALL                                      0          
          5        INIT_METHOD_CALL                                         $0, 'getParameters'
          6        DO_FCALL                                      0  $2      
          7        FETCH_DIM_R                                      ~3      $2, 0
          8        INIT_METHOD_CALL                                         ~3, 'getDefaultValue'
          9        DO_FCALL                                      0  $4      
         10        SEND_VAR                                                 $4
         11        DO_ICALL                                                 
   11    12        INIT_FCALL                                               'foo'
         13        SEND_VAL                                                 null
         14        DO_FCALL                                      0          
         15      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/R8WYD
function name:  foo
number of ops:  5
compiled vars:  !0 = $arg
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      <const ast>
    7     1        INIT_FCALL                                               'var_dump'
          2        SEND_VAR                                                 !0
          3        DO_ICALL                                                 
    8     4      > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
174.87 ms | 1397 KiB | 16 Q