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
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 12:01:30 2024 UTC