Commit 6214a216593 for php.net
commit 6214a2165936af4c9d03f3ff083d0a2afd67a4d3
Author: Gina Peter Banyard <girgias@php.net>
Date: Sun Aug 9 21:12:20 2026 +0100
spl: deprecate spl_classes()
RFC: https://wiki.php.net/rfc/deprecations_php_8_6#deprecate_spl_classes
diff --git a/ext/spl/php_spl.stub.php b/ext/spl/php_spl.stub.php
index 814a5db9bd9..2c84161e43a 100644
--- a/ext/spl/php_spl.stub.php
+++ b/ext/spl/php_spl.stub.php
@@ -39,6 +39,7 @@ function spl_autoload_unregister(callable $callback): bool {}
* @return array<string, string>
* @refcount 1
*/
+#[\Deprecated(message: "use ReflectionExtension::getClassNames() instead", since: "8.6")]
function spl_classes(): array {}
/** @refcount 1 */
diff --git a/ext/spl/php_spl_arginfo.h b/ext/spl/php_spl_arginfo.h
index e9e34434479..fc3f4c08022 100644
Binary files a/ext/spl/php_spl_arginfo.h and b/ext/spl/php_spl_arginfo.h differ
diff --git a/ext/spl/tests/spl_classes.phpt b/ext/spl/tests/spl_classes.phpt
index a47c86eff83..6630201eee3 100644
--- a/ext/spl/tests/spl_classes.phpt
+++ b/ext/spl/tests/spl_classes.phpt
@@ -8,5 +8,6 @@
<?php
var_dump(is_array(spl_classes()));
?>
---EXPECT--
+--EXPECTF--
+Deprecated: Function spl_classes() is deprecated since 8.6, use ReflectionExtension::getClassNames() instead in %s on line %d
bool(true)