RE: [PHP] OOP with PHP
| From: | Scott Hurring | Date: | Tue, 21 May 2002 18:14:03 +0000 |
| Subject: | RE: [PHP] OOP with PHP | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-98626@lists.php.net to get a copy of this message | ||
Try it out for yourself. :-
class Test{
var $x = '';
function Test(){}
}
$x = new Test();
$y = new Test();
$x->x = "Way";
$y->x = "No";
print $y->x . $x->x;
---
Scott Hurring
Systems Programmer
EAC Corporation
ScottH@eac.com
Voice: 201-462-2149
Fax: 201-288-1515
> -----Original Message-----
> From: Erik Price [mailto:pricee@hhbrown.com]
> Sent: Tuesday, May 21, 2002 2:14 PM
> To: php-general@lists.php.net
> Subject: [PHP] OOP with PHP
>
>
> Yesterday, I read in the archives somewhere that in PHP, class
> attributes are all static attributes (class variables), not instance
> variables. (Figures, I can't find it again, so I can't provide a
> link.) In other words, the attributes apply to every single
> instance of
> an object. This contradicts my limited experience with OOP
> in PHP, but
> I hoped someone could confirm this before I write up this giant class
> I'm working on.
>
> Thanks!
>
>
> Erik
>
>
>
>
>
> ----
>
> Erik Price
> Web Developer Temp
> Media Lab, H.H. Brown
> pricee@hhbrown.com
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>