Commit Graph

476 Commits

Author SHA1 Message Date
David Soria Parra
139e9824ad Fix array_colum segfault
Separate zval to avoid gc from freeing
2013-05-15 14:42:39 +02:00
Sara Golemon
734e165d4e array_column() - Use entire subject array when NULL passed for second param.
This starts to look like array_values(), except that you can reindex the arrays
using the third parameter.
2013-04-22 16:19:21 -07:00
Sara Golemon
1a03bd5dee Allow array_column() to take -1 as a valid value in third param
Also do some cleanup and simplification to make this code more
readable in the long term.
2013-04-22 15:54:21 -07:00
Sara Golemon
7b34324f84 Fix handling of double keys in array_column
Also fix resource test to not localize __FILE__ to cwd.
2013-04-21 22:35:04 -07:00
Xinchen Hui
d8a5f41a60 Fixed bug parameter is casted to string of array_column 2013-04-01 19:11:45 +08:00
David Soria Parra
0173c4bab0 Merge branch 'pull-request/257' into PHP-5.5
* pull-request/257:
  array_column: Fix compile-time warnings
  array_column: Removed array_pluck() alias
  array_column: Set array_pluck as an alias for array_column
  array_column: Implement ability to specify an index column
  Cleaning up a memory leak.
  array_column: Adding test for IS_OBJECT and converting object to string
  array_column: Using add_next_index_zval() at nikic's recommendation.
  array_column: Improved tests
  array_column: Cleaning up, as recommended in pull request #56 comments
  Fixing typo in test for array_column()
  Simplify the code and use zend_hash_next_index_insert()
  Adding test for columns not present in all rows for array_column().
  Adding tests for the negative results of array_column()
  Implement new array function array_column()
2013-03-20 13:02:33 +01:00
Ben Ramsey
f5bf1ba88f array_column: Fix compile-time warnings 2013-03-19 20:44:19 -05:00
Nikita Popov
28634bf603 Forgot to remove some now unused variables 2013-03-12 17:39:20 +01:00
Nikita Popov
fcc6611de9 Add support for non-scalar Iterator keys in foreach
RFC: https://wiki.php.net/rfc/foreach-non-scalar-keys
2013-03-12 17:27:31 +01:00
Ben Ramsey
5bc2854b37 array_column: Implement ability to specify an index column 2013-01-11 16:58:31 -06:00
Ben Ramsey
94d5b2519a Cleaning up a memory leak. 2013-01-11 14:16:20 -06:00
Ben Ramsey
20ab30339d array_column: Adding test for IS_OBJECT and converting object to string 2013-01-11 14:16:19 -06:00
Ben Ramsey
66a02eb25e array_column: Using add_next_index_zval() at nikic's recommendation. 2013-01-11 14:16:19 -06:00
Ben Ramsey
e921d28ae3 array_column: Cleaning up, as recommended in pull request #56 comments 2013-01-11 14:16:19 -06:00
Ben Ramsey
6a27b890e6 Simplify the code and use zend_hash_next_index_insert() 2013-01-11 14:16:19 -06:00
Ben Ramsey
9035a1ed24 Implement new array function array_column()
array_column() returns the values of the specified column from a
multi-dimensional array.
2013-01-11 14:16:19 -06:00
Xinchen Hui
a666285bc2 Happy New Year 2013-01-01 16:37:09 +08:00
Xinchen Hui
a2045ff332 Happy New Year~ 2013-01-01 16:02:16 +08:00
Xinchen Hui
4cceeb25b7 Merge branch 'PHP-5.3' into PHP-5.4
* PHP-5.3:
  Fixed bug #61730 (Segfault from array_walk modifying an array passed by reference)
2012-05-06 20:28:18 +08:00
Xinchen Hui
7ccd594392 Fixed bug #61730 (Segfault from array_walk modifying an array passed by reference) 2012-05-06 20:01:10 +08:00
Nikita Popov
37d7df72a6 Fix bug #52719: array_walk_recursive crashes if third param of the function is by reference 2012-03-02 18:05:38 +00:00
Nikita Popov
e7810c1f1e Fix bug #52719: array_walk_recursive crashes if third param of the function is by reference 2012-03-02 18:05:38 +00:00
Xinchen Hui
fda8d2fe68 MFH: Fixed bug #61058 (array_fill leaks if start index is PHP_INT_MAX) 2012-03-02 03:40:40 +00:00
Xinchen Hui
33125e2312 Improved fix for #61058, and add test script 2012-02-12 05:32:24 +00:00
Xinchen Hui
c578917e30 Fixed bug #61058 (array_fill leaks if start index is PHP_INT_MAX) 2012-02-12 04:59:08 +00:00
Felipe Pena
e4ca0ed09f - Year++ 2012-01-01 13:15:04 +00:00
Felipe Pena
4e19825281 - Year++ 2012-01-01 13:15:04 +00:00
Dmitry Stogov
4a25a7740d Fixed ZE specific compile warnings (Bug #55629) 2011-09-13 13:29:35 +00:00
Arpad Ray
b52256c5be add support for SORT_NATURAL and SORT_FLAG_CASE in array sort functions 2011-08-29 20:23:34 +00:00
Adam Harvey
840308cfd0 Implement FR #54459 (Range function accuracy) by changing the way range()
calculates values when used with floating point bounds/step.
2011-04-06 10:23:06 +00:00
Adam Harvey
187eb235fe Implement FR #54459 (Range function accuracy) by changing the way range()
calculates values when used with floating point bounds/step.
2011-04-06 10:23:06 +00:00
Pierrick Charron
1368364469 Fix common typos in the source code (Reported in Bug #54065)
# External libraries were excluded
# Thanks eitan at eitanadler dot com for the first patch :)
2011-04-03 21:46:52 +00:00
Pierrick Charron
e8486cc374 Fix common typos in the source code (Reported in Bug #54065)
# External libraries were excluded
# Thanks eitan at eitanadler dot com for the first patch :)
2011-04-03 21:46:52 +00:00
Felipe Pena
927bf09c29 - Year++ 2011-01-01 02:19:59 +00:00
Felipe Pena
0203cc3d44 - Year++ 2011-01-01 02:17:06 +00:00
Ilia Alshanetsky
9696faa790 Fixed bug 48484 (array_product() always returns 0 for an empty array). 2010-12-12 19:27:04 +00:00
Ilia Alshanetsky
82287511ad Fixed bug 48484 (array_product() always returns 0 for an empty array). 2010-12-12 19:27:04 +00:00
Felipe Pena
897f0b4c27 - Fixed extract() to do not overwrite $GLOBALS and $this when using EXTR_OVERWRITE.
patch by: jorto at redhat dot com
2010-11-19 22:06:44 +00:00
Felipe Pena
93a4e0d1fa - Fixed extract() to do not overwrite $GLOBALS and $this when using EXTR_OVERWRITE.
patch by: jorto at redhat dot com
2010-11-19 22:06:44 +00:00
Felipe Pena
f4d15d8226 - Fixed bug #47643 (array_diff() takes over 3000 times longer than php 5.2.4) 2010-11-01 17:16:47 +00:00
Felipe Pena
5d584d4737 - Fixed bug #47643 (array_diff() takes over 3000 times longer than php 5.2.4) 2010-11-01 17:16:47 +00:00
Kalle Sommer Nielsen
cb50011016 Fixed compiler warnings in the standard library 2010-09-23 03:45:36 +00:00
Adam Harvey
f33837ff97 Implemented request #34857 (Change array_combine behaviour when called with
empty arrays). Patch by Joel Perras <joel.perras@gmail.com>.
2010-08-27 03:54:10 +00:00
Dmitry Stogov
d24c14cb59 Fixed bug #51552 (debug_backtrace() causes segmentation fault and/or memory issues) 2010-06-11 08:53:31 +00:00
Dmitry Stogov
d42dbb3bed Fixed bug #51552 (debug_backtrace() causes segmentation fault and/or memory issues) 2010-06-11 08:53:31 +00:00
Rasmus Lerdorf
2ef8ef9029 typo 2010-05-15 15:37:57 +00:00
Rasmus Lerdorf
9db78b574b typo 2010-05-15 15:37:18 +00:00
Dmitry Stogov
dd5c478be6 Added concept of interned strings. All strings constants known at compile time are allocated in a single copy and never changed. 2010-04-20 11:05:54 +00:00
Sebastian Bergmann
9ba1e81665 sed -i "s#1997-2009#1997-2010#g" **/*.c **/*.h **/*.php 2010-01-03 09:23:27 +00:00
Antony Dovgal
0b8839cd4a fix the fix for #47409
use correct comparison and add missing scope checks to trunk
2009-12-24 13:07:33 +00:00