0
0
mirror of https://github.com/php/php-src.git synced 2024-12-23 08:49:39 +08:00
Commit Graph

215 Commits

Author SHA1 Message Date
Dmitry Stogov
d90c6f2443 Removed useless zval_ptr_dtor() 2018-05-29 17:58:06 +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
eafa92ba9d zend_fcall_info_cache.calling_scope is not used by zend_call_function() and doesn't have to be initialized.
It's used only as a result of zend_is_callable() in forward_static_call and spl_autoload.
2018-05-03 19:27:04 +03:00
Christoph M. Becker
ef255c9f0f Revert "[ci skip] Add missing return types to protos"
This reverts commit a2c7c46d5e.

Since apparently there have been some mistakes in this commit, and it's
not clear yet how to solve them, we're reverting for now.
2018-02-27 17:40:03 +01:00
Gabriel Caruso
a2c7c46d5e [ci skip] Add missing return types to protos 2018-02-24 11:45:17 +01:00
Nikita Popov
3eaab04663 Merge branch 'PHP-7.2' 2018-01-15 12:16:16 +01:00
Nikita Popov
f3c1726d25 Merge branch 'PHP-7.1' into PHP-7.2 2018-01-15 12:16:00 +01:00
Nikita Popov
2023346973 Fixed bug 2018-01-15 12:15:40 +01:00
Dmitry Stogov
12c386f5b9 Use ZEND_CLOSURE_OBJECT() macro to resolve closure op_array to closure object through address calculation, instead of op_array->prototype reuse. (reapply 781e1573af, now it should be OK). 2018-01-11 22:15:45 +03:00
Dmitry Stogov
0ec631c996 Improve Closure::call(). Eliminate zend_fcall_info_init() call and reset ZEND_ACC_CLOSURE flag. 2018-01-11 21:23:52 +03:00
Dmitry Stogov
6ba10a03e7 Revert "Use ZEND_CLOSURE_OBJECT() macro to resolve closure op_array to closure object through address calculation, instead of op_array->prototype reuse." (this patch is incomplete or wrong)
This reverts commit 781e1573af.
2018-01-11 17:27:26 +03:00
Dmitry Stogov
781e1573af Use ZEND_CLOSURE_OBJECT() macro to resolve closure op_array to closure object through address calculation, instead of op_array->prototype reuse. 2018-01-11 16:25:28 +03: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
Xinchen Hui
ccd4716ec7 year++ 2018-01-02 12:53:31 +08:00
Dmitry Stogov
d9f5ea691f zend_fcall_info_cache.initialized is removed (zend_fcall_info_cache is initialized if zend_fcall_info_cache.function_handler is set). 2017-12-27 15:15:03 +03:00
Nikita Popov
76a001e32a Merge branch 'PHP-7.2' 2017-12-13 21:25:38 +01:00
Nikita Popov
652d30acdc Merge branch 'PHP-7.1' into PHP-7.2 2017-12-13 21:25:21 +01:00
Levi Morrison
580bae4a2c Fix copy-and-paste bugs 2017-12-13 21:25:00 +01: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
9cf87aa196 Avoid HashTable allocations for empty arrays (using zend_empty_array). 2017-10-24 17:27:31 +03:00
Andrea Faulds
1189fe5729 Merge branch 'PHP-7.2' 2017-09-29 21:40:04 +01:00
Andrea Faulds
15efa985df Merge branch 'PHP-7.1' into PHP-7.2 2017-09-29 21:38:52 +01:00
Andrea Faulds
4372293192 Merge branch 'PHP-7.0' into PHP-7.1 2017-09-29 21:38:30 +01:00
Andrea Faulds
abefb6dfe7 Fix bug 2017-09-29 21:38:08 +01:00
Dmitry Stogov
44e0b79ac6 Refactored array creation API. array_init() and array_init_size() are converted into macros calling zend_new_array(). They are not functions anymore and don't return any values. 2017-09-20 02:25:56 +03:00
Anatol Belski
bc5811f361 further sync for vim mode lines 2017-07-04 18:12:45 +02:00
Dmitry Stogov
db4561bfff Introduced "zif_handler" type (zif = zend internal function). 2017-06-08 16:52:39 +03:00
Anatol Belski
c698299550 Interned strings unification for TS/NTS
Hereby, interned strings are supported in thread safe PHP. The patch
implements two types of interned strings

- interning per process, strings are not freed till process end
- interning per request, strings are freed at request end

There is no runtime interning.

With Opcache, all the permanent iterned strings are copied into SHM on
startup, additional copying into SHM might happen on demand.
2017-03-04 10:39:13 +01:00
Sammy Kaye Powers
dac6c639bb Update copyright headers to 2017 2017-01-04 11:23:42 -06:00
Sammy Kaye Powers
478f119ab9 Update copyright headers to 2017 2017-01-04 11:14:55 -06:00
Sammy Kaye Powers
9e29f841ce Update copyright headers to 2017 2017-01-02 09:30:12 -06:00
Nikita Popov
9f92bb80e4 Merge branch 'PHP-7.1' 2016-09-30 22:10:32 +02:00
Nikita Popov
02ba9d71ab Unwrap reference returns in cufa etc 2016-09-30 22:10:01 +02:00
Dmitry Stogov
97628da24a Expose information about calls to "fake" closures (created through ReflectionFunction::getClosure), to allow extra specialization of RETRUN opcode handler. 2016-09-26 17:44:28 +03:00
Nikita Popov
dbe6a23194 Closure::fromCallable(): Getting non-static method statically
As this is new functionality, I'm going directly for a TypeError,
rather than a deprecation warning.
2016-07-05 15:52:03 +02:00
Nikita Popov
ceae9fb540 Closure::fromCallable(): Better LSB handling
The previous fix missed the "late" part of "late static binding" :)
2016-07-05 15:44:17 +02:00
Nikita Popov
e959a9b652 Closure::fromCallable(): Fix late static binding 2016-07-05 15:31:11 +02:00
Nikita Popov
e395b62c51 Closure::fromCallable(): Use fake closures 2016-07-05 15:13:51 +02:00
Nikita Popov
041476f4ae Closure::fromCallable(): Fix stack corruption
So the tests work at least...
2016-07-05 14:54:35 +02:00
Xinchen Hui
11d0101516 Some cleanup:
1. use c89 comments
2. exception should not be swallowd
3. ZVAL_OBJ may have problem if obj is NULL in the feature(who knows)
2016-07-05 15:31:46 +08:00
Danack
fc92eeeadf Added reflection test. Standardised filename for other tests. 2016-06-01 21:53:01 +01:00
Danack
4a7afdaa98 Typo. 2016-05-15 21:08:52 +01:00
Danack
63ca65daef Add Closure::fromCallable().
Add the ability to create closures from callable as part of RFC: https://wiki.php.net/rfc/closurefromcallable
2016-05-15 17:39:47 +01:00
Dmitry Stogov
7b94b958cc Intern some known (and offten used) strings. 2016-05-12 13:47:22 +03:00
Nikita Popov
3dd2df85b3 Drop unnecessary checks in get_closure 2016-04-16 20:23:23 +02:00
Nikita Popov
8c5861e6c6 Don't copy args in Closure::__invoke() 2016-04-16 14:47:27 +02:00
Nikita Popov
fea04a528b Drop dead assignment 2016-04-16 14:34:32 +02:00
Nikita Popov
75af8150f5 Forbid binding methods to incompatible $this
This prohibits binding closures returned by
ReflectionMethod::getClosure() to a $this, which is not an
instance of the method scope. This restriction was already in
place for internal methods, now it is extended to user methods.

ML discussion: http://markmail.org/message/zepnhdyr3kij6di6
2016-04-08 00:38:44 +02:00