php.net |  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
Votes:17
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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: olamedia at gmail dot com
New email:
PHP Version: OS:

 

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

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


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-23 12:00 UTC] aharvey@php.net
-Status: Open +Status: Duplicate
 [2010-07-23 12:00 UTC] aharvey@php.net
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-2025 The PHP Group
All rights reserved.
Last updated: Tue May 13 13:01:27 2025 UTC