|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2013-12-09 20:48 UTC] requinix@php.net
-Status: Open
+Status: Not a bug
[2013-12-09 20:48 UTC] requinix@php.net
[2013-12-09 22:15 UTC] kenyon dot jh at gmail dot com
[2013-12-09 22:24 UTC] requinix@php.net
[2013-12-09 22:32 UTC] kenyon dot jh at gmail dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Dec 13 08:00:01 2025 UTC |
Description: ------------ My PHP version wasn't an option, so it is actually "PHP Version 5.4.4-14+deb7u5" and my system is Linux toshiba 3.2.0-4-amd64 #1 SMP Debian 3.2.51-1 x86_64 Basically, when referencing an variable through a class (I only tested with __set and __get) it empty() returns true, even when it should return false. Since it is kind of hard to explain, I posted a script below that demonstrates what I am talking about. Test script: --------------- <?php class testing { protected $_response = array(); public function __set($key, $value) { $this->_response[$key] = $value; } public function __get($key) { return $this->_response[$key]; } } $testing = new testing(); $testing->foo = 'bar'; var_dump($testing->foo); //Returns 'string(3) "bar" var_dump(empty($testing->foo)); //Returns bool(true) ?> Expected result: ---------------- Line 17 should return bool(false) Actual result: -------------- Line 17 actually returns bool(true)