From:             staff at newsocialife dot com
Operating system: Doesn't matter
PHP version:      Irrelevant
Package:          *General Issues
Bug Type:         Feature/Change Request
Bug description:Better things handling

Description:
------------
I would really like to have something like a better handling of array,
strings, numbers and so on.
Look at my examples, you will understand better what i mean

Test script:
---------------
<?php
$a = [2, 3, 4, 5]; // I define an array as for php 5.4
$a = $a->map(function($el) { // $a = array_map(callback, $a);
   return $el +1;
});

$b = "Hello";
$b = $b->substr(0, -1); // $b = substr($b, 0, -1);

$c = [2, 3];
$c = $c->merge([4, 5]); // $c = array_merge($c, [4, 5]);

$d = 22 + [2, 3, 4, 5, 6]; // $d = 22 + 2 + 3 + 4 + 5 + 6

$a[] = $b;
$a[] = $c;
$a[] = $d;

// i also would like to have a built-in swap function like this:
$a->swap($b); // $a is $b and $b is $a 

Expected result:
----------------
$a should be [3, 4, 5, 6, "Hell", [2, 3, 4, 5], 42];
$b should be "Hell";
$c should be [2, 3, 4, 5];
$d should be The answer to universe, life and everything; // 42



-- 
Edit bug report at https://bugs.php.net/bug.php?id=64136&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64136&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64136&r=trysnapshot53
Try a snapshot (trunk):     
https://bugs.php.net/fix.php?id=64136&r=trysnapshottrunk
Fixed in SVN:               https://bugs.php.net/fix.php?id=64136&r=fixed
Fixed in release:           https://bugs.php.net/fix.php?id=64136&r=alreadyfixed
Need backtrace:             https://bugs.php.net/fix.php?id=64136&r=needtrace
Need Reproduce Script:      https://bugs.php.net/fix.php?id=64136&r=needscript
Try newer version:          https://bugs.php.net/fix.php?id=64136&r=oldversion
Not developer issue:        https://bugs.php.net/fix.php?id=64136&r=support
Expected behavior:          https://bugs.php.net/fix.php?id=64136&r=notwrong
Not enough info:            
https://bugs.php.net/fix.php?id=64136&r=notenoughinfo
Submitted twice:            
https://bugs.php.net/fix.php?id=64136&r=submittedtwice
register_globals:           https://bugs.php.net/fix.php?id=64136&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64136&r=php4
Daylight Savings:           https://bugs.php.net/fix.php?id=64136&r=dst
IIS Stability:              https://bugs.php.net/fix.php?id=64136&r=isapi
Install GNU Sed:            https://bugs.php.net/fix.php?id=64136&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64136&r=float
No Zend Extensions:         https://bugs.php.net/fix.php?id=64136&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64136&r=mysqlcfg

Reply via email to