Re: Use of "var" in PHP4 OOP
var is used to declare a property for the class. But php allows you to
dynamically add property like the code you have given. Declaring
properties for the class is important specially when you are doing
frameworks so you could easily associate the properties from one class
to the other or you will let the user of your class know what are the
available properties.
Hope that helps a bit.
.
Relevant Pages
- Re: Where to declare Variables
... To minimize the actual php code on this page I include all the ... Now to prevent notice warning for the variable I set it in the ... If I declare it at the top of the file it is used the ... or it is pointing at a good practice. ... (comp.lang.php) - Re: Where to declare Variables
... the input fields have php variables to display the ... I just want to make sure that this just may be a limitation of the IDE ... first it is a good practice to declare the variables before using them. ... (comp.lang.php) - Re: Global vars - newbie
... > and the main body of the PHP? ... As the other posters said you need to declare $myvar global inside every ... // if $var is changed inside this function, ... (comp.lang.php) - Re: Passing a parameter in PHP
... I am writing some screen strictly in PHP. ... You only need declare a form, so that yu can send post and get variables with the program. ... You don't even need a submit button, you write minimal javascript the uses onclickto set up hidden variables and send the form back ..then you pick the values in those up as post or get variables. ... Bascally I know of three ways to chain ino a ew windows when yu clck on something. ... (comp.lang.javascript) - Re: Adventures in PHP - First steps.
... > By now, I've concluded that when you declare a variable, it takes it's type ... > from what you initialise it with. ... But perhaps a lack of uninitialised variables is a good thing. ... PHP is an untyped language. ... (comp.programming) |
|