From: yaxay at gmx dot net Operating system: Irrelevant PHP version: 5.0.4 PHP Bug Type: Feature/Change Request Bug description: array_push with the new key as return value
Description: ------------ The function array_push returns the count of the array after the new element/s is/are pushed onto it. However it would be rather useful to have the key of the first pushed value returned. Until now I have to rely on a rather slow user function to do the same. Of course it makes no sense to modify the function, because some may need it to return the element count. However I think it would be very handy to be able to access the elements after pushing them onto the stack, therefore I wonder whether you could create a built in function to do so. PS: I was not allowed to pick irrelevant for PHP version, so I picked 5.0.4 since I'm currently developing for PHP5 only. The funtion would be great for PHP4 too, though. PPS: I hope I did not overlook an already existing function.. Sincerely, Benjamin Schulz -- Edit bug report at http://bugs.php.net/?id=34360&edit=1 -- Try a CVS snapshot (php4): http://bugs.php.net/fix.php?id=34360&r=trysnapshot4 Try a CVS snapshot (php5.0): http://bugs.php.net/fix.php?id=34360&r=trysnapshot50 Try a CVS snapshot (php5.1): http://bugs.php.net/fix.php?id=34360&r=trysnapshot51 Fixed in CVS: http://bugs.php.net/fix.php?id=34360&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=34360&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=34360&r=needtrace Need Reproduce Script: http://bugs.php.net/fix.php?id=34360&r=needscript Try newer version: http://bugs.php.net/fix.php?id=34360&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=34360&r=support Expected behavior: http://bugs.php.net/fix.php?id=34360&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=34360&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=34360&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=34360&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=34360&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=34360&r=dst IIS Stability: http://bugs.php.net/fix.php?id=34360&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=34360&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=34360&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=34360&r=nozend MySQL Configuration Error: http://bugs.php.net/fix.php?id=34360&r=mysqlcfg