We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent d423910 commit 75cd4bcCopy full SHA for 75cd4bc
Zend/tests/arginfo_zpp_mismatch.inc
@@ -10,6 +10,7 @@ function skipFunction($function): bool {
10
|| $function === 'zend_create_unterminated_string'
11
|| $function === 'zend_test_array_return'
12
|| $function === 'zend_leak_bytes'
13
+ || $function === 'zend_test_arginfo_zpp_mismatch'
14
/* mess with output */
15
|| (is_string($function) && str_starts_with($function, 'ob_'))
16
|| $function === 'output_add_rewrite_var'
Zend/tests/arginfo_zpp_mismatch_suppress.phpt
@@ -0,0 +1,12 @@
1
+--TEST--
2
+Test suppressing arginfo / zpp mismatch
3
+--EXTENSIONS--
4
+zend_test
5
+--ENV--
6
+ZEND_SUPPRESS_ARGINFO_ZPP_MISMATCH=1
7
+--FILE--
8
+<?php
9
+zend_test_arginfo_zpp_mismatch(1);
+echo 'success';
+--EXPECT--
+success
Zend/tests/arginfo_zpp_mismatch_unsuppress.phpt
+Test don't suppress arginfo / zpp mismatch
+ZEND_SUPPRESS_ARGINFO_ZPP_MISMATCH=0
+--EXPECTF--
+Fatal error: Arginfo / zpp mismatch during call of zend_test_arginfo_zpp_mismatch() in %s on line %d
Zend/zend.c
@@ -1008,6 +1008,11 @@ void zend_startup(zend_utility_functions *utility_functions) /* {{{ */
1008
tsrm_set_new_thread_end_handler(zend_new_thread_end_handler);
1009
tsrm_set_shutdown_handler(zend_interned_strings_dtor);
1010
#endif
1011
+
1012
+#ifdef ZEND_DEBUG
1013
+ char *tmp = getenv("ZEND_SUPPRESS_ARGINFO_ZPP_MISMATCH");
1014
+ EG(suppress_arginfo_zpp_mismatch) = tmp && ZEND_ATOL(tmp);
1015
+#endif
1016
}
1017
/* }}} */
1018
Zend/zend_execute.c
@@ -1210,6 +1210,10 @@ static zend_never_inline ZEND_ATTRIBUTE_UNUSED bool zend_verify_internal_arg_typ
1210
* trust that arginfo matches what is enforced by zend_parse_parameters. */
1211
ZEND_API bool zend_internal_call_should_throw(zend_function *fbc, zend_execute_data *call)
1212
{
1213
+ if (EG(suppress_arginfo_zpp_mismatch)) {
1214
+ return 0;
1215
+ }
1216
1217
if (fbc->internal_function.handler == ZEND_FN(pass)) {
1218
/* Be lenient about the special pass function. */
1219
return 0;
Zend/zend_globals.h
@@ -271,6 +271,10 @@ struct _zend_executor_globals {
271
zend_string *filename_override;
272
zend_long lineno_override;
273
274
275
+ bool suppress_arginfo_zpp_mismatch;
276
277
278
void *reserved[ZEND_MAX_RESERVED_RESOURCES];
279
};
280
ext/zend_test/test.c
@@ -335,8 +335,21 @@ ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_iterable_legacy, 0, 1, IS_I
335
ZEND_ARG_TYPE_INFO_WITH_DEFAULT_VALUE(0, arg2, IS_ITERABLE, 1, "null")
336
ZEND_END_ARG_INFO()
337
338
+static ZEND_FUNCTION(zend_test_arginfo_zpp_mismatch)
339
+{
340
+ zend_long foo;
341
342
+ ZEND_PARSE_PARAMETERS_START(1, 1)
343
+ Z_PARAM_LONG(foo);
344
+ ZEND_PARSE_PARAMETERS_END();
345
+}
346
347
+ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_zend_test_arginfo_zpp_mismatch, 0, 0, IS_VOID, 0)
348
+ZEND_END_ARG_INFO()
349
350
static const zend_function_entry ext_function_legacy[] = {
351
ZEND_FE(zend_iterable_legacy, arginfo_zend_iterable_legacy)
352
+ ZEND_FE(zend_test_arginfo_zpp_mismatch, arginfo_zend_test_arginfo_zpp_mismatch)
353
ZEND_FE_END
354
355
AltStyle によって変換されたページ (->オリジナル) / アドレス: モード: デフォルト 音声ブラウザ ルビ付き 配色反転 文字拡大 モバイル
0 commit comments