php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #9420 url created arrays and isset
Submitted: 2001-02-23 09:16 UTC Modified: 2001-07-09 08:19 UTC
From: shk at mindpass dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 4.0.4pl1 OS: Redhat Linux 6.1
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: shk at mindpass dot com
New email:
PHP Version: OS:

 

 [2001-02-23 09:16 UTC] shk at mindpass dot com
Make a file like this:

while($pair = each($i)) {
	if (isset($i[$pair["key"]]["sysaction"])) {
		echo "<br>We have a bug!!<br>";
	} else {
		echo "<br>There are no bugs!!<br>";
	}
}

and call it like this:

phpbug.php?i[mwsl]=0

Now isset will return true. If I create the array in php instead, it works fine.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-07-09 08:19 UTC] jeroen@php.net
Very nasty, but not a bug :)

This proves why $string[offset] should be deprecated... took
me 10 minutes to find this out...

Anyway, $pair["key"] == 'mwel'

$i[$pair["key"]] = "0", and that is correct

And doing [ ] on a string will be interpreted as $str[offset].

As is in the manual, sysaction will be converted to 0, so
that means: get the first character of the string "0"

shk: You chould have tracked it down a bit more... by
var_dumping step by step, and see that '0'['sysaction']
caused the same thing...
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 19:01:28 2024 UTC