3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo() { $numargs = func_num_args(); echo "Number of arguments: $numargs<br />\n"; if ($numargs >= 2) { echo "Second argument is: " . func_get_arg(1) . "<br />\n"; } } foo (1, 2, 3); ?>
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/dGbpk
function name:  (null)
number of ops:  6
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   11     0  E >   INIT_FCALL                                               'foo'
          1        SEND_VAL                                                 1
          2        SEND_VAL                                                 2
          3        SEND_VAL                                                 3
          4        DO_FCALL                                      0          
   12     5      > RETURN                                                   1

Function foo:
Finding entry points
Branch analysis from position: 0
2 jumps found. (Code = 43) Position 1 = 8, Position 2 = 14
Branch analysis from position: 8
1 jumps found. (Code = 62) Position 1 = -2
Branch analysis from position: 14
filename:       /in/dGbpk
function name:  foo
number of ops:  15
compiled vars:  !0 = $numargs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   FUNC_NUM_ARGS                                    ~1      
          1        ASSIGN                                                   !0, ~1
    5     2        ROPE_INIT                                     3  ~4      'Number+of+arguments%3A+'
          3        ROPE_ADD                                      1  ~4      ~4, !0
          4        ROPE_END                                      2  ~3      ~4, '%3Cbr+%2F%3E%0A'
          5        ECHO                                                     ~3
    6     6        IS_SMALLER_OR_EQUAL                                      2, !0
          7      > JMPZ                                                     ~6, ->14
    7     8    >   INIT_FCALL                                               'func_get_arg'
          9        SEND_VAL                                                 1
         10        DO_ICALL                                         $7      
         11        CONCAT                                           ~8      'Second+argument+is%3A+', $7
         12        CONCAT                                           ~9      ~8, '%3Cbr+%2F%3E%0A'
         13        ECHO                                                     ~9
    9    14    > > RETURN                                                   null

End of function foo

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
157.57 ms | 1398 KiB | 16 Q