3v4l.org

run code in 500+ PHP versions simultaneously
<?php function test_func($arg1 = 'a', $arg2 = 'b', $arg3 = 'c', $arg4 = 'd') { return json_encode([ 'func_num_args' => func_num_args(), 'func_get_args' => func_get_args(), 'direct_args' => [$arg1, $arg2, $arg3, $arg4], ], JSON_PRETTY_PRINT); } echo test_func('hello', 'b', 'world');
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/V1084
function name:  (null)
number of ops:  7
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   12     0  E >   INIT_FCALL                                                   'test_func'
          1        SEND_VAL                                                     'hello'
          2        SEND_VAL                                                     'b'
          3        SEND_VAL                                                     'world'
          4        DO_FCALL                                          0  $0      
          5        ECHO                                                         $0
          6      > RETURN                                                       1

Function test_func:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/V1084
function name:  test_func
number of ops:  19
compiled vars:  !0 = $arg1, !1 = $arg2, !2 = $arg3, !3 = $arg4
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    3     0  E >   RECV_INIT                                            !0      'a'
          1        RECV_INIT                                            !1      'b'
          2        RECV_INIT                                            !2      'c'
          3        RECV_INIT                                            !3      'd'
    5     4        INIT_FCALL                                                   'json_encode'
    6     5        FUNC_NUM_ARGS                                        ~4      
          6        INIT_ARRAY                                           ~5      ~4, 'func_num_args'
    7     7        FUNC_GET_ARGS                                        ~6      
          8        ADD_ARRAY_ELEMENT                                    ~5      ~6, 'func_get_args'
    8     9        INIT_ARRAY                                           ~7      !0
         10        ADD_ARRAY_ELEMENT                                    ~7      !1
         11        ADD_ARRAY_ELEMENT                                    ~7      !2
         12        ADD_ARRAY_ELEMENT                                    ~7      !3
         13        ADD_ARRAY_ELEMENT                                    ~5      ~7, 'direct_args'
         14        SEND_VAL                                                     ~5
    9    15        SEND_VAL                                                     128
    5    16        DO_ICALL                                             $8      
    9    17      > RETURN                                                       $8
   10    18*     > RETURN                                                       null

End of function test_func

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
149.53 ms | 2775 KiB | 10 Q