Bug #9420 Updated: url created arrays and isset

From: Date: Mon, 09 Jul 2001 12:19:25 +0000
Subject: Bug #9420 Updated: url created arrays and isset
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-59276@lists.php.net to get a copy of this message
ID: 9420 Updated by: jeroen Reported By: shk@mindpass.com Old Status: Open Status: Bogus Bug Type: Scripting Engine problem Operating System: Redhat Linux 6.1 PHP Version: 4.0.4pl1 New Comment: 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... Previous Comments: ------------------------------------------------------------------------ [2001-02-23 09:16:08] shk@mindpass.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. ------------------------------------------------------------------------ ATTENTION! Do NOT reply to this email! To reply, use the web interface found at http://bugs.php.net/?id=9420&edit=1

« previous php.dev (#59276) next »