Skip to content

Commit 51eac29

Browse files
Reflection isReadable/isWritable
1 parent 2843fbf commit 51eac29

3 files changed

Lines changed: 6 additions & 6 deletions

File tree

ext/reflection/php_reflection.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6700,11 +6700,11 @@ static bool check_visibility(uint32_t visibility, zend_class_entry *ce, zend_cla
67006700
return false;
67016701
}
67026702
if (visibility & ZEND_ACC_PRIVATE) {
6703-
return false;
6703+
return zend_check_friend(ce, scope);
67046704
}
67056705
ZEND_ASSERT(visibility & ZEND_ACC_PROTECTED);
67066706
if (!instanceof_function(scope, ce) && !instanceof_function(ce, scope)) {
6707-
return false;
6707+
return zend_check_friend(ce, scope);
67086708
}
67096709
}
67106710
return true;

ext/reflection/tests/ReflectionProperty_isReadable_friend.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ var_dump(new ReflectionProperty('A', 'privateProp')->isReadable('C', null));
2020
?>
2121
--EXPECT--
2222
bool(true)
23-
bool(false)
24-
bool(false)
23+
bool(true)
24+
bool(true)

ext/reflection/tests/ReflectionProperty_isWritable_friend.phpt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,5 +20,5 @@ var_dump(new ReflectionProperty('A', 'privateProp')->isWritable('C', null));
2020
?>
2121
--EXPECT--
2222
bool(true)
23-
bool(false)
24-
bool(false)
23+
bool(true)
24+
bool(true)

0 commit comments

Comments
 (0)