Req #30886 [Opn->Wfx]: Issue E_STRICT errors for deprecated array notation for string char access

From: Date: Sat, 01 Nov 2014 23:12:24 +0000
Subject: Req #30886 [Opn->Wfx]: Issue E_STRICT errors for deprecated array notation for string char access
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-188407@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=30886&edit=1 ID: 30886 Updated by: requinix@php.net Reported by: php-bugs-2004 at ryandesign dot com Summary: Issue E_STRICT errors for deprecated array notation for string char access -Status: Open +Status: Wont fix Type: Feature/Change Request -Package: Feature/Change Request +Package: *General Issues Operating System: N/A PHP Version: 5.0.2 Block user comment: N Private report: N New Comment: Stance has changed: both [] and {} are acceptable. Previous Comments: ------------------------------------------------------------------------ [2004-11-24 19:35:33] 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 ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=30886&edit=1

« previous php.bugs (#188407) next »