php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #36097 wrong analisys of strings in conditions
Submitted: 2006-01-20 11:04 UTC Modified: 2006-01-20 11:13 UTC
Votes:1
Avg. Score:5.0 ± 0.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:1 (100.0%)
From: php at samokhvalov dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.1.2 OS: Linux Fedora4, Windows 2003
Private report: No CVE-ID: None
 [2006-01-20 11:04 UTC] php at samokhvalov dot com
Description:
------------
Just look at the examples...

Reproduce code:
---------------
$var = "test";
if ($var["field"]) {
    echo "suprise!";
}

or 

$var = "test";
if (isset($var["field"])) {
    echo "suprise!";
}

Expected result:
----------------
No output

Actual result:
--------------
"suprise!" being printed as a result in both cases

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-01-20 11:13 UTC] derick@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 16 14:01:33 2025 UTC