3v4l.org

run code in 300+ PHP versions simultaneously
<?php class Auth_Model_User { /** * Allowed fields * * @var array */ protected $_fields = array( 'id_acl_user', 'role', 'username', 'email', 'password_changed_at', ); /** * Userdata * * @var array */ protected $_data = array(); public function __construct($data = null) { $this->_data['role'] = 'bar'; } /** * @return array */ public function toArray() { return array_merge(array_fill_keys($this->_fields, null), $this->_data); } } $user = new Auth_Model_User(); var_dump($user->toArray());
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Q9uJ
function name:  (null)
number of ops:  9
compiled vars:  !0 = $user
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   41     0  E >   NEW                                              $1      'Auth_Model_User'
          1        DO_FCALL                                      0          
          2        ASSIGN                                                   !0, $1
   42     3        INIT_FCALL                                               'var_dump'
          4        INIT_METHOD_CALL                                         !0, 'toArray'
          5        DO_FCALL                                      0  $4      
          6        SEND_VAR                                                 $4
          7        DO_ICALL                                                 
          8      > RETURN                                                   1

Class Auth_Model_User:
Function __construct:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Q9uJ
function name:  __construct
number of ops:  5
compiled vars:  !0 = $data
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   26     0  E >   RECV_INIT                                        !0      null
   28     1        FETCH_OBJ_W                                      $1      '_data'
          2        ASSIGN_DIM                                               $1, 'role'
          3        OP_DATA                                                  'bar'
   29     4      > RETURN                                                   null

End of function __construct

Function toarray:
Finding entry points
Branch analysis from position: 0
1 jumps found. (Code = 62) Position 1 = -2
filename:       /in/2Q9uJ
function name:  toArray
number of ops:  12
compiled vars:  none
line      #* E I O op                           fetch          ext  return  operands
-------------------------------------------------------------------------------------
   36     0  E >   INIT_FCALL                                               'array_merge'
          1        INIT_FCALL                                               'array_fill_keys'
          2        FETCH_OBJ_R                                      ~0      '_fields'
          3        SEND_VAL                                                 ~0
          4        SEND_VAL                                                 null
          5        DO_ICALL                                         $1      
          6        SEND_VAR                                                 $1
          7        FETCH_OBJ_R                                      ~2      '_data'
          8        SEND_VAL                                                 ~2
          9        DO_ICALL                                         $3      
         10      > RETURN                                                   $3
   37    11*     > RETURN                                                   null

End of function toarray

End of class Auth_Model_User.

Generated using Vulcan Logic Dumper, using php 8.0.0


preferences:
149.72 ms | 1396 KiB | 19 Q