php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #52254 string accessor deprecation
Submitted: 2010-07-05 17:52 UTC Modified: 2010-10-20 06:41 UTC
Votes:2
Avg. Score:4.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: phpbug at wisl dot de Assigned: kalle (profile)
Status: Closed Package: Documentation problem
PHP Version: 5.3.2 OS: all
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: phpbug at wisl dot de
New email:
PHP Version: OS:

 

 [2010-07-05 17:52 UTC] phpbug at wisl dot de
Description:
------------
http://www.php.net/manual/en/migration53.deprecated.php says:
"The use of {} to access string offsets is deprecated. Use [] instead."

But in the source code this deprecation does not exists neither in the PHP_5_3 branch nor in the trunk.

History of that code:

http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/Zend/zend_compile.c?r1=200552&r2=200603
	-> added deprecation

http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/Zend/zend_compile.c?r1=200603&r2=200604
	-> changed message level to strict

http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/Zend/zend_compile.c?r1=200604&r2=201057
	-> deactivated with commit comment: "Removed {} E_STRICT pending furher discussion, may be introduced later on.")

http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/Zend/zend_compile.c?r1=253597&r2=253598
	-> back to deprecated

http://svn.php.net/viewvc/php/php-src/branches/PHP_5_3/Zend/zend_compile.c?r1=281774&r2=286406
	-> code was removed on year ago ("Cosmetic changes")

http://php.net/manual/en/language.types.string.php also contains the deprecation notice.
And the note "Accessing variables of other types using [] or {} silently returns NULL.". I believe this note is wrong (or at least misleading), because accessing variables of the type 'array' will return normal values.



Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-09-21 18:13 UTC] markskilbeck@php.net
Automatic comment from SVN on behalf of markskilbeck
Revision: http://svn.php.net/viewvc/?view=revision&revision=303645
Log: Little clarification - [] *does* work for arrays and some objects ;) #52254
 [2010-10-20 02:17 UTC] kalle@php.net
Automatic comment from SVN on behalf of kalle
Revision: http://svn.php.net/viewvc/?view=revision&revision=304518
Log: The curly-brackets-string-index-accessor-syntax does not emit any deprecation notice, although the
original notice have been on and off for PHP 5.x, it does not in the current version, thrus we should
not label it as deprecated.

Related to bug #52254
 [2010-10-20 02:17 UTC] kalle@php.net
-Status: Open +Status: Closed -Assigned To: +Assigned To: kalle
 [2010-10-20 02:17 UTC] kalle@php.net
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.

The deprecation note is gone now
 [2010-10-20 06:41 UTC] philip@php.net
And it's also worth mentioning that this was discussed on the internals list, and 
it was determined that this is no longer deprecated (and never will be).

Archive: http://markmail.org/message/w3aei4i4hoaxqflp
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Tue Apr 29 13:01:29 2025 UTC