ID: 20932 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Class/Object related Operating System: Windows XP PHP Version: 4.2.3 New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php Previous Comments: ------------------------------------------------------------------------ [2002-12-11 04:47:43] [EMAIL PROTECTED] take the following example: <?php class MethodsOnly { //var $dummy; function doSomething() { print("OBJ: doing something\n"); } }// class $OBJ = new MethodsOnly(); $OBJ->doSomething(); print("empty(OBJ): ".(empty($OBJ) ? "true" : "false")."\n"); print("OBJ == null: ".(($OBJ == null) ? "true" : "false")."\n"); print("OBJ === null: ".(($OBJ === null) ? "true" : "false")."\n"); ?> it gives the following output: OBJ: doing something empty(OBJ): true OBJ == null: true OBJ === null: false now, if you uncomment the $dummy member variable: OBJ: doing something empty(OBJ): false OBJ == null: false OBJ === null: false Sure, one should/could use "static calls" - like MethodsOnly::doSomething() - in this case (class without member vars), but we discovered this when migrating a project from PHP3 to PHP4 .. and, anyway, shouldn't an existing object behave the same wether it has member variables or not? ;) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=20932&edit=1
