Commit Graph

502 Commits

Author SHA1 Message Date
Nikita Popov
d8590940a1 Use symtable lookup for arrays in array_column 2016-04-16 09:59:01 +02:00
Nikita Popov
28801bf249 Respect property visibility in array_column 2016-04-16 09:59:01 +02:00
Nikita Popov
c0d8dc5bd7 Fixed bug #72031 2016-04-16 09:58:57 +02:00
Nikita Popov
b1e854f776 Fix bug #71334
Always duplicate the array before doing a sort with user-defined
comparison function, to avoid access to the intermediate
inconsistent state.

I've also dropped the "array modification" warning, as protection
against modifications is no longer relevant if we're always working
on a copy anyway.

This also required some changes to how SplArray forwards calls to
sorting functions.
2016-03-30 22:49:27 +02:00
Xinchen Hui
345ecd9822 Fixed #71837 (Wrong arrays behaviour) 2016-03-17 07:41:41 -07:00
Xinchen Hui
c299b272c7 Fixed bug #71660 (array_column behaves incorrectly after foreach by reference) 2016-02-25 16:07:22 +08:00
Xinchen Hui
0fccd154bd Fixed bug #71603 (compact() maintains references in php7) 2016-02-16 11:02:57 +08:00
Thomas Punt
3bbcd84e2f re-apply patch for github PR #1695 2016-01-12 07:07:51 +01:00
Anatol Belski
66d10fe085 Revert "patch for github PR #1695"
This reverts commit 58dd956b63.

crashes on travis
2016-01-11 22:03:36 +01:00
Thomas Punt
58dd956b63 patch for github PR #1695 2016-01-11 21:11:55 +01:00
Xinchen Hui
decb934e3a Fixed test (extract is no affected) 2015-12-25 21:31:42 -08:00
Xinchen Hui
c56efb848b Fixed bug #71220 (Null pointer deref (segfault) in compact via ob_start) 2015-12-25 21:25:53 -08:00
Xinchen Hui
801e46d8c0 Add test for bug (count on symbol table)
I should have do this ....
2015-11-23 06:21:30 -08:00
Xinchen Hui
fce44a5a13 Fixed bug #70910 (extract() breaks variable references) 2015-11-13 19:39:59 -08:00
Xinchen Hui
179fba3f38 Fixed bug #70808 (array_merge_recursive corrupts memory of unset items)
I knew, this fix seems ugly
2015-10-29 14:33:58 +08:00
Dmitry Stogov
3815e97136 Fixed bug #70668 (array_keys() doesn't respect references when $strict is true) 2015-10-08 14:59:02 +03:00
Dmitry Stogov
24e88348f3 Revert "Merge branch 'array_keys_strict_refs' of https://github.com/tony2001/php-src"
This reverts commit a6be0f3fd6.
2015-10-06 23:48:12 +03:00
Bob Weinand
a6be0f3fd6 Merge branch 'array_keys_strict_refs' of https://github.com/tony2001/php-src 2015-10-05 14:50:04 +02:00
Dmitry Stogov
2d475eb943 Fixed tests on 32-bit systems 2015-08-17 12:54:33 +03:00
Anatol Belski
86984d7ade add range() tests 2015-08-14 14:34:48 +02:00
Xinchen Hui
dc5c6ab774 Fixed bug #70250 (extract() turns array elements to references) 2015-08-13 13:30:25 +08:00
Xinchen Hui
a6b47e8d68 Merge branch 'zval_dump_consistent' of https://github.com/laruence/php-src 2015-07-30 13:14:38 +08:00
Xinchen Hui
7d5fb7bbf3 Fixed bug #69674 (SIGSEGV array.c:953) 2015-07-29 10:46:12 +08:00
Xinchen Hui
c55c7ef0ec Make debug_val_dump and var_dump prints int and float the same 2015-07-23 12:14:34 +08:00
Tjerk Meesters
3bf012a98d Feature: Enhanced array_column() to also work with object elements. 2015-06-27 07:35:44 +08:00
Anatol Belski
269acaa363 Merge branch 'pull-request/1284'
* pull-request/1284:
  Rename interface macros
  Fix typo in UPGRADING
  Move definition of Throwable to zend_exceptions.h/c
  Check for zend_ce_throwable instead
  Fix some missed tests
  Add Throwable tests
  Fix previous exception type check
  Updated UPGRADING with RFC link
  Changed AssertionException to AssertionError
  Update exception error messages
  Throwable method signatures.
  Update exception names in tests after formatting changes.
  Merge exception formatting changes.
  Make zend_get_exception_base static.
  Fix a few missed tests.
  Fix handler double copy.
  Updated tests to reflect exception class changes.
  Remodel exceptions based on Throwable interface
2015-06-17 21:55:03 +02:00
Nikita Popov
183c00ddb6 Fix references handling in convert_scalar_to_number 2015-06-16 18:02:45 +02:00
Aaron Piotrowski
110e0a5a2c Merge branch 'master' into throwable-interface
# Conflicts:
#	Zend/zend_language_scanner.c
#	Zend/zend_language_scanner.l
#	ext/simplexml/tests/SimpleXMLElement_xpath.phpt
2015-06-14 18:53:11 -05:00
Xinchen Hui
ed8d1ba7dd Fixed bug #69723 (Passing parameters by reference and array_column) 2015-05-29 13:50:44 +08:00
Aaron Piotrowski
e97d5fab35 Update exception names in tests after formatting changes. 2015-05-17 17:31:43 -05:00
Nikita Popov
3ae995f03c Tweak uncaught exception message display
This implements a reduced variant of #1226 with just the following
change:

-Fatal error: Uncaught exception 'EngineException' with message 'Call to private method foo::bar() from context ''' in %s:%d
+Fatal error: Uncaught EngineException: Call to private method foo::bar() from context '' in %s:%d

The '' wrapper around messages is very weird if the exception
message itself contains ''. Futhermore having the message wrapped
in '' doesn't work for the "and defined" suffix of
TypeExceptions.
2015-05-17 18:47:06 +02:00
Nikita Popov
c9f27ee422 Display EngineExceptions like ordinary exceptions
TypeException stays as-is for now because it uses messages that are
incompatible with the way exception messages are displayed.

closure_038.phpt and a few others now show that we're generating
too many exceptions for compound operations on undefined properties
-- this needs to be fixed in a followup.
2015-05-15 23:40:32 +02:00
Nikita Popov
94bea670de Fix bug #69413 2015-04-10 09:49:07 +02:00
Xinchen Hui
b6aeab1b91 Fixed bug #69371 (Hash table collision leads to inaccessible array keys) 2015-04-05 18:45:14 +08:00
Dmitry Stogov
dcaa79546b Don't relay on reference-counter when parameter expected to be a reference, but value given. 2015-04-03 16:35:06 +03:00
Nikita Popov
8d00385871 Reclassify E_STRICT notices
Per RFC https://wiki.php.net/rfc/reclassify_e_strict

While reviewing this, found that there are still three E_STRICTs
left in libraries - need to discuss those.
2015-04-01 11:17:55 +02:00
Andrea Faulds
db76b708cf Deprecate PHP 4 constructors 2015-03-31 17:55:27 +02:00
Xinchen Hui
d55d10c7fd Fixed bug #69299 (Regression in array_filter's $flag argument in PHP 7) 2015-03-25 23:50:54 +08:00
Anthony Ferrara
d22bfb8aa6 Merge in master, fix merge conflicts and update patch to support exceptions everywhere 2015-03-18 10:50:11 -04:00
Xinchen Hui
28b408a242 Fixed bug #69198 (Compact function generate array with length but no content) 2015-03-07 16:49:07 +08:00
Xinchen Hui
70bd500645 Fixed #69166 (Assigning array_values() to array does not reset key counter) 2015-03-03 17:31:20 +08:00
Dmitry Stogov
745504ea2a Make current() and key() receive argument by value. 2015-02-24 17:40:25 +03:00
Andrea Faulds
c3c0f531a2 Scalar type hints with ZPP casting rules 2015-02-10 15:48:04 +00:00
Nikita Popov
d133e68bab Remove support for hex number from is_numeric_string 2015-01-28 22:54:17 +01:00
Xinchen Hui
020b51b46e Don't use >= as sorting condition
which could avoid breaking usage like:

usort($a, function($a, $b) { return $a > $b; })
2015-01-19 01:36:56 -05:00
Andrea Faulds
5f29b98051 Error on invalid octal (fixes PHPSadness #31)
Further error checks
2015-01-17 18:50:28 +00:00
Xinchen Hui
22084e1478 Added test for array_unique 2015-01-16 17:12:50 +08:00
Xinchen Hui
98a2498383 Revert "Optimize array_unique to save some comparation calls"
Unsafe optimization

This reverts commit b57dc41e07.
2015-01-16 15:21:21 +08:00
Xinchen Hui
e61f444268 Fixed tests on 32-bits 2015-01-15 14:23:47 +08:00
Xinchen Hui
b57dc41e07 Optimize array_unique to save some comparation calls 2015-01-15 13:57:06 +08:00