Commit graph

652 commits

Author SHA1 Message Date
Xinchen Hui
85145e509e Unused var 2018-08-01 14:49:06 +08:00
Dmitry Stogov
3ccd985478 Improved method visibility checks 2018-07-31 13:05:57 +03:00
Dmitry Stogov
57527455eb Simplified property name to string conversion 2018-07-31 12:24:53 +03:00
Dmitry Stogov
c42f0ba4f7 Removed useless IS_UNDEF checks 2018-07-31 12:23:46 +03:00
Peter Kokot
8d3f8ca12a Remove unused Git attributes ident
The $Id$ keywords were used in Subversion where they can be substituted
with filename, last revision number change, last changed date, and last
user who changed it.

In Git this functionality is different and can be done with Git attribute
ident. These need to be defined manually for each file in the
.gitattributes file and are afterwards replaced with 40-character
hexadecimal blob object name which is based only on the particular file
contents.

This patch simplifies handling of $Id$ keywords by removing them since
they are not used anymore.
2018-07-25 00:53:25 +02:00
Dmitry Stogov
d775fe33d1 Better name: ZEND_PROPERTY_HAS => ZEND_PROPERTY_NOT_EMPTY 2018-07-24 09:31:57 +03:00
Xinchen Hui
1638a6e118 Give a meaningful name 2018-07-24 12:51:36 +08:00
Dmitry Stogov
412dd75e05 Perform checks for propertis started with '\\0' only for dynamic properties 2018-07-18 14:49:00 +03:00
Dmitry Stogov
4182b0855f Avoid copying 2018-07-10 13:17:33 +03:00
Dmitry Stogov
7da042cbd8 Use ZVAL_COPY_DEREF() 2018-07-10 12:11:10 +03:00
Dmitry Stogov
0db8c974a5 Avoid useless copying 2018-07-10 12:03:32 +03:00
Dmitry Stogov
dbb9867b3e Avoid useless checks for public functions 2018-07-09 17:30:14 +03:00
Dmitry Stogov
67b4c3379a Uze ZVAL_COPY_DEREF() instead of ZVAL_DEREF() and ZVAL_COPY() 2018-07-09 12:46:46 +03:00
Dmitry Stogov
af341213f7 se zval_ptr_dtor_str() instead of zend_string_release_ex(Z_STR(*), 0) 2018-07-04 12:08:07 +03:00
Dmitry Stogov
6dc0cd868d Fixed ZTS race condition (zend_class_entry->ce_flags of internal classes must not be modified, because internal class enties are shared between threads) 2018-06-27 12:33:20 +03:00
Dmitry Stogov
7f67513ca3 Lazy function copying from op_cache SHM into process memory 2018-06-25 19:53:58 +03:00
Nikita Popov
2543e61aed Fixed bug #76509
In PHP static properties are shared between inheriting classes,
unless they are explicitly overwritten. However, because this
functionality was implemented using reference, it was possible
to break the implementation by reassigning the static property
reference.

This is fixed by switching the implementation from using references
to using INDIRECTs, which cannot be affected by userland code.
2018-06-25 15:04:09 +02:00
Dmitry Stogov
34e58a6447 Reduced overhead of magic method calls (__get/__set/__unset/__isset/__dectructor/__clone). 2018-06-22 14:29:54 +03:00
Dmitry Stogov
4418d61ca3 Avoid reusing zend_function.common.prototype for magic things (use reserved fields instead). 2018-06-21 13:09:25 +03:00
Dmitry Stogov
f2b4ec4bdc Export standard object handlers, to avoid indirect access 2018-05-31 11:57:22 +03:00
Dmitry Stogov
5eb1f92f31 Use zend_string_release_ex() instread of zend_string_release() in places, where we sure about string persistence. 2018-05-28 16:27:12 +03:00
Dmitry Stogov
a795bd8265 Optimize zend_hash_real_init() 2018-03-23 00:13:45 +03:00
Dmitry Stogov
d7f2dc4ec6 Improve HashTable iterators handling:
- Avoid iterators check/update on each HashTable update opration
- Keep position equal (or above) nNumUsed instead of HT_INVALID_IDX
- Fixed iterators handling in array_unshift()
2018-03-22 02:41:49 +03:00
Dmitry Stogov
1af60a2a71 Keep initialized object_handlers structures in read-only memory. 2018-03-14 14:01:45 +03:00
Dmitry Stogov
58880e3fc1 Get rid of IS_OBJ_USE_GUARDS and IS_OBJ_HAS_GUARDS flags 2018-02-27 17:38:56 +03:00
Dmitry Stogov
5e8aa036f2 Access extra data stored in zval through macros 2018-01-23 12:56:22 +03:00
Dmitry Stogov
b3e22da745 Use OBJ_FLAGS() macro to access object flags (even if they are currently stored together with GC_FLAGS) 2018-01-22 15:57:00 +03:00
Dmitry Stogov
6634d5e313 Use HT_FLAGS() macro 2018-01-22 14:58:16 +03:00
Dmitry Stogov
c4fa7345dc Removed useless separation 2018-01-17 03:00:11 +03:00
Gabriel Caruso
6400264856 Trailing whitespaces
Signed-off-by: Gabriel Caruso <carusogabriel34@gmail.com>
2018-01-03 14:38:00 +01:00
Xinchen Hui
a6519d0514 year++ 2018-01-02 12:57:58 +08:00
Xinchen Hui
7a7ec01a49 year++ 2018-01-02 12:55:14 +08:00
Nikita Popov
b2b2b437af Add _IS_NUMBER as cast_object() target type
convert_scalar_to_number() will now call cast_object() with an
_IS_NUMBER argument, in which case the cast handler should return
either an integer or floating point number, whichever is more
appropriate.

Previously convert_scalar_to_number() unconditionally converted
objects to integers instead.

Fixes bug #53033.
Fixes bug #54973.
Fixes bug #73108.
2017-12-26 12:39:06 +01:00
Nikita Popov
182317f6b6 Remove unnecessary type check 2017-12-25 21:21:05 +01:00
Nikita Popov
2667ddc46d Remove unnecessary readobj==writeobj checks
This can no longer be the case since PHP 7. The writeobj must
always point to a different zval.
2017-12-25 21:19:45 +01:00
Xinchen Hui
4dfbfe93aa Use cheaper API 2017-12-18 11:55:14 +08:00
Dmitry Stogov
6a9d2b2190 Cleanup type conversion 2017-12-07 19:24:55 +03:00
Dmitry Stogov
74c84cd7f0 Use zend_string_equal*() API for zend_string equality check instead of direct memcmp() usage. 2017-12-04 17:17:02 +03:00
Xinchen Hui
60c742979d Merge branch 'PHP-7.2'
* PHP-7.2:
  Update NEWS
  Fixed bug #75573 (Segmentation fault in 7.1.12 and 7.0.26)
  Revert "ext/sodium: pwhash: do not warn on low parameters"

Conflicts:
	Zend/zend_object_handlers.c
2017-11-29 14:54:05 +08:00
Xinchen Hui
bedf6093ad Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed bug #75573 (Segmentation fault in 7.1.12 and 7.0.26)
2017-11-29 14:46:44 +08:00
Xinchen Hui
3b9ba7b6bd Fixed bug #75573 (Segmentation fault in 7.1.12 and 7.0.26) 2017-11-29 14:46:21 +08:00
Dmitry Stogov
ccc12b82da Avoid unnecessary reference-counting on strings. 2017-11-16 17:09:32 +03:00
Dmitry Stogov
49ea143bbd Encapsulate reference-counting primitives.
Prohibit direct update of GC_REFCOUNT(), GC_SET_REFCOUNT(), GC_ADDREF() and GC_DELREF() shoukf be instead.
Added mactros to validate reference-counting (disabled for now).
These macros are going to be used to eliminate race-condintions during reference-counting on data shared between threads.
2017-10-27 01:28:58 +03:00
Dmitry Stogov
aeca761856 Removed useless reallocations 2017-10-26 19:13:53 +03:00
Dmitry Stogov
0366684ce3 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed indirect modification of magic ArrayAccess method arguments
2017-10-26 16:17:49 +03:00
Dmitry Stogov
1d846fdfb2 Merge branch 'PHP-7.1' into PHP-7.2
* PHP-7.1:
  Fixed indirect modification of magic ArrayAccess method arguments
2017-10-26 16:07:49 +03:00
Dmitry Stogov
503df277ab Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0:
  Fixed indirect modification of magic ArrayAccess method arguments
2017-10-26 16:04:20 +03:00
Dmitry Stogov
98eee90734 Fixed indirect modification of magic ArrayAccess method arguments 2017-10-26 16:03:42 +03:00
Dmitry Stogov
0772b32ef6 Restore object copying on magic method calls (It was removed in master only). 2017-10-26 14:04:42 +03:00
Dmitry Stogov
b09e398304 Merge branch 'PHP-7.2'
* PHP-7.2:
  Fixed indirect modification of magic method arguments.
2017-10-26 13:35:39 +03:00