3v4l.org

run code in 500+ PHP versions simultaneously
<?php class User {}; class UserList { private $list = []; public function __construct(User ...$user) { $this->list = $user; } public function add(User $user) { $this->list[] = $user; } public function all(): array { return $this->list; } } // // Usage // $userList = new UserList(new User(), new User()); $userList->add(new User()); print_r($userList->all());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JNY1Z
function name:  (null)
number of ops:  20
compiled vars:  !0 = $userList
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   28     0  E >   NEW                                                  $1      'UserList'
          1        NEW                                                  $2      'User'
          2        DO_FCALL                                          0          
          3        SEND_VAR_NO_REF_EX                                           $2
          4        NEW                                                  $4      'User'
          5        DO_FCALL                                          0          
          6        SEND_VAR_NO_REF_EX                                           $4
          7        DO_FCALL                                          0          
          8        ASSIGN                                                       !0, $1
   30     9        INIT_METHOD_CALL                                             !0, 'add'
         10        NEW                                                  $8      'User'
         11        DO_FCALL                                          0          
         12        SEND_VAR_NO_REF_EX                                           $8
         13        DO_FCALL                                          0          
   32    14        INIT_FCALL                                                   'print_r'
         15        INIT_METHOD_CALL                                             !0, 'all'
         16        DO_FCALL                                          0  $11     
         17        SEND_VAR                                                     $11
         18        DO_ICALL                                                     
         19      > RETURN                                                       1

Class User: [no user functions]
Class UserList:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JNY1Z
function name:  __construct
number of ops:  4
compiled vars:  !0 = $user
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    9     0  E >   RECV_VARIADIC                                        !0      
   11     1        ASSIGN_OBJ                                                   'list'
          2        OP_DATA                                                      !0
   12     3      > RETURN                                                       null

End of function __construct

Function add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JNY1Z
function name:  add
number of ops:  5
compiled vars:  !0 = $user
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   14     0  E >   RECV                                                 !0      
   16     1        FETCH_OBJ_W                                          $1      'list'
          2        ASSIGN_DIM                                                   $1
          3        OP_DATA                                                      !0
   17     4      > RETURN                                                       null

End of function add

Function all:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/JNY1Z
function name:  all
number of ops:  5
compiled vars:  none
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   21     0  E >   FETCH_OBJ_R                                          ~0      'list'
          1        VERIFY_RETURN_TYPE                                           ~0
          2      > RETURN                                                       ~0
   22     3*       VERIFY_RETURN_TYPE                                           
          4*     > RETURN                                                       null

End of function all

End of class UserList.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
160.6 ms | 2032 KiB | 14 Q