Hi,
I have a slight problem with zend_get_parameters(). I want to pass an
optional object of a specified class to the constructor of another class. I
do this in the constructor:
zval *Parent;
Parent=NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC,
"|O!",&Parent,&calobject_ce)==FAILURE) return;
if I don't pass a parameter to the constructor, *Parent is NULL, so the
"optional" part is working. I can also pass NULL as argument, this is
working, too. But I can't pass an object of the specified class. I always get
this Warning:
calobject() expects parameter 1 to be calobject, object given in ...
If I var_dump() the object I passed as argument I get this output:
object(calobject)(0) { }
So the object IS an instance of class calobject, or not? Don't understand
this. And even if I pass an object of the wrong class, the warning message
should look like this, or not? :
calobject() expects parameter 1 to be calobject, csomethingother given in
But the warning I get does always say "object given in ...".
What I am doing wrong? Or is this functionality not completely implemented up
to now? I am using PHP 4.1.1.
--
Bye, K <http://www.ailis.de/~k/>
[A735 47EC D87B 1F15 C1E9 53D3 AA03 6173 A723 E391]
(Finger [EMAIL PROTECTED] to get public key)
--
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php