]> granicus.if.org Git - php/commitdiff
MFH: Fixed bug #44144 & add test
authorHannes Magnusson <bjori@php.net>
Tue, 28 Jul 2009 22:25:31 +0000 (22:25 +0000)
committerHannes Magnusson <bjori@php.net>
Tue, 28 Jul 2009 22:25:31 +0000 (22:25 +0000)
ext/spl/tests/bug44144.phpt [new file with mode: 0644]

diff --git a/ext/spl/tests/bug44144.phpt b/ext/spl/tests/bug44144.phpt
new file mode 100644 (file)
index 0000000..2933d2f
--- /dev/null
@@ -0,0 +1,27 @@
+--TEST--
+Bug #44144 (spl_autoload_functions() should return object instance when appropriate)
+--SKIPIF--
+<?php if (!extension_loaded("spl")) print "skip"; ?>
+--FILE--
+<?php
+class Foo {
+  public function nonstaticMethod() {}
+}
+$foo = new Foo;
+spl_autoload_register(array($foo, 'nonstaticMethod'));
+$funcs = spl_autoload_functions();
+var_dump($funcs);
+?>
+--EXPECTF--
+array(1) {
+  [0]=>
+  array(2) {
+    [0]=>
+    object(Foo)#%d (0) {
+    }
+    [1]=>
+    string(15) "nonstaticMethod"
+  }
+}
+
+