(Uwe Schindler)
- Fixed bug #32405 (mysqli::fetch() returns bad data - 64bit problem). (Andrey)
- Fixed bug #32282 (Segfault in mysqli_fetch_array on 64-bit). (Georg)
+- Fixed bug #32296 (get_class_methods output has changed between 5.0.2 and
+ 5.0.3). (Dmitry)
- Fixed bug #32245 (xml_parser_free() in a function assigned to the xml parser
gives a segfault). (Rob)
- Fixed bug #32080 (segfault when assigning object to itself with
--- /dev/null
+--TEST--
+Bug #32296 get_class_methods output has changed between 5.0.2 and 5.0.3
+--FILE--
+<?php
+abstract class space{
+ function __construct(){}
+ abstract protected function unfold();
+}
+
+abstract class shape extends space{
+ private function x1() {}
+ protected final function unfold(){}
+}
+
+abstract class quad extends shape{
+ private function x2() {}
+ function buggy(){
+ $c = get_class($this);
+ $a = get_class_methods(get_class($this));
+ $b = get_class_methods($this);
+ print($c."\n".'a:');
+ print_r($a);
+ print('b:');
+ print_r($b);
+ }
+}
+
+class square extends quad{}
+
+$a = new square();
+$a->buggy();
+print_r(get_class_methods("square"));
+print_r(get_class_methods($a));
+?>
+--EXPECT--
+square
+a:Array
+(
+ [0] => x2
+ [1] => buggy
+ [2] => unfold
+ [3] => __construct
+)
+b:Array
+(
+ [0] => x2
+ [1] => buggy
+ [2] => unfold
+ [3] => __construct
+)
+Array
+(
+ [0] => buggy
+ [1] => __construct
+)
+Array
+(
+ [0] => buggy
+ [1] => __construct
+)
zend_class_entry *ce = NULL, **pce;
HashPosition pos;
zend_function *mptr;
- int instanceof;
if (ZEND_NUM_ARGS() != 1 || zend_get_parameters_ex(1, &class)==FAILURE) {
ZEND_WRONG_PARAM_COUNT();
RETURN_NULL();
}
- instanceof = EG(scope) && instanceof_function(EG(scope), ce TSRMLS_CC);
-
array_init(return_value);
zend_hash_internal_pointer_reset_ex(&ce->function_table, &pos);
while (zend_hash_get_current_data_ex(&ce->function_table, (void **) &mptr, &pos) == SUCCESS) {
if ((mptr->common.fn_flags & ZEND_ACC_PUBLIC)
- || (instanceof && ((mptr->common.fn_flags & ZEND_ACC_PROTECTED) || EG(scope) == mptr->common.scope))) {
+ || (EG(scope) &&
+ (((mptr->common.fn_flags & ZEND_ACC_PROTECTED) &&
+ instanceof_function(EG(scope), mptr->common.scope TSRMLS_CC))
+ || ((mptr->common.fn_flags & ZEND_ACC_PRIVATE) &&
+ EG(scope) == mptr->common.scope)))) {
MAKE_STD_ZVAL(method_name);
ZVAL_STRING(method_name, mptr->common.function_name, 1);
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval *), NULL);