3v4l.org

run code in 300+ PHP versions simultaneously
<?php function foo1($bar) { $numargs = func_num_args(); echo $numargs."\n"; } function foo2($bar = 2) { $numargs = func_num_args(); echo $numargs."\n"; } foo1(2); foo2(); foo2(2);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HhQ9t
function name:  (null)
number of ops:  9
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   17     0  E >   INIT_FCALL                                               'foo1'
          1        SEND_VAL                                                 2
          2        DO_FCALL                                      0          
   18     3        INIT_FCALL                                               'foo2'
          4        DO_FCALL                                      0          
   19     5        INIT_FCALL                                               'foo2'
          6        SEND_VAL                                                 2
          7        DO_FCALL                                      0          
          8      > RETURN                                                   1

Function foo1:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HhQ9t
function name:  foo1
number of ops:  6
compiled vars:  !0 = $bar, !1 = $numargs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
    4     0  E >   RECV                                             !0      
    5     1        FUNC_NUM_ARGS                                    ~2      
          2        ASSIGN                                                   !1, ~2
    7     3        CONCAT                                           ~4      !1, '%0A'
          4        ECHO                                                     ~4
    8     5      > RETURN                                                   null

End of function foo1

Function foo2:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/HhQ9t
function name:  foo2
number of ops:  6
compiled vars:  !0 = $bar, !1 = $numargs
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   10     0  E >   RECV_INIT                                        !0      2
   12     1        FUNC_NUM_ARGS                                    ~2      
          2        ASSIGN                                                   !1, ~2
   14     3        CONCAT                                           ~4      !1, '%0A'
          4        ECHO                                                     ~4
   15     5      > RETURN                                                   null

End of function foo2

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
160.12 ms | 1398 KiB | 16 Q