Req #45085 [Csd->Nab]: {} is better than [] for string access

From: Date: Sat, 14 Apr 2012 02:58:08 +0000
Subject: Req #45085 [Csd->Nab]: {} is better than [] for string access
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-169577@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=45085&edit=1 ID: 45085 Updated by: aharvey@php.net Reported by: noah at dizzler dot com Summary: {} is better than [] for string access -Status: Closed +Status: Not a bug Type: Feature/Change Request Package: *General Issues PHP Version: 6CVS-2008-05-24 (CVS) -Assigned To: nikic +Assigned To: Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2012-04-13 20:30:21] nikic@php.net Closing this as PHP 6 doesn't exist anymore and {} is not deprecated in 5.4. ------------------------------------------------------------------------ [2008-05-24 01:00:22] noah at dizzler dot com Description: ------------ I am very upset that {} string access is being depreciated in PHP 6. $foo = 'bar'; $foo{2} = 't'; In my opinion... $foo{2} is MUCH easier to read and understand while developing, because you know exactly what it means, $foo[2] is ambiguous to read, and problematic during development because $foo could be an array or a string, and in either case the code will execute without errors or notices if $foo is not the vartype you intended it to be. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=45085&edit=1

« previous php.bugs (#169577) next »