faqts : Computers : Programming : Languages : PHP : Common Problems : Variables

+ Search
Add Entry AlertManage Folder Edit Entry Add page to http://del.icio.us/
Did You Find This Entry Useful?

20 of 21 people (95%) answered Yes
Recently 9 of 10 people (90%) answered Yes

Entry

What are the default values of uninitalized variables in PHP?

Mar 3rd, 2000 09:13
Matt Gregory, deno vichas, Ben Udall,


All numerics are given the default value of 0.00
All strings are given a default value of NULL ("")
All boolean values are false (considered numeric 1 or 0, 0 is false)
All arrays are null with a length of 0;
You do not need to initalize variables in PHP.