Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What does an array with a * mean? [duplicate]

Tags:

php

I tried searching for this, but see below:

Array
(
[*response] => Array
    (
        [body] => 

What does it mean if response has an asterisk before it?

like image 273
rav Avatar asked Dec 18 '22 11:12

rav


1 Answers

I believe that means it is a protected variable.

If an object is converted to an array, the result is an array whose elements are the object's properties. The keys are the member variable names, with a few notable exceptions: integer properties are unaccessible; private variables have the class name prepended to the variable name; protected variables have a '*' prepended to the variable name. These prepended values have null bytes on either side.

(Source)

like image 57
Timothy G. Avatar answered Jan 01 '23 21:01

Timothy G.