php-src/ext/random
Máté Kocsis 8d12f666ae
Fix registration of internal readonly child classes (#15459)
Currently, internal classes are registered with the following code:

INIT_CLASS_ENTRY(ce, "InternalClass", class_InternalClass_methods);
class_entry = zend_register_internal_class_ex(&ce, NULL);
class_entry->ce_flags |= ...;

This has worked well so far, except if InternalClass is readonly. It is because some inheritance checks are run by zend_register_internal_class_ex before ZEND_ACC_READONLY_CLASS is added to ce_flags.

The issue is fixed by adding a zend_register_internal_class_with_flags() zend API function that stubs can use from now on. This function makes sure to add the flags before running any checks. Since the new API is not available in lower PHP versions, gen_stub.php has to keep support for the existing API for PHP 8.3 and below.
2024-08-24 12:36:54 +02:00
..
tests Use "must not" instead of "cannot" wording 2024-08-21 21:12:17 +01:00
config.m4 Merge branch 'PHP-8.3' 2024-08-13 20:57:21 +01:00
config.w32 random: Remove engine_combinedlcg.c (#15216) 2024-08-04 18:26:15 +02:00
CREDITS
csprng.c Merge branch 'PHP-8.3' 2024-08-13 20:57:21 +01:00
engine_mt19937.c Use zend_std_build_properties() to access zend_object.properties 2024-07-18 22:18:38 +02:00
engine_pcgoneseq128xslrr64.c random: Add PHPAPI to all php_random_algo definitions (#14088) 2024-04-30 21:01:13 +02:00
engine_secure.c random: Add PHPAPI to all php_random_algo definitions (#14088) 2024-04-30 21:01:13 +02:00
engine_user.c random: Add PHPAPI to all php_random_algo definitions (#14088) 2024-04-30 21:01:13 +02:00
engine_xoshiro256starstar.c random: Add PHPAPI to all php_random_algo definitions (#14088) 2024-04-30 21:01:13 +02:00
gammasection.c random: Pass algorithm and state together as php_random_algo_with_state (#13350) 2024-02-25 20:48:58 +01:00
php_random.h random: Optimize Randomizer::getBytes() (#15228) 2024-08-05 19:12:29 +02:00
php_random_csprng.h random: Make php_random_bytes() useable early during engine startup (#14291) 2024-05-30 17:24:34 +02:00
php_random_uint128.h random: Split the uint128 implementation into its own header (#13132) 2024-01-17 16:07:45 +01:00
php_random_zend_utils.h Add zend_random_bytes(), zend_random_bytes_insecure() functions (#14054) 2024-06-12 17:27:01 +02:00
random.c random: Remove engine_combinedlcg.c (#15216) 2024-08-04 18:26:15 +02:00
random.stub.php random: Deprecate lcg_value() (#15211) 2024-08-04 18:24:21 +02:00
random_arginfo.h Fix registration of internal readonly child classes (#15459) 2024-08-24 12:36:54 +02:00
randomizer.c Use "must not" instead of "cannot" wording 2024-08-21 21:12:17 +01:00
zend_utils.c Add zend_random_bytes(), zend_random_bytes_insecure() functions (#14054) 2024-06-12 17:27:01 +02:00