|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2009-11-21 21:13 UTC] tyra3l at gmail dot com
[2009-11-23 13:28 UTC] jani@php.net
[2009-11-23 14:07 UTC] tyra3l at gmail dot com
[2009-11-24 21:54 UTC] felipe@php.net
[2009-11-24 21:54 UTC] svn@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sun Oct 26 03:00:01 2025 UTC |
Description: ------------ If you try to check the existence of a property on an array, suprisingly you wont get any error or notice, but you will get the results as you were checking with the correct type. Reproduce code: --------------- <?php $a = array('foo' => 'bar'); echo "<pre>";var_dump(isset($a->foo));echo "</pre>"; echo "<pre>";var_dump(isset($a->asd));echo "</pre>"; echo "<pre>";var_dump(empty($a->foo));echo "</pre>"; echo "<pre>";var_dump(empty($a->asd));echo "</pre>"; echo "<pre>";var_dump(@$a->foo);echo "</pre>"; Expected result: ---------------- Fatal error: Cannot use array as object in ... OR bool(false) bool(false) bool(true) bool(true) NULL Actual result: -------------- bool(true) bool(false) bool(false) bool(true) NULL