How to check if an object exists

From: Date: Tue, 24 Jan 2006 21:35:16 +0000
Subject: How to check if an object exists
Groups: php.general 
Request: Send a blank email to php-general+get-229187@lists.php.net to get a copy of this message
I have sort of a silly question. I'm running SugarCRM and trying to track down an error. I dug up the error from the httpd error log and then started checking into the code myself. The error appears to be a code issue, but since I don't know how to properly check to see if an object is valid, I'm not really sure what the correct coding should be. The system is a FreeBSD 5.3 box with Apache 2.0.55 and PHP 5.1.2. Everything appears to run alright except when sending an email with SugarCRM then a entry in the httpd error log appears PHP Notice: Object of class UploadFile could not be converted to int in sugar/modules/Emails/Save.php line 116 The code block looks like this in save.php $upload_file = new UploadFile('email_attachment'.$i); if ($upload_file == -1) { <----- Line 116 continue; } Does anyone know if this is the proper way to check for an Objects existence and where I can find more information on doing so? Thanks, Derrick Shoemake

« previous php.general (#229187) next »