php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #29883 isset gives invalid values on strings
Submitted: 2004-08-29 13:11 UTC Modified: 2004-12-01 15:03 UTC
From: tomas_matousek at hotmail dot com Assigned: andi (profile)
Status: Closed Package: Scripting Engine problem
PHP Version: 5.0.1 OS: WinXP
Private report: No CVE-ID: None
View Add Comment Developer Edit
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
22 + 44 = ?
Subscribe to this entry?

 
 [2004-08-29 13:11 UTC] tomas_matousek at hotmail dot com
Description:
------------
isset applied on a string with negative index returns true.
It should return false.

Reproduce code:
---------------
$x = "bug";
var_dump(isset($x[-1]));

Expected result:
----------------
bool(false)

Actual result:
--------------
bool(true)

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-11-29 15:11 UTC] tony2001@php.net
Andi, please, review & commit these two patches:
http://tony2001.phpclub.net/dev/tmp/bug29883_5_0.diff
http://tony2001.phpclub.net/dev/tmp/bug29883_HEAD.diff

The bug really affects BC issues and should have been fixed long ago IMO.
 [2004-12-01 15:03 UTC] dmitry@php.net
Fixed in CVS HEAD and PHP_5_0.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 15:01:56 2024 UTC