File tree Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Expand file tree Collapse file tree 2 files changed +29
-0
lines changed Original file line number Diff line number Diff line change
1
+ --TEST--
2
+ Protocol Test That Protected And Private Methods Are Ignored
3
+ --FILE--
4
+ <?php
5
+
6
+ class Foo {
7
+ public function bar ($ abc ) {}
8
+ }
9
+ class Bar {
10
+ public function bar ($ abc ) {}
11
+ protected function bar2 () {}
12
+ private function bar3 () {}
13
+ }
14
+
15
+ function foo (<Bar > $ bar ) {
16
+ var_dump ($ bar );
17
+ }
18
+
19
+ foo (new Foo );
20
+ ?>
21
+ --EXPECT--
22
+ object(Foo)#1 (0) {
23
+ }
Original file line number Diff line number Diff line change @@ -1822,6 +1822,11 @@ static int protocol_check_function_implementation(void *function_entry TSRMLS_DC
1822
1822
zend_uint child_flags ;
1823
1823
zend_uint protocol_flags = ((zend_function * ) function_entry )-> common .fn_flags ;
1824
1824
1825
+ if (protocol_flags & (ZEND_ACC_PRIVATE | ZEND_ACC_PROTECTED )) {
1826
+ /* Skip the non-public API */
1827
+ return ZEND_HASH_APPLY_KEEP ;
1828
+ }
1829
+
1825
1830
TSRMLS_FETCH ();
1826
1831
ce = va_arg (args , zend_class_entry * );
1827
1832
result = va_arg (args , zend_bool * );
@@ -1835,6 +1840,7 @@ static int protocol_check_function_implementation(void *function_entry TSRMLS_DC
1835
1840
return ZEND_HASH_APPLY_STOP ;
1836
1841
}
1837
1842
child_flags = child -> common .fn_flags ;
1843
+
1838
1844
if ((child_flags & ZEND_ACC_STATIC ) != (protocol_flags & ZEND_ACC_STATIC )) {
1839
1845
* result = 0 ;
1840
1846
return ZEND_HASH_APPLY_STOP ;
You can’t perform that action at this time.
0 commit comments