|||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
?? Apr 2007, PHP 5.2.2RC2
- Fixed bug #41063 (chdir doesn't like root paths). (Dmitry)
+- Fixed bug #41061 ("visibility error" in ReflectionFunction::export()).
+ (Johannes)
- Fixed bug #40861 (strtotime() doesn't handle double negative relative time
units correctly). (Derick)
string_printf(str, "static ");
}
- /* These are mutually exclusive */
- switch (fptr->common.fn_flags & ZEND_ACC_PPP_MASK) {
- case ZEND_ACC_PUBLIC:
- string_printf(str, "public ");
- break;
- case ZEND_ACC_PRIVATE:
- string_printf(str, "private ");
- break;
- case ZEND_ACC_PROTECTED:
- string_printf(str, "protected ");
- break;
- default:
- string_printf(str, "<visibility error> ");
- break;
+ if (fptr->common.scope) {
+ /* These are mutually exclusive */
+ switch (fptr->common.fn_flags & ZEND_ACC_PPP_MASK) {
+ case ZEND_ACC_PUBLIC:
+ string_printf(str, "public ");
+ break;
+ case ZEND_ACC_PRIVATE:
+ string_printf(str, "private ");
+ break;
+ case ZEND_ACC_PROTECTED:
+ string_printf(str, "protected ");
+ break;
+ default:
+ string_printf(str, "<visibility error> ");
+ break;
+ }
+ string_printf(str, "method ");
+ } else {
+ string_printf(str, "function ");
}
- string_printf(str, fptr->common.scope ? "method " : "function ");
if (fptr->op_array.return_reference) {
string_printf(str, "&");
}
--- /dev/null
+--TEST--
+Reflection Bug #41061 ("visibility error" in ReflectionFunction::export())
+--SKIPIF--
+<?php extension_loaded('reflection') or die('skip'); ?>
+--FILE--
+<?php
+
+function foo() {
+}
+
+class bar {
+ private function foo() {
+ }
+}
+
+Reflection::export(new ReflectionFunction('foo'));
+Reflection::export(new ReflectionMethod('bar', 'foo'));
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+Function [ <user> function foo ] {
+ @@ %sbug41061.php 3 - 4
+}
+
+Method [ <user> private method foo ] {
+ @@ %sbug41061.php 7 - 8
+}
+
+===DONE===