Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

What is the 'var' keyword used for 1

Status
Not open for further replies.

sherwoodclark

Programmer
Oct 17, 2006
20
0
0
US
I see the 'var' keyword used in some PHP class code before declaration of variables, but I can't find documentation anywhere on what this keyword is actually doing. Can anyone point me to documentation for this keyword?

Thanks
 
The var keyword denotes a start of a member variable declaration. What this keyword is actually doing? It says: see, that's a member variable in this class!
Take any doc about PHP classes and you can see this keyword explanation...
 
Thanks for the feedback. I assumed as much.

I went to and searched high and low for the 'var' keyword to understand just exactly what it was supposed to mean, and I could NOT find any reference to this keyword other than in a few code snippets.

If you have a link to some documentation for this keyword, I would really appreciate it.

Thanks again.
 
There really isn't any formal documentation for the "var" keyword, particularly since it's only a PHP4.x class construct. The section on Visibility in PHP5 classes ( does mention:
Note: The PHP 4 method of declaring a variable with the var keyword is still supported for compatibility reasons (as a synonym for the public keyword).





Want the best answers? Ask the best questions! TANSTAAFL!
 
Thanks so much. This was the data I was looking for. It appeared that the 'var' keyword was deprecated, but I just couldn't find the documentation to back it up.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top