Var dump(): Difference between revisions

MorMythos (talk | contribs)
No edit summary
MorMythos (talk | contribs)
 
(One intermediate revision by the same user not shown)
Line 20: Line 20:


===Example===
===Example===
"The form had been submitting for three days without saving anything. She finally dropped a
 
<code>var_dump($user)</code> at the top of the handler and found it immediately: <code>NULL</code>.
<code>$hot_women = ['Tinashe', 'Senait Gidey', 'Jisoo'];</code><br>
The object she had been passing around, calling methods on, treating as a fully formed thing,
<code>var_dump($hot_women);</code>
had never been instantiated. It was nothing. It had always been nothing."
 
Outputs:
 
<pre>
array(3) {
  [0]=> string(7) "Tinashe"
  [1]=> string(12) "Senait Gidey"
  [2]=> string(5) "Jisoo"
}
</pre>
 
Three items in the array. Each one identified by its position, its type, its length, and its value.
Nothing assumed. Nothing hidden.


===See also===
===See also===