How did you define calobject_ce ?

    It's supposed to be 'zend_class_entry *', so if you haven't
    defined calobject_ce in your code as struct directly I think
    you should not use the address operator '&' in front of
    calobject_ce.

On Fri, Mar 01, 2002 at 05:03:32PM +0100, Klaus Reimer wrote : 
> 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

-- 
Please always Cc to me when replying to me on the lists.
GnuPG Key: http://guru.josefine.at/~mfischer/C2272BD0.asc

-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to