Re: Please save me from insanity - PHP4 / OO
| From: | John Holmes | Date: | Sun, 05 Dec 2004 18:00:51 +0000 |
| Subject: | Re: Please save me from insanity - PHP4 / OO | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-203527@lists.php.net to get a copy of this message | ||
Ben wrote:
class Ob {How about you explain what you're trying to do instead of asking why some random code snippet doesn't work (according to you)? The code does "work" for me, btw... for whatever it's supposed to be doing. $ob->prop is now a "Test" object...which is what the code does... For example, if you added var $foo = 'bar'; to the Test object and then printed out $ob->prop->foo, you'd get 'bar'. -- ---John Holmes... Amazon Wishlist: www.amazon.com/o/registry/3BEXC84AB3A5E/ php|architect: The Magazine for PHP Professionals – www.phparch.comvar $prop;} class Test {function setMe(&$ob) { $ob->prop = $this; }} $ob = new Ob(); $test = new Test(); $test->setMe($ob); if ($ob->prop) error_log("PHP is OK"); else error_log("PHP is a fucking MARE"); What is my problem here? Please help!