3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Foo { public function func($withDefault = 'a default', $noDefault) { } } $foo = new ReflectionClass('Foo'); foreach ($foo->getMethod('func')->getParameters() as $param) { echo('Param: ' . $param->name . ' has default: ' . ($param->isDefaultValueAvailable() ? 'yes' : 'no') . "\n"); }
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 10, Position 2 = 24
Branch analysis from position: 10
2 jumps found. (Code = 78) Position 1 = 11, Position 2 = 24
Branch analysis from position: 11
2 jumps found. (Code = 43) Position 1 = 17, Position 2 = 19
Branch analysis from position: 17
1 jumps found. (Code = 42) Position 1 = 20
Branch analysis from position: 20
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 19
1 jumps found. (Code = 42) Position 1 = 10
Branch analysis from position: 10
Branch analysis from position: 24
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 24
filename:       /in/DmPFQ
function name:  (null)
number of ops:  26
compiled vars:  !0 = $foo, !1 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    9     0  E >   NEW                                              $2      'ReflectionClass'
          1        SEND_VAL_EX                                              'Foo'
          2        DO_FCALL                                      0          
          3        ASSIGN                                                   !0, $2
   10     4        INIT_METHOD_CALL                                         !0, 'getMethod'
          5        SEND_VAL_EX                                              'func'
          6        DO_FCALL                                      0  $5      
          7        INIT_METHOD_CALL                                         $5, 'getParameters'
          8        DO_FCALL                                      0  $6      
          9      > FE_RESET_R                                       $7      $6, ->24
         10    > > FE_FETCH_R                                               $7, !1, ->24
   11    11    >   FETCH_OBJ_R                                      ~8      !1, 'name'
         12        CONCAT                                           ~9      'Param%3A+', ~8
         13        CONCAT                                           ~10     ~9, '+has+default%3A+'
         14        INIT_METHOD_CALL                                         !1, 'isDefaultValueAvailable'
         15        DO_FCALL                                      0  $11     
         16      > JMPZ                                                     $11, ->19
         17    >   QM_ASSIGN                                        ~12     'yes'
         18      > JMP                                                      ->20
         19    >   QM_ASSIGN                                        ~12     'no'
         20    >   CONCAT                                           ~13     ~10, ~12
         21        CONCAT                                           ~14     ~13, '%0A'
         22        ECHO                                                     ~14
   10    23      > JMP                                                      ->10
         24    >   FE_FREE                                                  $7
   12    25      > RETURN                                                   1

Class Foo:
Function func:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/DmPFQ
function name:  func
number of ops:  3
compiled vars:  !0 = $withDefault, !1 = $noDefault
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    5     0  E >   RECV_INIT                                        !0      'a+default'
          1        RECV                                             !1      
    7     2      > RETURN                                                   null

End of function func

End of class Foo.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
150.63 ms | 1395 KiB | 13 Q