ID: 11254
Updated by: cardinal
Reported By: [EMAIL PROTECTED]
Old-Status: Open
Status: Bogus
Bug Type: Scripting Engine problem
Operating system: 
PHP Version: 4.0.4pl1
Assigned To: 
Comments:

isset($t2{"nome"}) is evaluating to true because you're
using a string as an array, which is a perfectly legal
thing to do.  In this case, "nome" is being evaluated to
zero (As all strings evaluate to) and the isset is seeing
that $t2{0} exists, it's 'a' in the string 'asd'.

Side note, it's not recommended to use curly braces when
accessing array elements.  Use square brackets instead,

$array['key'] instead of $array{'key'}

Previous Comments:
---------------------------------------------------------------------------

[2001-06-02 22:23:01] [EMAIL PROTECTED]
$t1 = array("nome"=>"gabriel", "idade"=>"19");
$t2 = "asd";
$t3 = NULL ;

echo "<br><br>nn1: " . isset($t1{"nome"});
echo "<br><br>nn2: " . isset($t2{"nome"}); # there's NO "nome" defined! shouldn't it 
return FALSE? why does it retur TRUE ???
echo "<br><br>nn3: " . isset($t3{"nome"});
echo "<br><br>nn4: " . isset($t4{"nome"});
echo "<br><br>";
echo "<br><br>nn1: " . empty($t1{"nome"});
echo "<br><br>nn2: " . empty($t2{"nome"}); # It doesn't even exist! how can it be not 
even empty ???
echo "<br><br>nn3: " . empty($t3{"nome"});
echo "<br><br>nn4: " . empty($t4{"nome"});


---------------------------------------------------------------------------



ATTENTION! Do NOT reply to this email!
To reply, use the web interface found at http://bugs.php.net/?id=11254&edit=2


-- 
PHP Development Mailing List <http://www.php.net/>
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to