Commit Graph

907 Commits

Author SHA1 Message Date
Dmitry Stogov
1616038698 Added ZEND_ATTRIBUTE_FORMAT to some middind functions.
"%p" replaced by ZEND_LONG_FMT to avoid compilation warnings.
Fixed most incorrect use cases of format specifiers.
2016-06-21 16:00:37 +03:00
Dmitry Stogov
4042f543c4 HANDLE_BLOCK/UNBLOCK_INTERRUPTIONS() protection on inter-process data is completely useless now.
Historicaly, these macros were introduced as a protection from execution timeout handling, but we don't need them anymore after "safe execution timeout" implementation.
These macros are still useful to protect from termination during inner process data modification, because of OS signals (e.g. SIGTERM during OPcache SHM update).
2016-06-20 15:50:41 +03:00
Dmitry Stogov
a9512af810 Implemented RFC: Fix inconsistent behavior of $this variable
Squashed commit of the following:

commit bdd3b6895c
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jun 16 00:19:42 2016 +0300

    Fixed GOTO VM

commit 2f1d7c8b89
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jun 15 21:01:57 2016 +0300

    Removed unused variable

commit cf749c42b0
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jun 15 19:06:16 2016 +0300

    Protection from $this reassign through mb_parse_str()

commit 59a9a6c83c
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jun 15 18:14:50 2016 +0300

    Added type inference rule for FETCH_THIS opcode

commit 73f8d14a85
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jun 15 18:11:18 2016 +0300

    Restored PHP-7 behavior of isset($this->foo).
    It throws exception if not in object context.
    Removed useless opcode handlers.

commit fa0881381e
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue May 31 12:25:47 2016 +0300

    Changed "Notice: Undefined variable: this" into "Exception: Using $this when not in object context".

commit e32cc528c0
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Tue May 24 02:02:43 2016 +0300

    Throw exception on attempt to re-assign $this through extract() and parse_str().

commit 41f1531b52
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Mon May 23 22:18:36 2016 +0300

    Fixed inconsistent $this behavior
2016-06-16 02:30:23 +03:00
Xinchen Hui
42f23effa9 Value should not be a reference here 2016-06-13 13:40:53 +08:00
Dmitry Stogov
b602495e5c Optimization 2016-06-09 16:01:55 +03:00
Dmitry Stogov
df7dccea83 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #72369 (array_merge() produces references in PHP7)
2016-06-09 15:09:09 +03:00
Dmitry Stogov
bfcf32237e Fixed bug #72369 (array_merge() produces references in PHP7) 2016-06-09 15:07:44 +03:00
Nikita Popov
91f5940329 Forbid dynamic calls to scope introspection functions
Per RFC:
https://wiki.php.net/rfc/forbid_dynamic_scope_introspection
2016-05-24 20:48:24 +02:00
Anatol Belski
41cb432ec4 Merge branch 'PHP-7.0'
* PHP-7.0:
  update NEWS
  Tidy up
  Remove unnecessary boundary checks
  Resolve bug #72017
2016-05-16 19:31:20 +02:00
Thomas Punt
0e21742bf8 Tidy up 2016-05-16 19:15:40 +02:00
Thomas Punt
367fde9947 Remove unnecessary boundary checks 2016-05-16 19:15:40 +02:00
Thomas Punt
39052d4d75 Resolve bug #72017 2016-05-16 19:15:40 +02:00
Bob Weinand
6d420dc782 Merge branch 'PHP-7.0' 2016-04-28 11:10:53 +02:00
Bob Weinand
74ef863f5d Fixed bug #72116 (7.0.6 array_fill optimization breaks implementation) 2016-04-28 11:02:47 +02:00
Dmitry Stogov
6499162ff0 - get rid of EG(scope). zend_get_executed_scope() should be used instead.
- ichanged zval_update_constant_ex(). Use IS_TYPE_IMMUTABLE flag on shared constants and AST, instead of "inline_change" parameter.
2016-04-28 04:13:34 +03:00
Nikita Popov
30c82321d7 Merge branch 'PHP-7.0' 2016-04-16 09:59:35 +02:00
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
Dmitry Stogov
58dd3b3a6f Merge branch 'PHP-7.0'
* PHP-7.0:
  Optimized array_fill(). This is a perfect function for fast creation of packed arrays.
2016-04-07 01:02:01 +03:00
Dmitry Stogov
b31240f995 Optimized array_fill(). This is a perfect function for fast creation of packed arrays. 2016-04-07 01:01:11 +03:00
Nikita Popov
bc1f884ef7 Merge branch 'PHP-7.0' 2016-03-30 22:49:36 +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
f2b6b26189 Merge branch 'PHP-7.0'
Conflicts:
	Zend/zend_compile.c
2016-03-17 07:51:26 -07:00
Xinchen Hui
345ecd9822 Fixed #71837 (Wrong arrays behaviour) 2016-03-17 07:41:41 -07:00
Dmitry Stogov
e66ac376cf Merge branch 'PHP-7.0'
* PHP-7.0:
  Introduce zend_symtable_exists_ind() for API consistency
2016-03-02 11:54:44 +03:00
Dmitry Stogov
ab800642df Introduce zend_symtable_exists_ind() for API consistency 2016-03-02 11:53:47 +03:00
Xinchen Hui
f4f140c05d Merge branch 'PHP-7.0'
* PHP-7.0:
  Use hash_exists_ind in symbol table
2016-03-02 12:12:12 +08:00
Xinchen Hui
2d4186dde7 Use hash_exists_ind in symbol table 2016-03-02 12:11:13 +08:00
Xinchen Hui
715a198e1f Merge branch 'PHP-7.0'
* PHP-7.0:
  Maybe we should introduce a symtable_exists_ind
2016-03-01 20:01:19 +08:00
Xinchen Hui
961c8d568d Maybe we should introduce a symtable_exists_ind 2016-03-01 20:01:02 +08:00
Xinchen Hui
b17d2ad5f6 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #71695 (Global variables are reserved before execution).
2016-03-01 19:21:16 +08:00
Xinchen Hui
186844be92 Fixed bug #71695 (Global variables are reserved before execution).
Instead of slow down hash_merge, we may also check the array(whether it
contains INDIRECT) outside of the loop, however, consisdering hash_merge
is not widly used, I prefer fix this in the current way to keep the
codes simple
2016-03-01 19:19:07 +08:00
Xinchen Hui
b378c7cff1 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #71660 (array_column behaves incorrectly after foreach by reference)
2016-02-25 16:07:38 +08: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
5c08bb654b Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed bug #71603 (compact() maintains references in php7)
2016-02-16 11:03:09 +08:00
Xinchen Hui
0fccd154bd Fixed bug #71603 (compact() maintains references in php7) 2016-02-16 11:02:57 +08:00
Xinchen Hui
effc1ba014 Merge branch 'PHP-7.0'
* PHP-7.0:
  Fixed typo (I think it should be a typo)
2016-02-15 15:31:00 +08:00
Xinchen Hui
e917402f05 Fixed typo (I think it should be a typo) 2016-02-15 15:26:44 +08:00
Nikita Popov
b2245c5592 Merge branch 'PHP-7.0' 2016-02-13 17:48:58 +01:00
Nikita Popov
7f474086e3 Fix extract() overwriting its own argument
Already covered by bug46873.phpt under valgrind.
2016-02-13 17:39:26 +01:00
Antony Dovgal
8b023e9192 use correct pointer in the math 2016-02-01 16:33:04 +03:00
Antony Dovgal
67a728f8a5 use correct pointer in the math 2016-02-01 16:32:06 +03:00
Nikita Popov
2eb4728611 Remove HAVE_SPL checks
SPL is always built.

Also clean up spl_ce_RuntimeException handling in PDO.
2016-01-30 14:53:00 +01: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
Lior Kaplan
ed35de784f Merge branch 'PHP-5.6' into PHP-7.0
* PHP-5.6:
  Happy new year (Update copyright to 2016)
2016-01-01 19:48:25 +02:00
Lior Kaplan
49493a2dcf Happy new year (Update copyright to 2016) 2016-01-01 19:21:47 +02: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
6313e16a04 Improved fix for bug (count on symbol table) 2015-11-23 06:12:03 -08:00
Xinchen Hui
eada2aa91a Fixed bug (count on symbol tables) 2015-11-21 20:58:29 -08:00
Xinchen Hui
fce44a5a13 Fixed bug #70910 (extract() breaks variable references) 2015-11-13 19:39:59 -08:00
Reeze Xia
c4297a5a29 This couldn't be false as it has been checked before 2015-10-30 19:50:54 +08:00
Reeze Xia
68b431e37d Use h parameter to avoid duplicate ht access of array_combine() 2015-10-30 19:49:04 +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
560e4fa393 Removed or simplified incorrect SEPARATE_*() macros usage. 2015-09-29 11:17:43 +03:00
Dmitry Stogov
8fe171a3e0 Don't allocate memory for empty HashTables. 2015-09-17 19:17:10 +03:00
Dmitry Stogov
c174e4cd73 Change array sorting implementation to avoid two level callbacks system.
Simplify zval comparion API.
2015-09-10 02:51:23 +03:00
Dmitry Stogov
2ea18cd431 Better array_compare improvement 2015-09-09 15:11:03 +03:00
Xinchen Hui
67d1a47887 Improved array_compare 2015-09-09 17:56:44 +08:00
Dmitry Stogov
1f0f768e3f Avoid duplication 2015-08-26 14:53:41 +03:00
Anatol Belski
38c19d43c1 fix array size calculation for range, related to bug #70239 2015-08-14 14:34:48 +02:00
Anatol Belski
01ee09f3f7 Fixed bug #70239 Creating a huge array doesn't result in exhausted, but segfault 2015-08-14 14:34:47 +02:00
Xinchen Hui
dc5c6ab774 Fixed bug #70250 (extract() turns array elements to references) 2015-08-13 13:30:25 +08:00
Nikita Popov
4ac0d96faa Deduplicate usort code 2015-07-18 21:53:03 +02:00
Nikita Popov
df031961ad Correctly handle zend_hash_sort failure
This can't actually happen right now, but should it become possible
we won't be leaking everything anymore.
2015-07-18 20:07:00 +02:00
Nikita Popov
179c8a2a09 Fix usort modification detection
This would delref the wrong array, leading to a segfault.
2015-07-18 20:07:00 +02:00
Dmitry Stogov
4a2e40bb86 Use ZSTR_ API to access zend_string elements (this is just renaming without semantick changes). 2015-06-30 04:05:24 +03:00
Dmitry Stogov
4bd22cf1c1 Improved zend_string API (Francois Laupretre)
Squashed commit of the following:

commit d96eab8d79
Author: Francois Laupretre <francois@tekwire.net>
Date:   Fri Jun 26 01:23:31 2015 +0200

    Use the new 'ZSTR' macros in the rest of the code.

    Does not change anything to the generated code (thanks to compat macros) but cleaner.

commit b352643910
Author: Francois Laupretre <francois@tekwire.net>
Date:   Thu Jun 25 13:45:06 2015 +0200

    Improve zend_string API

    Add missing methods
2015-06-29 16:44:54 +03:00
Tjerk Meesters
3bf012a98d Feature: Enhanced array_column() to also work with object elements. 2015-06-27 07:35:44 +08:00
Rasmus Lerdorf
28d7bb97a1 Fix more proto comments 2015-06-23 17:46:20 -04:00
Dmitry Stogov
b97df475df Fixed crash in Zend/tests/bug69891.phpt on x86 (32-bit).
compare_function() now has to be compatible with binary_op_type (use fastcall convention).
Introduced new zval_compare_function() to be used as zval comparison callback instead of compare_function().
2015-06-22 12:53:52 +03:00
Xinchen Hui
f75308eda1 Micro optimization 2015-06-20 10:52:58 +08:00
Dmitry Stogov
a0b3fd7803 Improved variable name validation 2015-06-17 12:05:58 +03:00
Nikita Popov
fb346c8f93 Support references in convert_to_*
conver_to_* functions now accept REFERENCE values, which will be
unwrapped before performing the usual conversion. This is consistent
with convert_scalar_to_number and matches the expected behavior in
a couple random use-sites I checked.

Also includes a couple fixes/cleanups elsewhere and two tests for
cases that previously didn't work (though the reference issue existed
all over the place).
2015-06-16 19:55:33 +02:00
Dmitry Stogov
1c754f0b71 Get rid of more ZVAL_ZVAL() macros 2015-06-12 13:33:14 +03:00
Dmitry Stogov
8e10e8f921 Avoid zval duplication in ZVAL_ZVAL() macro (it was necessary only in few places).
Switch from ZVAL_ZVAL() to simpler macros where possible (it makes sense to review remaining places)
2015-06-12 12:33:23 +03:00
Nikita Popov
5d3cf577aa Make convert_to_* safe with rc>1
This only involves switching zval_dtor to zval_ptr_dtor for arrays
and making the convert_to_object for arrays a bit more generic.

All the other changes outside zend_operators.c just make use of
this new ability (use COPY instead of DUP).

What's still missing: Proper references handling. I've seen many
convert_to* calls that will break when a reference is used.

Also fixes bug #69788.
2015-06-11 23:23:57 +02:00
Xinchen Hui
ed8d1ba7dd Fixed bug #69723 (Passing parameters by reference and array_column) 2015-05-29 13:50:44 +08:00
olshevskiy87
8bdec7a248 fix typos
Signed-off-by: olshevskiy87 <olshevskiy87@bk.ru>
2015-05-13 22:28:35 +04:00
Dmitry Stogov
d880ead8a7 Improve fast_is_[not_]identical() functions to teturn value instead of takeing additional arguments.
Pair INSTANCEOF with the following JMPZ/JMPNZ.
2015-04-29 16:43:23 +03:00
Nikita Popov
40e465e357 Clean up some type conversions
While at it also fix some type checks in iconv and drop dead and
unported code in standard/filters.
2015-04-27 18:50:08 +02:00
Nikita Popov
94bea670de Fix bug #69413 2015-04-10 09:49:07 +02:00
Xinchen Hui
f23f7dfed0 Use new macros 2015-04-08 14:30:47 +08:00
Xinchen Hui
b6aeab1b91 Fixed bug #69371 (Hash table collision leads to inaccessible array keys) 2015-04-05 18:45:14 +08:00
Nikita Popov
fa15ac4c37 Fix separation in array_multisort
This manifested in Zend/tests/bug52939.phpt when running without
opcache (no immutablization).
2015-04-04 10:52:43 +02:00
Xinchen Hui
af812eac4c Micro opt 2015-04-01 12:05:19 +08: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
Anatol Belski
774b113b32 fix datatype mismatches 2015-03-25 15:32:36 +01:00
Dmitry Stogov
2b42d71908 Changed HashTable layout:
Removed HashTable->arHash (reduced memory consumption). Now hash slots may be accessed using HT_HASH() macro.
Hash slotas are allocated together with Buckets (before them) and lay in reverse order from HashTable->arData base address (see comments in Zend/zend_types.h)
Indexes in hash table and conflict resolution chains (Z_NEXT) may be stored as indeces or offsets in bytes, depending on system (32 or 64-bit).
HashTable data filelds are reordered to keep the most useful for zend_hash_find() data in the same CPU cache line.
2015-03-13 17:13:19 +03:00
Dmitry Stogov
8633685675 Use specialized macro for string zval creation 2015-03-12 16:53:51 +03:00
Дмитрий Пацура
77dd2111f9 Array - make krsort FAST_ZPP compatibility 2015-02-28 17:16:17 +08:00
Dmitry Stogov
745504ea2a Make current() and key() receive argument by value. 2015-02-24 17:40:25 +03:00
Dmitry Stogov
e10e151e9b Merged zend_array and HashTable into the single data structure.
Now each HashTable is also zend_array, so it's refcounted and may be a subject for Copy on Write
zend_array_dup() was changed to allocate and return HashTable, instead of taking preallocated HashTable as argument.
2015-02-13 22:20:39 +03:00
Anatol Belski
07fdc1c78b fix data types 2015-02-12 18:39:40 +01:00
Dmitry Stogov
97fe15db43 Fix "forech" statemt behaviour according to https://wiki.php.net/rfc/php7_foreach
Squashed commit of the following:

commit 1e41295097
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Sat Jan 31 07:28:58 2015 +0300

    Generalize HashTableIterator API to allows its usage without involvement of HashTable.nInternalPonter

commit 5406f21b11
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 18:08:43 2015 +0300

    Reduced alghorithms complexity

commit b37f1d58d2
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 18:08:30 2015 +0300

    Fixed test name

commit fb2d079645
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 18:08:05 2015 +0300

    API cleanup

commit 08302c0d6d
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 14:20:46 2015 +0300

    Make array_splice() to preserve foreach hash position

commit cc4b7be41e
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 12:24:31 2015 +0300

    Make internal function, operation on array passed by reference, to preserve foreach hash position

commit 5aa9712b0a
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 09:49:35 2015 +0300

    Implement consistent behavior for foreach by value over plain object

commit 4c5b385ff5
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Fri Jan 30 07:56:37 2015 +0300

    More careful iterators update.

commit 721fc9e80d
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jan 29 21:43:28 2015 +0300

    Added new test

commit 15a23b1218
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jan 29 21:05:02 2015 +0300

    Reimplement iteration magic with HashTableIterators (see https://wiki.php.net/rfc/php7_foreach#implementation_details)

commit 10a3260b1f
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Thu Jan 29 21:04:44 2015 +0300

    New test

commit eef80c5837
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 16:52:21 2015 +0300

    Fixed foreach by reference iteration over constant array

commit 61e7391873
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 14:59:54 2015 +0300

    Fixed temporary variable re-allocation pass

commit 92e90c09f0
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 12:44:57 2015 +0300

    Fixed operand destruction in case of exceptions in iterator

commit dd2a36a207
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 10:02:34 2015 +0300

    Use GET_OP1_ZVAL_PTR_DEREF() (IS_TMP_VAR and IS_CONST can't be IS_REFERENCE)

commit 4638f7b914
Author: Dmitry Stogov <dmitry@zend.com>
Date:   Wed Jan 28 07:43:28 2015 +0300

    Change "foreach" statement behavior (this is just a PoC yet)

    - "foreach by value" don't relay on internal array/object pointer and doesnt perform array duplication. It just locks it incrementing reference counter. If the original array is modified by some code, the copy on write is performed and "foreach" still work with the old copy.

    - it makes no difference if array given to "foreach by value" is reference itself

    - "foreach by reference" still use internal array/object pointer and should work similar to PHP-5. (This id not completely implemented)
2015-02-12 13:57:12 +03:00
Xinchen Hui
a98fd7125a Fixed bug #68897 (Using variable for sort flag in array_multisort cause wrong results) 2015-01-24 22:51:37 +08:00
Xinchen Hui
afa666f650 Optimized range 2015-01-20 22:02:11 +08:00
Xinchen Hui
47b7d90703 NUM_KEY is useless here 2015-01-20 16:51:20 +08:00
Xinchen Hui
d917484ab7 Micro optimization for array_diff 2015-01-19 08:08:35 -05:00
Xinchen Hui
396e9cdb7f Optimized extract
symbol table already be rebuilt.. no need use set_local_var
2015-01-16 18:12:33 +08:00
Xinchen Hui
865749e7b1 Optimized array_slice 2015-01-16 17:54: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
1c9f91e682 Revert "We could do more...."
This reverts commit 11f615b311.
2015-01-16 15:21:12 +08:00
Xinchen Hui
fc33f52d8c bump year 2015-01-15 23:27:30 +08:00
Xinchen Hui
0579e8278d bump year 2015-01-15 23:26:37 +08:00
Xinchen Hui
9aac41753b Save one condition 2015-01-15 18:41:25 +08:00
Xinchen Hui
11f615b311 We could do more.... 2015-01-15 04:29:01 -05:00
Xinchen Hui
b57dc41e07 Optimize array_unique to save some comparation calls 2015-01-15 13:57:06 +08:00
Xinchen Hui
2193de0d18 Faster sorting algo 2015-01-14 18:02:41 +08:00
Dmitry Stogov
c5047d1f11 Use FAST_ZPP in few more frequently used functions 2015-01-12 19:26:12 +03:00
Dmitry Stogov
b277d360e9 Fixed reference support 2015-01-12 14:43:32 +03:00
Stanislav Malyshev
b7a7b1a624 trailing whitespace removal 2015-01-10 15:07:38 -08:00
Levi Morrison
bb7ceb046e Fix bug #55416
Remove extra, unnecessary warning when the callback fails for
array_map, array_reduce and array_filter
2015-01-05 17:27:25 -07:00
Nikita Popov
1266515e19 Fix uses of zval_add_ref and add comment on usage
zval_add_ref should be used as a copy ctor, after the value was
already copied.

In particular when used with hash insertions, it should be applied
to the return value of the insert function.
2015-01-05 17:02:11 +01:00
Dmitry Stogov
aa8ecbedcb Simplify array_splice() 2014-12-30 18:15:15 +03:00
Dmitry Stogov
c6bc209e50 Simplify array_unshift() 2014-12-30 17:04:24 +03:00
Dmitry Stogov
f9a70c50a4 Simplify array_pad() 2014-12-30 17:03:38 +03:00
Dmitry Stogov
107ae86ca6 Introduce specialized functions to compare with integer and string, to eliminate repeatable checks on each loop iteration in in_array() function. 2014-12-27 11:11:40 +03:00
Xinchen Hui
31e978ff5c Fixed tests fails 2014-12-25 11:33:07 +08:00
Xinchen Hui
94d26ad4b9 Add php_string_tolower/toupper which is locale depened 2014-12-25 11:29:11 +08:00
Xinchen Hui
3139ba6116 FAST_ZPP for hot functions 2014-12-23 23:07:55 -05:00
Dmitry Stogov
106b1017d4 API for fast construction of packed arrays 2014-12-23 19:08:28 +03:00
Xinchen Hui
62e2973602 Revert "Improve Hash foreach macros"
This reverts commit 95bb0a0f7a.
2014-12-23 03:51:06 -05:00
Xinchen Hui
95bb0a0f7a Improve Hash foreach macros 2014-12-23 00:50:39 -05:00
Dmitry Stogov
dedf44bacc Improved array_keys() 2014-12-23 04:29:27 +03:00
Xinchen Hui
b5b617674e Micro optimaztion (yeah, I know compiler supposed to do that) 2014-12-22 00:10:46 -05:00
Xinchen Hui
201e1b8a8d Micro optimizations 2014-12-21 22:35:25 -05:00
Xinchen Hui
abb98080c7 Make it inline 2014-12-20 05:17:56 -05:00
Dmitry Stogov
f7b6518d10 don't sort array with single element 2014-12-19 13:07:35 +03:00
Dmitry Stogov
dae53dfc69 Improved array_diff() function (use simple and more efficient algorithm). 2014-12-19 05:06:54 +03:00
Anatol Belski
bd76a50019 Merge remote-tracking branch 'origin/master' into native-tls
* origin/master:
  Removed deprecated checks
2014-12-15 20:18:40 +01:00
Dmitry Stogov
4e48bff3ce Removed deprecated checks 2014-12-15 16:42:28 +03:00
Anatol Belski
bdeb220f48 first shot remove TSRMLS_* things 2014-12-13 23:06:14 +01:00
Dmitry Stogov
381438e5df Improved array_merge() and array_replace() (1-st array may be added using simple procedure). 2014-12-11 19:18:31 +03:00
Veres Lajos
4b9535341a typo fixes - https://github.com/vlajos/misspell_fixer 2014-11-19 20:23:00 +00:00
Anatol Belski
53560ca06b rework the previous fix for var names with size_t, no ugly casts anymore 2014-10-23 16:50:35 +02:00
Anatol Belski
09a01a834e this should be uint32 2014-10-22 17:56:26 +02:00
Anatol Belski
36ce467402 fix datatype mismatches 2014-10-22 17:56:25 +02:00
Anatol Belski
1ea5982d07 fixing datatype mismatches 2014-10-22 17:56:23 +02:00
Dmitry Stogov
35dc0a2e30 array_pop/array_shift optimization 2014-10-17 12:30:27 +04:00
Nikita Popov
fc6ce7d1c1 Fix array_keys() on $GLOBALS 2014-10-16 14:44:35 +02:00
Nikita Popov
ee5b30fa19 Remove support for classes without class entries
get_class_entry must be non-NULL and return non-NULL.
2014-10-09 13:58:14 +02:00
Nikita Popov
e33f3d3b7c Move smart_str implementation into Zend/
So we can use it there as well...

For now I've retained the zend_smart_str_public.h header, though
it would probably be better to just move that one struct into
zend_types.h.
2014-09-21 20:49:39 +02:00
Johannes Schlüter
d0cb715373 s/PHP 5/PHP 7/ 2014-09-19 18:33:14 +02:00
Dmitry Stogov
bccc653185 Avoid double IS_INTERNED() check 2014-09-19 17:32:50 +04:00
Dmitry Stogov
3bc8a958c5 Fixed useless or duplicated IS_INTERNED() checks 2014-09-19 15:41:01 +04:00
Anatol Belski
8c4ab0d02e fix signed/unsigned mismatch 2014-09-16 21:17:27 +02:00
Dmitry Stogov
c8ff3421a0 Duplicate array only if neccessary 2014-08-28 20:51:22 +04:00
Anatol Belski
af59e92b24 master renames phase 7 2014-08-25 21:51:49 +02:00
Anatol Belski
b9514bb8fd master renames phase 6 2014-08-25 21:26:42 +02:00
Anatol Belski
4d997f63d9 master renames phase 3 2014-08-25 20:22:49 +02:00
Anatol Belski
6f9f0bf205 master renames phase 2 2014-08-25 19:28:33 +02:00
Anatol Belski
c3e3c98ec6 master renames phase 1 2014-08-25 19:24:55 +02:00
Anatol Belski
9d760498c1 fixed array_pad() 2014-08-21 22:13:22 +02:00
Anatol Belski
6d54e89916 Merge remote-tracking branch 'php/master' 2014-08-20 21:29:49 +02:00
Dmitry Stogov
cf09bc7825 Fixed bug #67874 (Crash in array_map()) 2014-08-20 22:06:15 +04:00
Anatol Belski
97c5172ac7 Merge remote-tracking branch 'php/master'
Conflicts:
	ext/date/lib/parse_date.c
2014-08-19 08:27:43 +02:00
Dmitry Stogov
0f5bad93fd Fixed bug #67856 (Leak when using array_reduce with by-ref function) 2014-08-18 21:08:50 +04:00
Anatol Belski
b8324e6d63 further fixes to ext/standard 2014-08-18 16:50:54 +02:00
Anatol Belski
c586133d07 rename zval_get_long and fixes to some string functions 2014-08-18 08:39:39 +02:00
Anatol Belski
f2182ab845 some more pure naming replacements 2014-08-17 21:16:27 +02:00
Anatol Belski
7534bf125a fix set_time_limit, substr and some more 2014-08-16 14:46:31 +02:00
Anatol Belski
1169de3e61 fix some cases with fast zpp 2014-08-16 14:00:02 +02:00
Anatol Belski
b7e7a89541 several fixes -
- param parsing Z_PARAM_STR vs Z_PARAM_STRING
- some functions for new params
- etc
2014-08-16 12:55:13 +02:00
Anatol Belski
cb25136f4e fix macros in the 5 basic extensions 2014-08-16 11:37:14 +02:00
Dmitry Stogov
7301994c28 Merge branch 'master' into phpng
* master: (46 commits)
  PHP_INT_MIN and _MAX tests
  NEWS and UPGRADING
  Added PHP_INT_MIN
  Fix wrong lenght size
  Bug #51096 - Remove unnecessary ? for first/last day of
  Moved streams related functions to xp_ssl.c
  Remove duplicate NEWS
  Update NEWS
  Update NEWS
  Update NEWS
  BFN
  BFN
  Fixed bug #67715 (php-milter does not build and crashes randomly).
  We need to turn off any strict mode here for this warning to show up
  Disable restrictions regarding arrays in constants at run-time. For the discussion around it, see the thread on the mailing list: http://www.mail-archive.com/internals@lists.php.net/msg68245.html
  Revert "Fix bug #67064 in a BC safe way"
  Updated NEWS for #67693
  Updated NEWS for #67693
  Fixed bug #67693 - incorrect push to the empty array
  add missing entry to NEWS
  ...

Conflicts:
	Zend/tests/errmsg_040.phpt
	Zend/tests/ns_059.phpt
	Zend/zend_language_parser.y
	Zend/zend_vm_def.h
	ext/openssl/openssl.c
	ext/reflection/php_reflection.c
	ext/session/session.c
	ext/spl/spl_directory.c
	ext/spl/spl_iterators.c
	ext/sqlite3/sqlite3.c
	ext/standard/array.c
2014-08-04 13:56:27 +04:00
Bob Weinand
3c0adf2dcd Merge branch 'PHP-5.6' 2014-07-30 18:07:01 +02:00
Bob Weinand
d5ddd2dbb2 Disable restrictions regarding arrays in constants at run-time.
For the discussion around it, see the thread on the mailing list:
http://www.mail-archive.com/internals@lists.php.net/msg68245.html
2014-07-30 17:57:07 +02:00
Bob Weinand
354ee12b73 Revert "Fix bug #67064 in a BC safe way"
This reverts commit 1a4a9eede5.

Conflicts:
	ext/standard/array.c
	ext/standard/tests/array/bug67064.phpt
2014-07-30 17:18:05 +02:00
Tjerk Meesters
0dc88c45b8 Merge branch 'PHP-5.6'
* PHP-5.6:
  Updated NEWS for #67693
  Fixed bug #67693 - incorrect push to the empty array
2014-07-30 18:28:23 +08:00
Tjerk Meesters
f925892920 Merge branch 'PHP-5.5' into PHP-5.6
* PHP-5.5:
  Updated NEWS for #67693
  Fixed bug #67693 - incorrect push to the empty array
2014-07-30 18:27:29 +08:00
Tjerk Meesters
e9967292c3 Merge branch 'PHP-5.4' into PHP-5.5
* PHP-5.4:
  Updated NEWS for #67693
  Fixed bug #67693 - incorrect push to the empty array
2014-07-30 18:17:13 +08:00
Tjerk Meesters
da3add26cf Fixed bug #67693 - incorrect push to the empty array 2014-07-30 18:15:14 +08:00
Dmitry Stogov
dda7e84f10 Fixed ext/standard/tests/array/unexpected_array_mod_bug.phpt 2014-07-29 18:19:41 +04:00
Dmitry Stogov
27f38798a1 Fast parameter parsing API
This API is experemental. It may be changed or removed.
It should be used only for really often used functions.
(Keep the original parsing code and wrap usage with #ifndef FAST_ZPP)
2014-07-11 16:32:20 +04:00
Dmitry Stogov
8f229b2855 Optimized array_map() and array_combine() 2014-07-11 12:28:36 +04:00
Dmitry Stogov
6bf24f4dd0 Removed EG(active_symbol_table) and use corresponding value from EG(current_execute_data) 2014-07-04 18:03:45 +04:00
Dmitry Stogov
b108267f2c Merge branch 'master' into phpng
* master: (41 commits)
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  Update copyright year to 2014
  NEWS
  Fix Request #67453 Allow to unserialize empty data.
  Update copyright year to 2014
  Update copyright year for re2c generated files
  Update copyright year to 2014
  Update copyright year for re2c files as well
  Fix patch for bug #67436
  fix failed test
  Fix test on modern distro where old unsecure algo are disabled in openssl config. Testing recent algo should be enough to check this function.
  Added tests for bug 67436
  Fixed wrong XFAIL test - already fixed
  Fix typo in Bug #67406 NEWS entry
  Fix typo in Bug #67406 NEWS entry
  ...

Conflicts:
	Zend/zend_compile.c
	ext/session/session.c
	ext/standard/array.c
	ext/standard/http_fopen_wrapper.c
	tests/classes/bug63462.phpt
2014-06-18 17:50:27 +04:00
Matteo Beccati
7d2bcbe20c Merge branch 'PHP-5.6'
* PHP-5.6:
  Fix bug #67433 SIGSEGV when using count() on an object implementing Countable
2014-06-13 13:14:52 +02:00
Matteo Beccati
df5551ba4f Fix bug #67433 SIGSEGV when using count() on an object implementing Countable 2014-06-13 13:14:12 +02:00
Dmitry Stogov
7c045c61f0 Optimized for fast path 2014-06-10 00:15:44 +04:00
Dmitry Stogov
1593d942e7 Fixed compilation warnings 2014-06-05 20:58:21 +04:00
Dmitry Stogov
c1965f58d4 Use reference counting instead of zval duplication 2014-06-05 16:04:11 +04:00
Dmitry Stogov
30c05577f7 Optimized conditions order 2014-06-03 03:54:03 +04:00
Dmitry Stogov
b3b616cf7e Introduced immutable arrays. They don't need to be copyed and may be used directly from SHM. 2014-05-29 18:21:56 +04:00
Dmitry Stogov
40256e0f9c Use specialized functions instead of macros 2014-05-26 17:16:16 +04:00
Nikita Popov
43cf92edf6 Fix in_array (strict) with references 2014-05-25 18:19:00 +02:00
Dmitry Stogov
9eb89dddb1 Use optimized zend_array_dup() function. convert zend_hash_num_elements() and zend_hash_next_free_element() into macros. 2014-05-23 20:37:53 +04:00
Xinchen Hui
d8651fbe1c Make they are in the same style of Z_ISREF 2014-05-03 16:08:58 +08:00
Dmitry Stogov
17d027ed47 Split IS_BOOL into IS_FALSE and IS_TRUE 2014-04-30 18:32:42 +04:00
Nikita Popov
dd419d24ca Replace more convert_to_* calls 2014-04-25 23:21:05 +02:00
Nikita Popov
b1b7939b0f Move more code to use zval_get_string 2014-04-25 23:21:04 +02:00
Dmitry Stogov
f9927a6c97 Merge mainstream 'master' branch into refactoring
During merge I had to revert:
	Nikita's patch for php_splice() (it probably needs to be applyed again)
	Bob Weinand's patches related to constant expression handling (we need to review them carefully)
	I also reverted all our attempts to support sapi/phpdbg (we didn't test it anyway)

Conflicts:
	Zend/zend.h
	Zend/zend_API.c
	Zend/zend_ast.c
	Zend/zend_compile.c
	Zend/zend_compile.h
	Zend/zend_constants.c
	Zend/zend_exceptions.c
	Zend/zend_execute.c
	Zend/zend_execute.h
	Zend/zend_execute_API.c
	Zend/zend_hash.c
	Zend/zend_highlight.c
	Zend/zend_language_parser.y
	Zend/zend_language_scanner.c
	Zend/zend_language_scanner_defs.h
	Zend/zend_variables.c
	Zend/zend_vm_def.h
	Zend/zend_vm_execute.h
	ext/date/php_date.c
	ext/dom/documenttype.c
	ext/hash/hash.c
	ext/iconv/iconv.c
	ext/mbstring/tests/zend_multibyte-10.phpt
	ext/mbstring/tests/zend_multibyte-11.phpt
	ext/mbstring/tests/zend_multibyte-12.phpt
	ext/mysql/php_mysql.c
	ext/mysqli/mysqli.c
	ext/mysqlnd/mysqlnd_reverse_api.c
	ext/mysqlnd/php_mysqlnd.c
	ext/opcache/ZendAccelerator.c
	ext/opcache/zend_accelerator_util_funcs.c
	ext/opcache/zend_persist.c
	ext/opcache/zend_persist_calc.c
	ext/pcre/php_pcre.c
	ext/pdo/pdo_dbh.c
	ext/pdo/pdo_stmt.c
	ext/pdo_pgsql/pgsql_driver.c
	ext/pgsql/pgsql.c
	ext/reflection/php_reflection.c
	ext/session/session.c
	ext/spl/spl_array.c
	ext/spl/spl_observer.c
	ext/standard/array.c
	ext/standard/basic_functions.c
	ext/standard/html.c
	ext/standard/mail.c
	ext/standard/php_array.h
	ext/standard/proc_open.c
	ext/standard/streamsfuncs.c
	ext/standard/user_filters.c
	ext/standard/var_unserializer.c
	ext/standard/var_unserializer.re
	main/php_variables.c
	sapi/phpdbg/phpdbg.c
	sapi/phpdbg/phpdbg_bp.c
	sapi/phpdbg/phpdbg_frame.c
	sapi/phpdbg/phpdbg_help.c
	sapi/phpdbg/phpdbg_list.c
	sapi/phpdbg/phpdbg_print.c
	sapi/phpdbg/phpdbg_prompt.c
2014-04-26 00:32:51 +04:00
Dmitry Stogov
5864ce8a44 Fixed compilation warnings 2014-04-22 17:46:34 +04:00
Dmitry Stogov
b886d9ce1e Use fast comparison function 2014-04-22 02:03:10 +04:00