3v4l.org

run code in 300+ PHP versions simultaneously
<?php class X { const Y = 1; } function foo($x = X::Y) {} var_dump((new ReflectionParameter('foo', 'x'))->isDefaultValueConstant());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/5XtTB
function name:  (null)
number of ops:  10
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   INIT_FCALL                                               'var_dump'
          1        NEW                                              $0      'ReflectionParameter'
          2        SEND_VAL_EX                                              'foo'
          3        SEND_VAL_EX                                              'x'
          4        DO_FCALL                                      0          
          5        INIT_METHOD_CALL                                         $0, 'isDefaultValueConstant'
          6        DO_FCALL                                      0  $2      
          7        SEND_VAR                                                 $2
          8        DO_ICALL                                                 
          9      > RETURN                                                   1

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

End of function foo

Class X: [no user functions]

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
166 ms | 1394 KiB | 15 Q