From:             
Operating system: *
PHP version:      5.3.2
Package:          Strings related
Bug Type:         Feature/Change Request
Bug description:Easy substr/array_splice method

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 bug report at http://bugs.php.net/bug.php?id=52129&edit=1
-- 
Try a snapshot (PHP 5.2):            
http://bugs.php.net/fix.php?id=52129&r=trysnapshot52
Try a snapshot (PHP 5.3):            
http://bugs.php.net/fix.php?id=52129&r=trysnapshot53
Try a snapshot (trunk):              
http://bugs.php.net/fix.php?id=52129&r=trysnapshottrunk
Fixed in SVN:                        
http://bugs.php.net/fix.php?id=52129&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=52129&r=needdocs
Fixed in release:                    
http://bugs.php.net/fix.php?id=52129&r=alreadyfixed
Need backtrace:                      
http://bugs.php.net/fix.php?id=52129&r=needtrace
Need Reproduce Script:               
http://bugs.php.net/fix.php?id=52129&r=needscript
Try newer version:                   
http://bugs.php.net/fix.php?id=52129&r=oldversion
Not developer issue:                 
http://bugs.php.net/fix.php?id=52129&r=support
Expected behavior:                   
http://bugs.php.net/fix.php?id=52129&r=notwrong
Not enough info:                     
http://bugs.php.net/fix.php?id=52129&r=notenoughinfo
Submitted twice:                     
http://bugs.php.net/fix.php?id=52129&r=submittedtwice
register_globals:                    
http://bugs.php.net/fix.php?id=52129&r=globals
PHP 4 support discontinued:          http://bugs.php.net/fix.php?id=52129&r=php4
Daylight Savings:                    http://bugs.php.net/fix.php?id=52129&r=dst
IIS Stability:                       
http://bugs.php.net/fix.php?id=52129&r=isapi
Install GNU Sed:                     
http://bugs.php.net/fix.php?id=52129&r=gnused
Floating point limitations:          
http://bugs.php.net/fix.php?id=52129&r=float
No Zend Extensions:                  
http://bugs.php.net/fix.php?id=52129&r=nozend
MySQL Configuration Error:           
http://bugs.php.net/fix.php?id=52129&r=mysqlcfg

Reply via email to