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
 [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

Pull Requests

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: Mon Dec 30 14:01:28 2024 UTC