ID:               41742
 Updated by:       [EMAIL PROTECTED]
 Reported By:      gatorv at gmail dot com
-Status:           Open
+Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Windows Vista
 PHP Version:      5.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

You need to implement __isset() to catch this.


Previous Comments:
------------------------------------------------------------------------

[2007-06-19 20:51:56] gatorv at gmail dot com

Description:
------------
If you use a language construct ej: empty on a object and want to call
a magic function ej: __get, the function is not called and the function
fails.

Reproduce code:
---------------
class Test {
     public $input;

     public function __construct() {
          $this->input = array( "foo" => "bar" );
     }

     public function __get( $var ) {
         return $this->input[$var];
     }
}

$test = new Test();
if( empty( $test->foo ) ) {
     echo "Foo on Test is empty";
} else {
     echo "Foo on Test is not empty";
}

Expected result:
----------------
Foo on Test is not empty.

Actual result:
--------------
Foo on Test is empty


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=41742&edit=1

Reply via email to