cvs: ZendEngine2 / zend_builtin_functions.c /tests bug43483.phpt

[email protected] ("Dmitry Stogov")
Newsgroups php.zend-engine.cvs
Message-ID <cvsdmitry1203606878@cvsserver>
dmitry		Thu Feb 21 15:14:38 2008 UTC

  Modified files:              
    /ZendEngine2	zend_builtin_functions.c 
    /ZendEngine2/tests	bug43483.phpt 
  Log:
  Fixed bug #43483 (get_class_methods() does not list all visible methods)
  
  
http://cvs.php.net/viewvc.cgi/ZendEngine2/zend_builtin_functions.c?r1=1.365&r2=1.366&diff_format=u
Index: ZendEngine2/zend_builtin_functions.c
diff -u ZendEngine2/zend_builtin_functions.c:1.365 ZendEngine2/zend_builtin_functions.c:1.366
--- ZendEngine2/zend_builtin_functions.c:1.365	Tue Feb 19 16:39:34 2008
+++ ZendEngine2/zend_builtin_functions.c	Thu Feb 21 15:14:38 2008
@@ -17,7 +17,7 @@
    +----------------------------------------------------------------------+
 */
 
-/* $Id: zend_builtin_functions.c,v 1.365 2008/02/19 16:39:34 dmitry Exp $ */
+/* $Id: zend_builtin_functions.c,v 1.366 2008/02/21 15:14:38 dmitry Exp $ */
 
 #include "zend.h"
 #include "zend_API.h"
@@ -904,7 +904,7 @@
 		if ((mptr->common.fn_flags & ZEND_ACC_PUBLIC)
 		 || (EG(scope) &&
 		     (((mptr->common.fn_flags & ZEND_ACC_PROTECTED) &&
-		       instanceof_function(EG(scope), mptr->common.scope TSRMLS_CC))
+		       zend_check_protected(mptr->common.scope, EG(scope)))
 		   || ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) &&
 		       EG(scope) == mptr->common.scope)))) {
 			zstr key;
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/bug43483.phpt?r1=1.1&r2=1.2&diff_format=u
Index: ZendEngine2/tests/bug43483.phpt
diff -u /dev/null ZendEngine2/tests/bug43483.phpt:1.2
--- /dev/null	Thu Feb 21 15:14:38 2008
+++ ZendEngine2/tests/bug43483.phpt	Thu Feb 21 15:14:38 2008
@@ -0,0 +1,24 @@
+--TEST--
+Bug #43483 (get_class_methods() does not list all visible methods)
+--FILE--
+<?php
+class C {
+	public static function test() {
+		D::prot();
+		print_r(get_class_methods("D"));
+	}
+}
+class D extends C {
+	protected static function prot() {
+		echo "Successfully called D::prot().\n";
+	}
+}
+D::test();
+?>
+--EXPECT--
+Successfully called D::prot().
+Array
+(
+    [0] => prot
+    [1] => test
+)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.