scope and public
- From: Jeff <jeff@xxxxxxxxxxxxxxx>
- Date: Thu, 12 Jun 2008 13:40:37 -0400
I'm working my way through learning php, it looks a lot like perl and then again it doesn't.
I'm confused about scope of variables and public. The PHP manual sometimes leaves me confused. I have some very simple questions.
I'm used to declaring global variables with either "our" or "my".
It looks like in php, it's just.
$my_variable; // not defined;
// $my_variable now = 'foo'; is that right?
Is that the only way? Do I have that wrong?
Now, I'm confused about the use of public in a class.
How is the public declaration different? Is it the same for instance, and unavailable as a class?
I'm used to putting all my objects in separate file. What's the naming convention for doing this in PHP.
Can I have methods of a class defined outside the class brackets? Can I do something like this:
The same as push?
Is there an easy way to add to the top of the array than the bottom?
What about shifting an element of the array?
And if you have mixed:
How is that ordered?
- Prev by Date: How-to select items from a list
- Next by Date: Re: method overloading.
- Previous by thread: How-to select items from a list
- Next by thread: Re: scope and public