Skip to content

Commit 638b5a4

Browse files
committed
Do not warn but enable legacy cnbversion test
1 parent 4760df5 commit 638b5a4

File tree

3 files changed

+3
-12
lines changed

3 files changed

+3
-12
lines changed

Zend/zend_API.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2865,8 +2865,10 @@ ZEND_API zend_result zend_register_functions(zend_class_entry *scope, const zend
28652865
}
28662866
}
28672867
if (ZEND_TYPE_IS_ITERABLE_FALLBACK(new_arg_info[i].type)) {
2868+
/* Do not warn?
28682869
zend_error(E_CORE_WARNING, "iterable type is now a compile time alias for array|Traversable,"
28692870
" regenerate the argument info via the php-src gen_stub build script");
2871+
*/
28702872
zend_type legacy_iterable = ZEND_TYPE_INIT_CLASS_CONST_MASK(ZSTR_KNOWN(ZEND_STR_TRAVERSABLE),
28712873
(new_arg_info[i].type.type_mask|_ZEND_TYPE_UNION_BIT|MAY_BE_ARRAY));
28722874
memcpy(&new_arg_info[i].type, &legacy_iterable, sizeof(zend_type));

ext/zend_test/test.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -615,8 +615,7 @@ PHP_MINIT_FUNCTION(zend_test)
615615
zend_test_string_enum = register_class_ZendTestStringEnum();
616616
zend_test_int_enum = register_class_ZendTestIntEnum();
617617

618-
/* Register legacy iterable function, this generates E_CORE_WARNING on startup */
619-
//zend_register_functions(NULL, ext_function_legacy, NULL, EG(current_module)->type);
618+
zend_register_functions(NULL, ext_function_legacy, NULL, EG(current_module)->type);
620619

621620
// Loading via dl() not supported with the observer API
622621
if (type != MODULE_TEMPORARY) {

ext/zend_test/tests/zend_legacy_iterable.phpt

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,5 @@
11
--TEST--
22
Test that legacy IS_ITERABLE arg info type generates a notice
3-
--SKIPIF--
4-
<?php
5-
if (true) {
6-
die('skip only if testing startup warnings contaminate all test');
7-
}
83
--EXTENSIONS--
94
zend_test
105
--FILE--
@@ -22,11 +17,6 @@ var_dump(zend_iterable_legacy(gen(), gen()));
2217
?>
2318
==DONE==
2419
--EXPECT--
25-
Warning: iterable type is now a compile time alias for array|Traversable, regenerate the argument info via the php-src gen_stub build script in Unknown on line 0
26-
27-
Warning: iterable type is now a compile time alias for array|Traversable, regenerate the argument info via the php-src gen_stub build script in Unknown on line 0
28-
29-
Warning: iterable type is now a compile time alias for array|Traversable, regenerate the argument info via the php-src gen_stub build script in Unknown on line 0
3020
array(0) {
3121
}
3222
array(0) {

0 commit comments

Comments
 (0)