mirror of
https://github.com/php/php-src.git
synced 2024-11-27 03:44:07 +08:00
652c09ecf7
Cf. <http://git.php.net/?p=php-src.git;a=commit;h=0c7124e6beff0a7b0540691db370148be06d242a>.
101 lines
3.8 KiB
Plaintext
101 lines
3.8 KiB
Plaintext
PHP 8.0 INTERNALS UPGRADE NOTES
|
|
|
|
1. Internal API changes
|
|
a. Object Handlers API
|
|
b. ZEND_OVERLOADED_FUNCTION and corresponding call_method() object handler
|
|
c. TSRM changes
|
|
d. get() and set() object handlers
|
|
e. zend_parse_parameters 'L' specifier
|
|
f. Arginfo argument types
|
|
g. zend_free_op type and should_free argument of zend_get_zval_ptr()
|
|
h. zend_value_error()
|
|
i. get_closure() object handler
|
|
|
|
2. Build system changes
|
|
a. Abstract
|
|
b. Unix build system changes
|
|
c. Windows build system changes
|
|
|
|
3. Module changes
|
|
|
|
========================
|
|
1. Internal API changes
|
|
========================
|
|
|
|
a. Object Handlers API and some related functions, e.g. zend_call_method() and
|
|
zend_objects_clone_obj() were changed to receive zend_object* instead of
|
|
zval* and zend_string* instead of zval* for property names.
|
|
|
|
b. ZEND_OVERLOADED_FUNCTION and corresponding call_method() object handler
|
|
were removed. ZEND_INTERNAL_FUNCTION with ZEND_ACC_CALL_VIA_HANDLER and
|
|
defined "handler" callback should be used instead. This "handler" callback
|
|
should also take care about function cleanup. See ext/zend_test/test.c
|
|
for example.
|
|
|
|
c. The following things have been removed from TSRM:
|
|
- TSRMLS_DC
|
|
- TSRMLS_D
|
|
- TSRMLS_CC
|
|
- TSRMLS_C
|
|
- TSRMLS_FETCH
|
|
- TSRMLS_FETCH_FROM_CTX
|
|
- TSRMLS_SET_CTX
|
|
- tsrm_new_interpreter_context
|
|
- tsrm_set_interpreter_context
|
|
- tsrm_free_interpreter_context
|
|
- support for GNUPTH, SGI ST, and BETHREADS
|
|
|
|
d. The get() and set() object handlers have been removed. The get() handler
|
|
can generally be replaced with cast_object(). Some uses of set() may be
|
|
replaced by do_operation(). If set() was used to overload direct
|
|
assignments using "=", then this is no longer supported and the
|
|
functionality should be provided in some other way (for example, as
|
|
modification of an object property).
|
|
|
|
e. The zend_parse_parameters 'L' specifier and the Z_PARAM_STRICT_LONG()
|
|
family of macros have been removed. Use 'l' and Z_PARAM_LONG() instead,
|
|
which, despite the confusing name, actually have stricter input validation.
|
|
|
|
f. Arginfo argument types for internal functions are no longer checked.
|
|
Instead type checks should be performed using the zend_parse_parameters()
|
|
or ZEND_PARSE_PARAMETERS_*() APIs.
|
|
|
|
g. zend_free_op type and "should_free" argument of zend_get_zval_ptr() were
|
|
removed. It's possible to get the old "should_free" value using the
|
|
following code.
|
|
|
|
zval *ret = zend_get_zval_ptr(opline, opline->op1_type, &opline->op1,
|
|
execute_data, BP_VAR_R);
|
|
zval *should_free = (op_type & (IS_TMP_VAR|IS_VAR)) ? ret : NULL;
|
|
|
|
h. Added the zend_value_error() function, which is intended to be used
|
|
to raise ValueError when inappropriate argument values are passed
|
|
to functions.
|
|
|
|
i. get_closure() object handlers now accept an additional zend_bool parameter
|
|
`check_only`. If it is true, the handler is called to check whether the
|
|
object is callable; in this case the handler should not throw an exception.
|
|
|
|
========================
|
|
2. Build system changes
|
|
========================
|
|
|
|
a. Abstract
|
|
- Symbol HAVE_HASH_EXT is removed and is no longer defined. It should be
|
|
considered to have hash extension always available since PHP 7.4.
|
|
- Symbol HAVE_PCRE is removed and is no longer defined. It should be
|
|
considered to have pcre extension always available since PHP 7.4.
|
|
- Symbol HAVE_LOCALE_H has been removed and is no longer defined.
|
|
|
|
b. Unix build system changes
|
|
|
|
1. --enable-maintainer-zts is renamed --enable-zts for parity with Windows
|
|
and as recognition that ZTS is not a "maintainer" or experimental feature.
|
|
|
|
c. Windows build system changes
|
|
|
|
========================
|
|
3. Module changes
|
|
========================
|
|
|