Req #52129 [Opn->Sus]: Easy substr/array_splice method
| From: | cmb@php.net | Date: | Sun, 08 Apr 2018 15:07:04 +0000 |
| Subject: | Req #52129 [Opn->Sus]: Easy substr/array_splice method | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-214645@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=52129&edit=1
ID: 52129
Updated by: cmb@php.net
Reported by: david71rj at gmail dot com
Summary: Easy substr/array_splice method
-Status: Open
+Status: Suspended
Type: Feature/Change Request
Package: Strings related
Operating System: *
PHP Version: 5.3.2
Block user comment: N
Private report: N
New Comment:
Because this feature would require to change the syntax of PHP, it
would require the RFC process[1]. Anybody is welcome to start it!
For the time being, I'm suspending this ticket.
[1] <https://wiki.php.net/rfc/howto>
Previous Comments:
------------------------------------------------------------------------
[2016-06-07 16:30:55] cmb@php.net
Related To: Bug #54387
------------------------------------------------------------------------
[2016-06-07 16:29:16] cmb@php.net
Just for the record: that's called *slicing* in Python.
------------------------------------------------------------------------
[2010-06-20 21:39:13] david71rj at gmail dot com
Description:
------------
In python exists a easy method for substr, and I suggest this for PHP. I think
that not will do incompatible nothing because is a new method.
$test = "Hello";
echo $test[0]; // Exists: H
echo $test[0, 1; // New: H (too)
echo $test[-1]; // New: o
echo $test[-3]; // New: llo
$test = array(0, 1, 2);
echo $test[0]; // 0
echo $test[0, 2]; // array(0, 1, 2)
In python is [x:y], but in PHP I thinkg think that is better ',' to don't
complicate.
Bye.
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=52129&edit=1