|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #52399 Negative character index
Submitted: 2010-07-22 06:07 UTC Modified: 2010-07-23 12:00 UTC
Avg. Score:3.5 ± 1.4
Reproduced:10 of 14 (71.4%)
Same Version:10 (100.0%)
Same OS:10 (100.0%)
From: olamedia at gmail dot com Assigned:
Status: Duplicate Package: Strings related
PHP Version: Irrelevant OS:
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.
Block user comment
Status: Assign to:
Bug Type:
From: olamedia at gmail dot com
New email:
PHP Version: OS:


 [2010-07-22 06:07 UTC] olamedia at gmail dot com
Retrieve characters from string end using negative index value.

Test script:
$string = 'abc';
echo $string[-1]; // 'c'


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-23 12:00 UTC]
-Status: Open +Status: Duplicate
 [2010-07-23 12:00 UTC]
This is a duplicate of request #17077.

In terms of the feature itself, it has been discussed before. The 2005
developer meeting resulted in a resolution to implement string slicing,
which would enable this feature, but as far as I know, there's been no
further movement on this since.
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Aug 05 05:01:24 2021 UTC