com php-src: test script for bug #61697: ext/spl/tests/bug61697.phpt
| From: | Xinchen Hui | Date: | Wed, 18 Jul 2012 11:19:31 +0000 |
| Subject: | com php-src: test script for bug #61697: ext/spl/tests/bug61697.phpt | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-69628@lists.php.net to get a copy of this message | ||
Commit: 8238c6a4c815220045322ac3c524b98613639f97
Author: Xinchen Hui <laruence@php.net> Wed, 18 Jul 2012 19:19:31 +0800
Parents: f13288de96b9cc064b976a384fad73a191891721
Branches: master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=8238c6a4c815220045322ac3c524b98613639f97
Log:
test script for bug #61697
Bugs:
https://bugs.php.net/61697
Changed paths:
A ext/spl/tests/bug61697.phpt
Diff:
diff --git a/ext/spl/tests/bug61697.phpt b/ext/spl/tests/bug61697.phpt
new file mode 100644
index 0000000..d95caef
--- /dev/null
+++ b/ext/spl/tests/bug61697.phpt
@@ -0,0 +1,26 @@
+--TEST--
+Bug #61697 (spl_autoload_functions returns lambda functions incorrectly)
+--XFAIL--
+Bug #61697 not fixed yet
+--FILE--
+<?php
+
+function f1($class) { echo "f1: [[$class]]\n"; }
+function f2($class) { echo "f2: [[$class]]\n"; }
+
+spl_autoload_register('f1');
+spl_autoload_register('f2');
+spl_autoload_register(create_function('$class', 'echo "cf1:
[[$class]]\n";'));
+spl_autoload_register(create_function('$class', 'echo "cf2:
[[$class]]\n";'));
+
+foreach (spl_autoload_functions() AS $func)
+{
+ spl_autoload_unregister($func);
+}
+
+print_r(spl_autoload_functions());
+?>
+--EXPECTF--
+Array
+(
+)