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
Have you experienced this issue?
Rate the importance of this bug to you:

 [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: Thu Apr 25 11:01:30 2024 UTC