3v4l.org

run code in 500+ PHP versions simultaneously
<?php class User { public function register($email, $password, $active = null, $default = 0, ...$attributes) { $argv = debug_backtrace(0, 1)[0]['args'] ?? []; $argc = count($argv); print_r([ '$argc' => $argc, '$argv' => $argv, ]); return [$email, $password, $attributes]; } } $foo = new User(); $foo->register('admin@test.com', 'pass1', ...[ 'id' => 'uuid-1', 'phone' => '012-345-6789', 'role' => 'admin', ]); echo PHP_EOL . '--------' . PHP_EOL; $foo->register(...[ 'id' => 'uuid-2', 'email' => 'test@test.com', 'phone' => '987-654-3210', 'name' => 'first last2', 'role' => 'tester', 'password' => 'pass2' ]);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/28O7r
function name:  (null)
number of ops:  15
compiled vars:  !0 = $foo
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   19     0  E >   NEW                                                  $1      'User'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   21     3        INIT_METHOD_CALL                                             !0, 'register'
          4        SEND_VAL_EX                                                  'admin%40test.com'
          5        SEND_VAL_EX                                                  'pass1'
   22     6        SEND_UNPACK                                                  <array>
          7        CHECK_UNDEF_ARGS                                             
   21     8        DO_FCALL                                          1          
   27     9        ECHO                                                         '%0A--------%0A'
   29    10        INIT_METHOD_CALL                                             !0, 'register'
   30    11        SEND_UNPACK                                                  <array>
         12        CHECK_UNDEF_ARGS                                             
   29    13        DO_FCALL                                          1          
   36    14      > RETURN                                                       1

Class User:
Function register:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/28O7r
function name:  register
number of ops:  26
compiled vars:  !0 = $email, !1 = $password, !2 = $active, !3 = $default, !4 = $attributes, !5 = $argv, !6 = $argc
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    5     0  E >   RECV                                                 !0      
          1        RECV                                                 !1      
          2        RECV_INIT                                            !2      null
          3        RECV_INIT                                            !3      0
          4        RECV_VARIADIC                                        !4      
    7     5        INIT_FCALL                                                   'debug_backtrace'
          6        SEND_VAL                                                     0
          7        SEND_VAL                                                     1
          8        DO_ICALL                                             $7      
          9        FETCH_DIM_IS                                         ~8      $7, 0
         10        FETCH_DIM_IS                                         ~9      ~8, 'args'
         11        COALESCE                                             ~10     ~9
         12        QM_ASSIGN                                            ~10     <array>
         13        ASSIGN                                                       !5, ~10
    8    14        COUNT                                                ~12     !5
         15        ASSIGN                                                       !6, ~12
   10    16        INIT_FCALL                                                   'print_r'
   11    17        INIT_ARRAY                                           ~14     !6, '%24argc'
   12    18        ADD_ARRAY_ELEMENT                                    ~14     !5, '%24argv'
         19        SEND_VAL                                                     ~14
   10    20        DO_ICALL                                                     
   15    21        INIT_ARRAY                                           ~16     !0
         22        ADD_ARRAY_ELEMENT                                    ~16     !1
         23        ADD_ARRAY_ELEMENT                                    ~16     !4
         24      > RETURN                                                       ~16
   16    25*     > RETURN                                                       null

End of function register

End of class User.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
159.67 ms | 2879 KiB | 10 Q