first off:
PHP Version : PHP 4.4.2 (cli)
Webserver : Apache 1.3.31
I need some serious help here, this is driving me up the wall
I'm finding some seriously strange behaviour relating to objects
I find that sometimes when I apply a method on an object, it executes but then bombs out with Call to a member function on a non-object but infact it is an object!
I test it with is_object and it passes
I dump the result of get_class_methods ($object) and the list includes the method I wish to execute
Next is the only inclination that something wrong is happening.
So in the last ditch attempt at find the problem I var_dump the object just before I return it from it's function which creates it and I get the following:
object(whatson_itmartistmodel)(11) {
["attributes"]=>
NULL
["errormessage"]=>
NULL
["errorcode"]=>
NULL
["classname"]=>
NULL
["log"]=>
NULL
["associates"]=>
array(0) {
}
["saveCallbacks"]=>
NULL
["id"]=>
string(4) "3511"
["name"]=>
string(14) "Satoshi Tomiie"
["alias"]=>
string(1) "0"
["active"]=>
string(1) "1"
}
Then I var_dump the variable whose value has been assigned the output of the aforemention function (ie. the object in question) and this is the output.
object(whatson_itmattributesmetaforeigntypemodel)(9) {
["attributes"]=>
NULL
["errormessage"]=>
NULL
["errorcode"]=>
NULL
["classname"]=>
NULL
["log"]=>
NULL
["associates"]=>
array(0) {
}
["saveCallbacks"]=>
NULL
["id"]=>
string(1) "2"
["name"]=>
string(5) "venue"
}
NULL
You'll notice a trailing NULL I believe this is the problem.
Can someone please shed some light on this.