summaryrefslogtreecommitdiff
path: root/ext/spl/tests
diff options
context:
space:
mode:
authorXinchen Hui <laruence@gmail.com>2017-08-09 11:29:13 +0800
committerXinchen Hui <laruence@gmail.com>2017-08-09 11:29:13 +0800
commit307acb661856850371fb77fafcb4edb0c8f11bd9 (patch)
tree954c50b2ccf36494a6b885e7ea0355d4bb106c48 /ext/spl/tests
parent42608a340152374328ff51eb02810c255e01937a (diff)
parentb06f8cb58bfb7310fff483cb739449e75cd90b79 (diff)
downloadphp-git-307acb661856850371fb77fafcb4edb0c8f11bd9.tar.gz
Merge branch 'PHP-7.0' into PHP-7.1
* PHP-7.0: Fixed bug #75049 (spl_autoload_unregister can't handle spl_autoload_functions results)
Diffstat (limited to 'ext/spl/tests')
-rw-r--r--ext/spl/tests/bug75049.phpt16
1 files changed, 16 insertions, 0 deletions
diff --git a/ext/spl/tests/bug75049.phpt b/ext/spl/tests/bug75049.phpt
new file mode 100644
index 0000000000..2f03a3b031
--- /dev/null
+++ b/ext/spl/tests/bug75049.phpt
@@ -0,0 +1,16 @@
+--TEST--
+Bug #75049 (spl_autoload_unregister can't handle spl_autoload_functions results)
+--FILE--
+<?php
+class Auto { public static function loader() {}}
+$autoloader = '\Auto::loader';
+
+echo (int)spl_autoload_register($autoloader);
+echo (int)spl_autoload_unregister($autoloader);
+echo (int)spl_autoload_register($autoloader);
+foreach (spl_autoload_functions() as $loader) {
+ echo (int)spl_autoload_unregister($loader);
+}
+echo (int)count(spl_autoload_functions());
+--EXPECTF--
+11110