2023-08-29 19:25:46 +00:00
|
|
|
PHP 8.4 INTERNALS UPGRADE NOTES
|
2010-08-30 10:26:31 +00:00
|
|
|
|
|
|
|
1. Internal API changes
|
2010-09-17 08:42:12 +00:00
|
|
|
|
2010-11-18 10:43:01 +00:00
|
|
|
2. Build system changes
|
|
|
|
|
2015-07-03 09:46:30 +00:00
|
|
|
3. Module changes
|
2010-11-18 10:43:01 +00:00
|
|
|
|
2021-12-09 17:15:59 +00:00
|
|
|
4. OpCode changes
|
|
|
|
|
2022-06-08 12:23:41 +00:00
|
|
|
5. SAPI changes
|
|
|
|
|
2010-08-30 10:26:31 +00:00
|
|
|
========================
|
|
|
|
1. Internal API changes
|
|
|
|
========================
|
|
|
|
|
Fix GH-12215: Module entry being overwritten causes type errors in ext/dom (PHP 8.4)
When we try to load an extension multiple times, we still overwrite the
type, module number, and handle. If the module number is used to
indicate module boundaries (e.g. in reflection and in dom, see e.g.
dom_objects_set_class_ex), then all sorts of errors can happen.
In the case of ext/dom, OP's error happens because the following
happens:
- The property handler is set up incorrectly in
dom_objects_set_class_ex() because the wrong module number is
specified. The class highest in the hierarchy is DOMNode, so the
property handler is incorrectly set to that of DOMNode instead of
DOMDocument.
- The documentElement property doesn't exist on DOMNode, it only exists
on DOMDocument, so it tries to read using zend_std_read_property().
As there is no user property called documentElement, that read
operation returns an undef value.
However, the type is still checked, resulting in the strange exception.
Solve this by changing the API such that the data is only overwritten if
it's owned data.
Closes GH-12246.
2023-09-19 18:18:55 +00:00
|
|
|
* zend_register_module_ex() now takes an additional int module_type argument.
|
|
|
|
This function will also assign the module number and type, there is no need
|
|
|
|
to do this at the call site anymore. Writing the handle should happen after
|
|
|
|
successful registration.
|
|
|
|
|
2023-10-06 17:07:37 +00:00
|
|
|
* ZPP now accepts a F or Z_PARAM_FUNC_NO_TRAMPOLINE_FREE type check.
|
|
|
|
This is identical to the 'f' or Z_PARAM_FUNC type check, except the FCC is
|
|
|
|
always initialized because it doesn't free trampolines.
|
|
|
|
Trampolines MUST be freed using zend_release_fcall_info_cache() or consumed.
|
2023-10-11 17:55:00 +00:00
|
|
|
Z_PARAM_FUNC_EX2 was added as well with the same arguments as Z_PARAM_FUNC_EX
|
|
|
|
plus an additional argument free_trampoline.
|
2023-10-06 17:07:37 +00:00
|
|
|
|
2024-01-10 22:19:23 +00:00
|
|
|
* The zend_object_iterator_funcs valid member has changed its signature from
|
|
|
|
int(*)(zend_object_iterator *) to zend_result(*)(zend_object_iterator *) to
|
|
|
|
be more in line with what callbacks are returning.
|
|
|
|
|
2024-01-12 14:18:42 +00:00
|
|
|
* The backwards compatibility headers ext/standard/{php_lcg.h,php_mt_rand.h,
|
|
|
|
php_rand.h,php_random.h} have been removed. Include ext/random/php_random.h
|
|
|
|
directly.
|
|
|
|
|
2024-02-12 21:10:39 +00:00
|
|
|
* The zend_*printf family of functions now supports the "%S" modifier to print
|
|
|
|
out zend_string*. This won't cut off the string if it embeds a NUL byte.
|
|
|
|
|
2024-02-26 13:17:14 +00:00
|
|
|
* The inet_aton() and win32/inet.h have been removed. Use platform-agnostic
|
|
|
|
inet_pton() from arpa/inet.h or ws2tcpip.h on Windows.
|
2024-02-23 22:11:47 +00:00
|
|
|
|
2024-02-26 13:04:33 +00:00
|
|
|
* zend_mm_set_custom_debug_handlers() has been removed from ZendMM, use
|
|
|
|
zend_mm_set_custom_handlers() instead which now supports DEBUG builds
|
|
|
|
|
|
|
|
* zend_mm_set_custom_handlers() has changed its signature from
|
|
|
|
void()(zend_mm_heap *heap,
|
|
|
|
void* (*_malloc)(size_t),
|
|
|
|
void (*_free)(void*),
|
|
|
|
void* (*_realloc)(void*, size_t))
|
|
|
|
to
|
|
|
|
void()(zend_mm_heap *heap,
|
|
|
|
void* (*_malloc)(size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC),
|
|
|
|
void (*_free)(void* ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC),
|
|
|
|
void* (*_realloc)(void*, size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC))
|
|
|
|
|
|
|
|
* zend_mm_get_custom_handlers() has changed its signature from
|
|
|
|
void()(zend_mm_heap *heap,
|
|
|
|
void* (**_malloc)(size_t),
|
|
|
|
void (**_free)(void*),
|
|
|
|
void* (**_realloc)(void*, size_t))
|
|
|
|
to
|
|
|
|
void()(zend_mm_heap *heap,
|
|
|
|
void* (**_malloc)(size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC),
|
|
|
|
void (**_free)(void* ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC),
|
|
|
|
void* (**_realloc)(void*, size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC))
|
|
|
|
|
|
|
|
* __zend_malloc() has changed their signature from
|
|
|
|
void(*)(size_t) to
|
|
|
|
void(*)(size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
|
|
|
|
|
|
|
* __zend_calloc() has changed their signature from
|
|
|
|
void(*)(size_t, size_t) to
|
|
|
|
void(*)(size_t, size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
|
|
|
|
|
|
|
* __zend_realloc() has changed their signature from
|
|
|
|
void(*)(void *, size_t) to
|
|
|
|
void(*)(void *, size_t ZEND_FILE_LINE_DC ZEND_FILE_LINE_ORIG_DC)
|
|
|
|
|
|
|
|
|
2010-11-18 10:43:01 +00:00
|
|
|
========================
|
|
|
|
2. Build system changes
|
|
|
|
========================
|
2021-08-31 17:13:49 +00:00
|
|
|
|
2024-01-17 11:21:08 +00:00
|
|
|
a. Abstract
|
2024-02-04 11:13:27 +00:00
|
|
|
- The configure option --with-imap has been removed.
|
2024-01-17 11:21:08 +00:00
|
|
|
- The configure option --with-mhash emits deprecation warning.
|
2024-02-07 21:47:56 +00:00
|
|
|
- The configure option --with-pdo-oci has been removed.
|
2024-01-17 11:21:08 +00:00
|
|
|
- The configure option --with-pspell has been removed.
|
2024-02-07 21:47:56 +00:00
|
|
|
- Symbol SIZEOF_SHORT removed (size of 2 on 32-bit and 64-bit platforms).
|
|
|
|
- Symbol DBA_CDB_MAKE removed in ext/dba.
|
2024-02-26 13:17:14 +00:00
|
|
|
- Symbol HAVE_LIBM has been removed.
|
|
|
|
- Symbol HAVE_INET_ATON has been removed.
|
2024-01-17 11:21:08 +00:00
|
|
|
|
|
|
|
b. Unix build system changes
|
2024-02-04 11:13:27 +00:00
|
|
|
- The configure option --with-imap-ssl has been removed.
|
2024-02-07 21:47:56 +00:00
|
|
|
- The configure option --with-oci8 has been removed.
|
2023-09-14 20:21:54 +00:00
|
|
|
- The configure option --with-zlib-dir has been removed.
|
2024-01-17 11:21:08 +00:00
|
|
|
- COOKIE_IO_FUNCTIONS_T symbol has been removed (use cookie_io_functions_t).
|
|
|
|
- HAVE_SOCKADDR_UN_SUN_LEN symbol renamed to HAVE_STRUCT_SOCKADDR_UN_SUN_LEN.
|
2024-02-06 22:21:42 +00:00
|
|
|
- HAVE_UTSNAME_DOMAINNAME symbol renamed to HAVE_STRUCT_UTSNAME_DOMAINNAME.
|
2024-01-17 11:21:08 +00:00
|
|
|
- PHP_CHECK_IN_ADDR_T M4 macro and 'in_addr_t' fallback definition to 'u_int'
|
|
|
|
removed (use AC_CHECK_TYPES Autoconf macro instead).
|
|
|
|
- HAVE_ODBC2 symbol has been removed in ext/odbc.
|
|
|
|
- Removed linking with obsolete dnet_stub library in ext/pdo_dblib.
|
|
|
|
- Removed checking and linking with obsolete libbind for some functions.
|
2024-02-01 13:41:30 +00:00
|
|
|
- Symbol HAVE_JSON has been removed (ext/json is always available since PHP
|
|
|
|
8.0).
|
2024-02-07 20:07:48 +00:00
|
|
|
- Symbol DARWIN has been removed (use __APPLE__ to target Darwin systems).
|
2024-02-09 18:11:49 +00:00
|
|
|
- Symbol MISSING_FCLOSE_DECL and M4 macro PHP_MISSING_FCLOSE_DECL removed.
|
2024-02-11 18:41:45 +00:00
|
|
|
- Symbol HAVE_BSD_ICONV has been removed.
|
2024-02-22 12:44:04 +00:00
|
|
|
- Symbol ZEND_FIBER_ASM has been removed.
|
2024-02-23 19:44:06 +00:00
|
|
|
- Symbols HAVE_DLOPEN and HAVE_DLSYM have been removed.
|
2024-02-11 21:14:46 +00:00
|
|
|
- M4 macro PHP_DEFINE (atomic includes) removed (use AC_DEFINE and config.h).
|
2024-02-13 18:37:16 +00:00
|
|
|
- M4 macro PHP_WITH_SHARED has been removed (use PHP_ARG_WITH).
|
2024-02-15 18:17:01 +00:00
|
|
|
- M4 macro PHP_STRUCT_FLOCK has been removed (use AC_CHECK_TYPES).
|
2024-02-16 12:29:20 +00:00
|
|
|
- M4 macro PHP_SOCKADDR_CHECKS has been removed (use AC_CHECK_TYPES and
|
|
|
|
AC_CHECK_MEMBERS).
|
2024-02-27 17:45:36 +00:00
|
|
|
- M4 macro PHP_CHECK_GCC_ARG has been removed since PHP 8.0 (use
|
|
|
|
AX_CHECK_COMPILE_FLAG).
|
2024-01-17 11:21:08 +00:00
|
|
|
|
|
|
|
c. Windows build system changes
|
2024-02-07 21:47:56 +00:00
|
|
|
- The configure options --with-oci8-11g, --with-oci8-12c, --with-oci8-19 have
|
|
|
|
been removed.
|
2024-01-17 11:21:08 +00:00
|
|
|
- Added Bison flag '-Wall' when generating lexer files as done in *nix build
|
|
|
|
system.
|
|
|
|
- HAVE_WIN32_NATIVE_THREAD, USE_WIN32_NATIVE_THREAD, ENABLE_THREADS symbols
|
|
|
|
in ext/mbstring/libmbfl removed.
|
2024-01-30 08:50:22 +00:00
|
|
|
- FIBER_ASSEMBLER and FIBER_ASM_ARCH Makefile variables removed in favor of
|
|
|
|
PHP_ASSEMBLER and FIBER_ASM_ABI.
|
2024-02-18 17:01:12 +00:00
|
|
|
- HAVE_PHP_SOAP symbol renamed to HAVE_SOAP.
|
2024-03-07 19:27:10 +00:00
|
|
|
- Unused symbols CONFIGURATION_FILE_PATH, DISCARD_PATH, HAVE_ERRMSG_H,
|
|
|
|
HAVE_REGCOMP, HAVE_RINT, NEED_ISBLANK, PHP_URL_FOPEN, REGEX, HSREGEX,
|
|
|
|
USE_CONFIG_FILE have been removed.
|
2023-09-14 20:21:54 +00:00
|
|
|
|
2015-01-25 21:14:40 +00:00
|
|
|
========================
|
|
|
|
3. Module changes
|
|
|
|
========================
|
2020-12-13 15:50:22 +00:00
|
|
|
|
2023-09-02 22:42:49 +00:00
|
|
|
a. ext/dom
|
|
|
|
- dom_read_t and dom_write_t now expect the function to return zend_result
|
|
|
|
instead of int.
|
2023-09-08 15:02:52 +00:00
|
|
|
- The macros DOM_NO_ARGS() and DOM_NOT_IMPLEMENTED() have been removed.
|
2024-01-12 23:00:26 +00:00
|
|
|
- New public APIs are available to handle callbacks from XPath, see
|
|
|
|
xpath_callbacks.h.
|
2024-03-09 15:56:00 +00:00
|
|
|
- Added public APIs to manipulate namespace data, see namespace_compat.h.
|
2023-09-02 22:42:49 +00:00
|
|
|
|
2023-10-07 12:19:54 +00:00
|
|
|
b. ext/random
|
|
|
|
- The macro RAND_RANGE_BADSCALING() has been removed. The implementation
|
|
|
|
should either be inlined and undefined behavior fixed or it should be
|
|
|
|
replaced by a non-biased scaler.
|
2024-01-09 18:04:29 +00:00
|
|
|
- The generate member of a php_random_algo is now expected to return
|
|
|
|
the new php_random_result struct, replacing the last_generated_size
|
|
|
|
member of the php_random_status struct and the generate_size member of
|
|
|
|
the php_random_algo struct.
|
2024-02-25 19:48:58 +00:00
|
|
|
- The php_random_status struct has been removed, since the previous change
|
|
|
|
reduced it to a single void* member containing the actual state, resulting
|
|
|
|
in needless indirection. Functions taking a php_random_algo struct pointer
|
|
|
|
and a php_random_status struct pointer as separate parameters now take a
|
|
|
|
single php_random_algo_with_state struct by value, making it easier to
|
|
|
|
pass around the state with its associated algorithm and thus reducing
|
|
|
|
the chance for mistakes.
|
2024-02-29 07:03:35 +00:00
|
|
|
- The seed member of a php_random_algo has been removed. As a replacement
|
|
|
|
engine-specific seeding functions are now exposed. This change allows
|
|
|
|
users to better take engine-specific behavior into account. As an example
|
|
|
|
Mt19937 ignored the upper half of the seed parameter of the generic
|
|
|
|
seeding function.
|
2024-02-01 18:09:35 +00:00
|
|
|
- The CSPRNG API (php_random_(bytes|int)_*) is now provided by the new
|
|
|
|
and much smaller php_random_csprng.h header. The new header is included
|
|
|
|
in php_random.h for compatibility with existing users.
|
2023-10-07 12:19:54 +00:00
|
|
|
|
2023-10-21 21:48:27 +00:00
|
|
|
c. ext/xsl
|
|
|
|
- The function php_xsl_create_object() was removed as it was not used
|
|
|
|
nor exported.
|
|
|
|
|
2023-11-13 19:18:19 +00:00
|
|
|
d. ext/libxml
|
|
|
|
- Added php_libxml_pretend_ctx_error_ex() to emit errors as if they had come
|
|
|
|
from libxml.
|
2024-01-03 19:03:56 +00:00
|
|
|
- Removed the "properties" HashTable field from php_libxml_node_object.
|
2024-03-09 15:56:00 +00:00
|
|
|
- Added a way to attached private data to a php_libxml_ref_obj.
|
|
|
|
- Added a way to fix a class type onto php_libxml_ref_obj.
|
2023-11-13 19:18:19 +00:00
|
|
|
|
2023-10-14 15:57:45 +00:00
|
|
|
e. ext/date
|
|
|
|
- Added the php_format_date_ex() API to format instances of php_date_obj.
|
2023-12-17 07:17:11 +00:00
|
|
|
- Added the php_date_initialize_from_ts_long() and
|
|
|
|
php_date_initialize_from_ts_double() to initialize a php_date_obj with
|
|
|
|
the given unix timestamp using GMT +00:00.
|
2023-10-14 15:57:45 +00:00
|
|
|
|
2023-12-11 18:43:26 +00:00
|
|
|
d. ext/pcre
|
|
|
|
- php_pcre_match_impl() now no longer has a use_flags argument.
|
|
|
|
When flags should be ignored, pass 0 to the flags argument.
|
|
|
|
- php_pcre_match_impl() and pcre_get_compiled_regex_cache_ex() now use
|
|
|
|
proper boolean argument types instead of integer types.
|
2024-03-05 19:51:04 +00:00
|
|
|
- pcre_get_compiled_regex_cache_ex() now provides an option to collect extra
|
|
|
|
options (from modifiers used in the expression, for example), and calls
|
|
|
|
pcre2_set_compile_extra_options() with those options.
|
2023-12-11 18:43:26 +00:00
|
|
|
|
2021-12-09 17:15:59 +00:00
|
|
|
========================
|
|
|
|
4. OpCode changes
|
|
|
|
========================
|
|
|
|
|
2024-02-06 16:02:00 +00:00
|
|
|
* New FRAMELESS_ICALL_[0,3] opcodes for faster internal function calls have been
|
|
|
|
added. These opcodes don't create a stack frame, but pass arguments via opcode
|
|
|
|
operands. They only work for functions that are known at compile-time, and
|
|
|
|
that provide a frameless handler (search for usages of the
|
|
|
|
ZEND_FRAMELESS_FUNCTION macro).
|
|
|
|
|
2022-06-08 12:23:41 +00:00
|
|
|
========================
|
|
|
|
5. SAPI changes
|
|
|
|
========================
|