3v4l.org

run code in 500+ PHP versions simultaneously
<?php declare(strict_types=1); function f( string $name = null, Nette\Caching\Storage $storage ) {} $p = (new ReflectionFunction('f'))->getParameters()[0]; var_dump($p->isOptional()); var_dump($p->isDefaultValueAvailable());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QsJn4
function name:  (null)
number of ops:  18
compiled vars:  !0 = $p
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   11     0  E >   NEW                                                  $1      'ReflectionFunction'
          1        SEND_VAL_EX                                                  'f'
          2        DO_FCALL                                          0          
          3        INIT_METHOD_CALL                                             $1, 'getParameters'
          4        DO_FCALL                                          0  $3      
          5        FETCH_DIM_R                                          ~4      $3, 0
          6        ASSIGN                                                       !0, ~4
   12     7        INIT_FCALL                                                   'var_dump'
          8        INIT_METHOD_CALL                                             !0, 'isOptional'
          9        DO_FCALL                                          0  $6      
         10        SEND_VAR                                                     $6
         11        DO_ICALL                                                     
   13    12        INIT_FCALL                                                   'var_dump'
         13        INIT_METHOD_CALL                                             !0, 'isDefaultValueAvailable'
         14        DO_FCALL                                          0  $8      
         15        SEND_VAR                                                     $8
         16        DO_ICALL                                                     
         17      > RETURN                                                       1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/QsJn4
function name:  f
number of ops:  3
compiled vars:  !0 = $name, !1 = $storage
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    6     0  E >   RECV                                                 !0      
    7     1        RECV                                                 !1      
    8     2      > RETURN                                                       null

End of function f

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
162.48 ms | 3327 KiB | 14 Q