3v4l.org

run code in 500+ PHP versions simultaneously
<?php class Users { public $listOfUsers = []; function add($stringOrArray): void { array_push($this->listOfUsers, ...(array)$stringOrArray); } } $users = new Users; $users->add('Terrell Irving'); $users->add(['Magdalen Sara Tanner', 'Chad Niles']); $users->add(['Mervin Spearing']); var_export($users->listOfUsers);
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6D9Pd
function name:  (null)
number of ops:  17
compiled vars:  !0 = $users
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
   13     0  E >   NEW                                                  $1      'Users'
          1        DO_FCALL                                          0          
          2        ASSIGN                                                       !0, $1
   14     3        INIT_METHOD_CALL                                             !0, 'add'
          4        SEND_VAL_EX                                                  'Terrell+Irving'
          5        DO_FCALL                                          0          
   15     6        INIT_METHOD_CALL                                             !0, 'add'
          7        SEND_VAL_EX                                                  <array>
          8        DO_FCALL                                          0          
   16     9        INIT_METHOD_CALL                                             !0, 'add'
         10        SEND_VAL_EX                                                  <array>
         11        DO_FCALL                                          0          
   17    12        INIT_FCALL                                                   'var_export'
         13        FETCH_OBJ_R                                          ~7      !0, 'listOfUsers'
         14        SEND_VAL                                                     ~7
         15        DO_ICALL                                                     
         16      > RETURN                                                       1

Class Users:
Function add:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/6D9Pd
function name:  add
number of ops:  9
compiled vars:  !0 = $stringOrArray
line      #* E I O op                               fetch          ext  return  operands
-----------------------------------------------------------------------------------------
    7     0  E >   RECV                                                 !0      
    9     1        INIT_FCALL                                                   'array_push'
          2        FETCH_OBJ_W                                          $1      'listOfUsers'
          3        SEND_REF                                                     $1
          4        CAST                                              7  ~2      !0
          5        SEND_UNPACK                                                  ~2
          6        CHECK_UNDEF_ARGS                                             
          7        DO_ICALL                                                     
   10     8      > RETURN                                                       null

End of function add

End of class Users.

Generated using Vulcan Logic Dumper, using php 8.5.0


preferences:
156.97 ms | 1882 KiB | 14 Q