|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2007-06-19 21:06 UTC] derick@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Jul 16 11:00:01 2026 UTC |
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