Code Comments

Programming Forum and web based access to our favorite programming groups.
For Programmers: Free Programming Magazines | New: Database administration forum
Registration is free! Edit your profileCalendarFind other membersFrequently Asked QuestionsSearch -> 
Post New Thread











Thread
Author

#31303 [Opn->Csd]: treating a string like a regular array leads to a fatal offset
ID:               31303
Updated by:       vrana@php.net
Reported By:      schmad at miller-group dot net
-Status:           Open
+Status:           Closed
Bug Type:         Documentation problem
Operating System: Mac OS X 10.3.7
PHP Version:      5.0.3
New Comment:

This bug has been fixed in the documentation's XML sources. Since the
online and downloadable versions of the documentation need some time
to get updated, we would like to ask you to be a bit patient.

Thank you for the report, and for helping us make our documentation
better.

I believe it is already documented in Backward Incompatible Changes
under Migrating from PHP 4 to PHP 5 in the sentence "Illegal use of
string offsets causes E_ERROR instead of E_WARNING."

However, I have added this to the String Type chapter: "However, this
syntax is deprecated as of PHP 4 and produces fatal error in PHP 5."


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

[2004-12-26 22:29:16] nlopess@php.net

opening..

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

[2004-12-26 20:29:13] derick@php.net

THen it should be documented.

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

[2004-12-26 20:08:32] schmad at miller-group dot net

Perhaps it isn't a bug, but it does break backward
compatibility with 4.3.

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

[2004-12-26 11:35:15] 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

This is expected, and not a bug. It doesn't make sense to do this at
all either.

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

[2004-12-26 08:07:14] schmad at miller-group dot net

Description:
------------
Using array functions on a string like count() or
unset() results in fatal offset errors which were not
encountered in 4.3.x code.

Reproduce code:
---------------
$link = 'bla';
unset($link['one']);
//In 4.x: No Error


$link = '';
count($link['two']);
//In 4.x: No Error

Expected result:
----------------
$link = 'bla';
unset($link['one']);
//In 4.x: No Error


$link = '';
count($link['two']);
//In 4.x: No Error

Actual result:
--------------
$link = 'bla';
unset($link['one']);
//Outputs: Fatal error: Cannot unset string offsets in
...


$link = '';
count($link['two']);
//Outputs: Fatal error: Cannot use string offset as an
array in ...


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


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

Report this thread to moderator Post Follow-up to this message
Old Post
vrana@php.net
12-30-04 01:56 AM


Sponsored Links




Last Thread Next Thread Next
Search this forum -> 
Post New Thread

PHP Documentation archive

Show a Printable Version Send to friend Email This Page to Someone! subscribe to this thread Receive updates to this thread
Computer Consultants
Programming Jobs
Visual Basic Controls
SQL Server Programming
Webservices
Java Security
Visual Studio
C# Programming
Visual J++
Software engineering
Open source Software
Perl Programming
PHP Programming
ASP Programming
ASP .NET Programming
Visual Basic Programming
Windows Scripting Host
Java Programming
Java Help
Java Beans
VBScript
Cobol
MAC Applications
Unix Programming
Forum Jump:
All times are GMT. The time now is 08:42 AM.

 
Free MCSE Braindumps | Real Estate Topics

Programming forum archive

Copyrights CodeComments.com 2004 - 2006

Powered by vBulletin Copyright 2000-2006 Jelsoft Enterprises Limited.