Thanks a lot Greg - those pesky &s! Code now all working...
Greg Beaver wrote:
Ben wrote:
class Ob {
var $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");
You should
Ben wrote:
class Ob {
var $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");
You should use "if (is_a($ob->prop, 'test'))"
Greg
--
PHP General Mailing List (http://www.
Ben wrote:
Thanks a lot for your responses guys. Unfortunately it still isn't
working for me. I've tried both :
$ob->prop = &$this
and$ob->prop &= $this (just in case)
Neither produce a "PHP is OK".
I'm using version 4.2.2 btw. (If ONLY I was on 5)
Thanks again,
Ben
Greg wrote:
class Test
Hello,
On 12/05/2004 03:46 PM, Ben wrote:
$ob->prop = $this;
It should be $ob->prop = &$this; under PHP 4/Zend Engine 1.
--
Regards,
Manuel Lemos
PHP Classes - Free ready to use OOP components written in PHP
http://www.phpclasses.org/
PHP Reviews - Reviews of PHP books and other products
ht
Thanks a lot for your responses guys. Unfortunately it still isn't
working for me. I've tried both :
$ob->prop = &$this
and $ob->prop &= $this (just in case)
Neither produce a "PHP is OK".
I'm using version 4.2.2 btw. (If ONLY I was on 5)
Thanks again,
Ben
Greg Beaver wrote:
Ben wrote
Ben wrote:
class Ob {
var $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!
You've run i
6 matches
Mail list logo