3v4l.org

run code in 300+ PHP versions simultaneously
<?php function test(PDO $a = null, $b = 0, array $c) {} $r = new ReflectionFunction('test'); foreach ($r->getParameters() as $p) { echo $p->getName(); echo " isDefaultValueAvailable: " . var_export($p->isDefaultValueAvailable(), true) . "\n"; echo " isOptional: " . var_export($p->isOptional(), true) . "\n"; echo " allowsNull: " . var_export($p->allowsNull(), true) . "\n"; echo "\n"; }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 7, Position 2 = 40
Branch analysis from position: 7
2 jumps found. (Code = 78) Position 1 = 8, Position 2 = 40
Branch analysis from position: 8
1 jumps found. (Code = 42) Position 1 = 7
Branch analysis from position: 7
Branch analysis from position: 40
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 40
filename:       /in/LMkLq
function name:  (null)
number of ops:  42
compiled vars:  !0 = $r, !1 = $p
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   NEW                                              $2      'ReflectionFunction'
          1        SEND_VAL_EX                                              'test'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
    5     4        INIT_METHOD_CALL                                         !0, 'getParameters'
          5        DO_FCALL                                      0  $5      
          6      > FE_RESET_R                                       $6      $5, ->40
          7    > > FE_FETCH_R                                               $6, !1, ->40
    6     8    >   INIT_METHOD_CALL                                         !1, 'getName'
          9        DO_FCALL                                      0  $7      
         10        ECHO                                                     $7
    7    11        INIT_FCALL                                               'var_export'
         12        INIT_METHOD_CALL                                         !1, 'isDefaultValueAvailable'
         13        DO_FCALL                                      0  $8      
         14        SEND_VAR                                                 $8
         15        SEND_VAL                                                 <true>
         16        DO_ICALL                                         $9      
         17        CONCAT                                           ~10     '+++isDefaultValueAvailable%3A+', $9
         18        CONCAT                                           ~11     ~10, '%0A'
         19        ECHO                                                     ~11
    8    20        INIT_FCALL                                               'var_export'
         21        INIT_METHOD_CALL                                         !1, 'isOptional'
         22        DO_FCALL                                      0  $12     
         23        SEND_VAR                                                 $12
         24        SEND_VAL                                                 <true>
         25        DO_ICALL                                         $13     
         26        CONCAT                                           ~14     '++++isOptional%3A+', $13
         27        CONCAT                                           ~15     ~14, '%0A'
         28        ECHO                                                     ~15
    9    29        INIT_FCALL                                               'var_export'
         30        INIT_METHOD_CALL                                         !1, 'allowsNull'
         31        DO_FCALL                                      0  $16     
         32        SEND_VAR                                                 $16
         33        SEND_VAL                                                 <true>
         34        DO_ICALL                                         $17     
         35        CONCAT                                           ~18     '++++allowsNull%3A+', $17
         36        CONCAT                                           ~19     ~18, '%0A'
         37        ECHO                                                     ~19
   10    38        ECHO                                                     '%0A'
    5    39      > JMP                                                      ->7
         40    >   FE_FREE                                                  $6
   11    41      > RETURN                                                   1

Function test:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/LMkLq
function name:  test
number of ops:  4
compiled vars:  !0 = $a, !1 = $b, !2 = $c
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV_INIT                                        !0      null
          1        RECV_INIT                                        !1      0
          2        RECV                                             !2      
          3      > RETURN                                                   null

End of function test

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
156.33 ms | 1400 KiB | 15 Q