3v4l.org

run code in 300+ PHP versions simultaneously
<?php $pdo = new ReflectionClass('Pdo'); $constructor = $pdo->getMethod('__construct'); $parameters = $constructor->getParameters(); $option = $parameters[3]; var_dump($option->isOptional()); // bool(true) var_dump($option->isDefaultValueAvailable()); // bool(false)
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/IYDL8
function name:  (null)
number of ops:  24
compiled vars:  !0 = $pdo, !1 = $constructor, !2 = $parameters, !3 = $option
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $4      'ReflectionClass'
          1        SEND_VAL_EX                                              'Pdo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $4
    4     4        INIT_METHOD_CALL                                         !0, 'getMethod'
          5        SEND_VAL_EX                                              '__construct'
          6        DO_FCALL                                      0  $7      
          7        ASSIGN                                                   !1, $7
    5     8        INIT_METHOD_CALL                                         !1, 'getParameters'
          9        DO_FCALL                                      0  $9      
         10        ASSIGN                                                   !2, $9
    6    11        FETCH_DIM_R                                      ~11     !2, 3
         12        ASSIGN                                                   !3, ~11
    8    13        INIT_FCALL                                               'var_dump'
         14        INIT_METHOD_CALL                                         !3, 'isOptional'
         15        DO_FCALL                                      0  $13     
         16        SEND_VAR                                                 $13
         17        DO_ICALL                                                 
    9    18        INIT_FCALL                                               'var_dump'
         19        INIT_METHOD_CALL                                         !3, 'isDefaultValueAvailable'
         20        DO_FCALL                                      0  $15     
         21        SEND_VAR                                                 $15
         22        DO_ICALL                                                 
         23      > RETURN                                                   1

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
163.46 ms | 1395 KiB | 15 Q