3v4l.org

run code in 300+ PHP versions simultaneously
<?php function getData($name, $limit = "50", $page = "1") { foreach((new ReflectionFunction(debug_backtrace()[0]["function"]))->getParameters() as $param) { if(${$param->getName()} == "" && $param->isOptional()) ${$param->getName()} = $param->getDefaultValue(); } echo $name . "<br>"; echo $limit . "<br>"; echo $page . "<br>"; } getData("some name", "", "23");
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/F2ibi
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   15     0  E >   INIT_FCALL                                               'getdata'
          1        SEND_VAL                                                 'some+name'
          2        SEND_VAL                                                 ''
          3        SEND_VAL                                                 '23'
          4        DO_FCALL                                      0          
          5      > RETURN                                                   1

Function getdata:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 77) Position 1 = 15, Position 2 = 32
Branch analysis from position: 15
2 jumps found. (Code = 78) Position 1 = 16, Position 2 = 32
Branch analysis from position: 16
2 jumps found. (Code = 46) Position 1 = 21, Position 2 = 24
Branch analysis from position: 21
2 jumps found. (Code = 43) Position 1 = 25, Position 2 = 31
Branch analysis from position: 25
1 jumps found. (Code = 42) Position 1 = 15
Branch analysis from position: 15
Branch analysis from position: 31
Branch analysis from position: 24
Branch analysis from position: 32
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 32
filename:       /in/F2ibi
function name:  getData
number of ops:  40
compiled vars:  !0 = $name, !1 = $limit, !2 = $page, !3 = $param
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    3     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      '50'
          2        RECV_INIT                                        !2      '1'
    4     3        NEW                                              $4      'ReflectionFunction'
          4        CHECK_FUNC_ARG                                           
          5        INIT_FCALL                                               'debug_backtrace'
          6        DO_ICALL                                         $5      
          7        SEPARATE                                         $5      $5
          8        FETCH_DIM_FUNC_ARG                               $6      $5, 0
          9        FETCH_DIM_FUNC_ARG                               $7      $6, 'function'
         10        SEND_FUNC_ARG                                            $7
         11        DO_FCALL                                      0          
         12        INIT_METHOD_CALL                                         $4, 'getParameters'
         13        DO_FCALL                                      0  $9      
         14      > FE_RESET_R                                       $10     $9, ->32
         15    > > FE_FETCH_R                                               $10, !3, ->32
    5    16    >   INIT_METHOD_CALL                                         !3, 'getName'
         17        DO_FCALL                                      0  $11     
         18        FETCH_R                      local               ~12     $11
         19        IS_EQUAL                                         ~13     ~12, ''
         20      > JMPZ_EX                                          ~13     ~13, ->24
         21    >   INIT_METHOD_CALL                                         !3, 'isOptional'
         22        DO_FCALL                                      0  $14     
         23        BOOL                                             ~13     $14
         24    > > JMPZ                                                     ~13, ->31
    6    25    >   INIT_METHOD_CALL                                         !3, 'getName'
         26        DO_FCALL                                      0  $15     
         27        INIT_METHOD_CALL                                         !3, 'getDefaultValue'
         28        DO_FCALL                                      0  $17     
         29        FETCH_W                      local               $16     $15
         30        ASSIGN                                                   $16, $17
    4    31    > > JMP                                                      ->15
         32    >   FE_FREE                                                  $10
    9    33        CONCAT                                           ~19     !0, '%3Cbr%3E'
         34        ECHO                                                     ~19
   10    35        CONCAT                                           ~20     !1, '%3Cbr%3E'
         36        ECHO                                                     ~20
   11    37        CONCAT                                           ~21     !2, '%3Cbr%3E'
         38        ECHO                                                     ~21
   12    39      > RETURN                                                   null

End of function getdata

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.64 ms | 1403 KiB | 16 Q