Skip to content

Commit fd835d0

Browse files
committed
Deprecate BONKERS SPL behaviour
1 parent 0125bdb commit fd835d0

File tree

2 files changed

+4
-1
lines changed

2 files changed

+4
-1
lines changed

Zend/zend_autoload.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ ZEND_FUNCTION(autoload_unregister_class)
217217
* This is forward-ported from SPL */
218218
if (ZEND_FCC_INITIALIZED(fcc) && fcc.function_handler->type == ZEND_INTERNAL_FUNCTION &&
219219
fcc.function_handler->internal_function.handler == zif_autoload_call_class) {
220+
zend_error(E_DEPRECATED, "Flushing the class autoloader table by passing autoload_call_class() is deprecated");
220221
// Don't destroy the hash table, as we might be iterating over it right now.
221222
zend_hash_clean(&EG(autoloaders).class_autoload_functions);
222223
RETURN_TRUE;

ext/spl/tests/spl_autoload_002.phpt

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ spl_autoload_unregister('spl_autoload');
3535
var_dump(spl_autoload_functions());
3636

3737
?>
38-
--EXPECT--
38+
--EXPECTF--
3939
array(0) {
4040
}
4141
array(1) {
@@ -56,6 +56,8 @@ array(2) {
5656
[1]=>
5757
string(16) "SplAutoloadTest2"
5858
}
59+
60+
Deprecated: Flushing the class autoloader table by passing autoload_call_class() is deprecated in %s on line %d
5961
array(0) {
6062
}
6163
array(1) {

0 commit comments

Comments
 (0)