3v4l.org

run code in 300+ PHP versions simultaneously
<?php function f($req, $opt = null, ...$params) { $e = printf('$req: %d; $opt: %d; number of params: %d'."\n", $req, $opt, count($params)); } $i=10000; while(--$i) { f(1); f(1, 2); f(1, 2, 3); f(1, 2, 3, 4); f(1, 2, 3, 4, 5); } ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 42) Position 1 = 27
Branch analysis from position: 27
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 2
Branch analysis from position: 29
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 2
2 jumps found. (Code = 44) Position 1 = 29, Position 2 = 2
Branch analysis from position: 29
Branch analysis from position: 2
filename:       /in/87qXN
function name:  (null)
number of ops:  30
compiled vars:  !0 = $i
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    7     0  E >   ASSIGN                                                   !0, 10000
    8     1      > JMP                                                      ->27
    9     2    >   INIT_FCALL                                               'f'
          3        SEND_VAL                                                 1
          4        DO_FCALL                                      0          
   10     5        INIT_FCALL                                               'f'
          6        SEND_VAL                                                 1
          7        SEND_VAL                                                 2
          8        DO_FCALL                                      0          
   11     9        INIT_FCALL                                               'f'
         10        SEND_VAL                                                 1
         11        SEND_VAL                                                 2
         12        SEND_VAL                                                 3
         13        DO_FCALL                                      0          
   12    14        INIT_FCALL                                               'f'
         15        SEND_VAL                                                 1
         16        SEND_VAL                                                 2
         17        SEND_VAL                                                 3
         18        SEND_VAL                                                 4
         19        DO_FCALL                                      0          
   13    20        INIT_FCALL                                               'f'
         21        SEND_VAL                                                 1
         22        SEND_VAL                                                 2
         23        SEND_VAL                                                 3
         24        SEND_VAL                                                 4
         25        SEND_VAL                                                 5
         26        DO_FCALL                                      0          
    8    27    >   PRE_DEC                                          ~7      !0
         28      > JMPNZ                                                    ~7, ->2
   15    29    > > RETURN                                                   1

Function f:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/87qXN
function name:  f
number of ops:  12
compiled vars:  !0 = $req, !1 = $opt, !2 = $params, !3 = $e
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    2     0  E >   RECV                                             !0      
          1        RECV_INIT                                        !1      null
          2        RECV_VARIADIC                                    !2      
    3     3        INIT_FCALL                                               'printf'
          4        SEND_VAL                                                 '%24req%3A+%25d%3B+%24opt%3A+%25d%3B+number+of+params%3A+%25d%0A'
    4     5        SEND_VAR                                                 !0
          6        SEND_VAR                                                 !1
          7        COUNT                                            ~4      !2
          8        SEND_VAL                                                 ~4
          9        DO_ICALL                                         $5      
    3    10        ASSIGN                                                   !3, $5
    5    11      > RETURN                                                   null

End of function f

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
155.13 ms | 1403 KiB | 20 Q