#26413 [NEW]: isset of array index of a non-array returns incorrectly

From: Date: Tue, 25 Nov 2003 19:59:18 +0000
Subject: #26413 [NEW]: isset of array index of a non-array returns incorrectly
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-51022@lists.php.net to get a copy of this message
From:             james at gogo dot co dot nz
Operating system: Linux mortimer 2.4.20 #1 Sat Aug
PHP version:      4.3.3
PHP Bug Type:     Reproducible crash
Bug description:  isset of array index of a non-array returns incorrectly

Description:
------------
Using isset to test for the existance of an array index on a non array (in
this case string '4') returns true, when plainly, $foo has no element
indexed 'bar';


Reproduce code:
---------------
<?php
	$foo = '4';
	if(isset($foo['bar']))
	{
		echo "Uh Oh";
	}
      else
      {
            echo "S'all Good";
      }
?>


Expected result:
----------------
S'all Good

Actual result:
--------------
Uh Oh

-- 
Edit bug report at http://bugs.php.net/?id=26413&edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=26413&r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=26413&r=trysnapshot5
Fixed in CVS:               http://bugs.php.net/fix.php?id=26413&r=fixedcvs
Fixed in release:           http://bugs.php.net/fix.php?id=26413&r=alreadyfixed
Need backtrace:             http://bugs.php.net/fix.php?id=26413&r=needtrace
Try newer version:          http://bugs.php.net/fix.php?id=26413&r=oldversion
Not developer issue:        http://bugs.php.net/fix.php?id=26413&r=support
Expected behavior:          http://bugs.php.net/fix.php?id=26413&r=notwrong
Not enough info:            http://bugs.php.net/fix.php?id=26413&r=notenoughinfo
Submitted twice:            http://bugs.php.net/fix.php?id=26413&r=submittedtwice
register_globals:           http://bugs.php.net/fix.php?id=26413&r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=26413&r=php3
Daylight Savings:           http://bugs.php.net/fix.php?id=26413&r=dst
IIS Stability:              http://bugs.php.net/fix.php?id=26413&r=isapi
Install GNU Sed:            http://bugs.php.net/fix.php?id=26413&r=gnused
Floating point limitations: http://bugs.php.net/fix.php?id=26413&r=float


Thread (5 messages)

« previous php.bugs (#51022) next »