ID:               44863
 User updated by:  igordonin at gmail dot com
 Reported By:      igordonin at gmail dot com
 Status:           Bogus
 Bug Type:         Scripting Engine problem
 Operating System: Windows XP SP2
 PHP Version:      5.2.5
 New Comment:

You're wrong, var_dump says:

array(1) { ["Try_Login"]=> string(8) "conn_err" } 


It's so an array!


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

[2008-04-29 18:39:38] [EMAIL PROTECTED]

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

$variable is a string and not an array. 

Your error : "Fatal error: Cannot unset string offsets" is pretty
explicit about it. 

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

[2008-04-29 18:34:23] igordonin at gmail dot com

Description:
------------
Development Environment is PHP 5.2.5, Apache 2.2.

When requesting PHP to unset an array item, there's a fatal error:

Fatal error: Cannot unset string offsets in C:\[hidden]\index.php on
line 147

When I var_dump the array variable, the array item is not show as part
of that array, but the unset array item command is inside a if
(isset($variable["ArrayName"])) { ... which means that the item has to
exist in order for the unset to occur.

-----

On my production enviroment, though, I'm running PHP Version 4.3.9,
with Apache Handler 2.0.52(Oracle) | API Version 20020903, and it does
not cause a Fatal Error, but the error is still there. Here's the URL:
http://helpdesk.mozart.com.br/public/index.php
-> Try to connect with anything. It matters not, I think.

If this is not a bug, I do apologize. It's just that I've checked this
code so many times and I can't find anything wrong ...

Thanks in advance.

Reproduce code:
---------------
                # 1. Execute Query
                $Query["Try_Login"] = Query_Repository("Try_Login", 0, 2, 0);
                
echo "<br><br> This is the var_dump for array \$Query: <br>";
var_dump($Query);
echo "<br><br>";

if (isset( $Query["Try_Login"]["Error"] )) { echo
"<br><br>\$Query[\"Try_Login\"][\"Error\"] is set as: \"" .
$Query["Try_Login"]["Error"] . "\".<br><br>"; }
die();

Here are the URLs for the functions that you might need to take a look
at. I saved them as txt so you may check them out.

Query_Repository:
http://helpdesk.mozart.com.br/public/query_repository.txt

Request_Value:
http://helpdesk.mozart.com.br/public/request_value.txt

validate_input:
http://helpdesk.mozart.com.br/public/validate_input.txt

Expected result:
----------------
$Query["Try_Login"] was supposed to be set only as string, either with
"conn_err" or "conn_ok". That's all var_dump really shows, and that's
what it's supposed to be ...

Actual result:
--------------
... but it was also supposed to not have an ["Error"] array Item. It's
not shown while using var_dump, but "isset" returns true, and it's value
is set to string "c". Still, I cannot unset it for it may produce a
fatal error.

Fatal error: Cannot unset string offsets in C:\[hidden]\index.php on
line 147


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


-- 
Edit this bug report at http://bugs.php.net/?id=44863&edit=1

Reply via email to