|
Posted by Jochem Maas on 11/17/05 17:32
Chris Boget wrote:
>> I'm seeing the following line showing up in my logs:
>>
>> 08:08:30 [warning] [Unknown][0]: Unknown(): Unable to call () -
>> function does not exist
>>
>> and I've narrowed it down to this line of code:
>
>
> Update, it turns out it's not the settype(). Here's a larger context of
> the offending
> area of code:
>
> $query = '<my query>';
>
> $queryResult =& $DBAccess->db->query( $query );
>
> if( !( DB::isError( $queryResult ))) {
> $tmpArray = array();
> while( $queryResult->fetchInto( $tmpArray )) {
> $dbObject = new IPI_OfficeDetailsInterface();
> $dbObject->_populateMemberVariables( $tmpArray );
> $retval[] = $dbObject;
>
> $tmpArray = array();
> settype( $dbObject, "null" );
why not just do:
unset($dbObject);
?
>
> }
> }
>
> The line to concentrate on is this one:
>
> $dbObject = new IPI_OfficeDetailsInterface();
>
> If I leave it as above, no error occurs. But I instead instantiate
> $dbObject
> as follows (which is what I was doing originally)
>
> $dbObject &= new IPI_OfficeDetailsInterface();
so you want to do a bitwise AND on a non-existant variable and a newly creately object??
maybe you meant to do:
$dbObject =& new IPI_OfficeDetailsInterface();
>
> then the error shows up in the log again. The error only goes away if I
> either
> remove the settype() function call or I remove the '&' in the
> instantiation.
>
> Why?
>
> thnx,
> Chris
Navigation:
[Reply to this message]
|