php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #30886 Issue E_STRICT errors for deprecated array notation for string char access
Submitted: 2004-11-24 19:35 UTC Modified: 2014-11-01 23:12 UTC
From: php-bugs-2004 at ryandesign dot com Assigned:
Status: Wont fix Package: *General Issues
PHP Version: 5.0.2 OS: N/A
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: php-bugs-2004 at ryandesign dot com
New email:
PHP Version: OS:

 

 [2004-11-24 19:35 UTC] php-bugs-2004 at ryandesign dot com
Description:
------------
The E_STRICT option purports to issue warnings when 
using deprecated features. I would like to see warnings 
issued when using the array notation of accessing 
characters in a string, since this has been deprecated 
since PHP 4 and can cause problems ( as seen in
http://bugs.php.net/bug.php?id=29271 )

Reproduce code:
---------------
$test = 'blah';

$test[2] = 'x'; // <-- would like this to issue
                //     an error of type 2048

Expected result:
----------------
$test == 'blxh' and an error that the array notation is 
deprecated, use {} notation instead

Actual result:
--------------
$test == 'blxh' and no error of any kind

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-11-01 23:12 UTC] requinix@php.net
-Status: Open +Status: Wont fix -Package: Feature/Change Request +Package: *General Issues
 [2014-11-01 23:12 UTC] requinix@php.net
Stance has changed: both [] and {} are acceptable.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 00:01:36 2025 UTC