Browse Source
Fixed bug #38772 (inconsistent overriding of methods in different visibility contexts)
PECL_OPENSSL
Fixed bug #38772 (inconsistent overriding of methods in different visibility contexts)
PECL_OPENSSL
4 changed files with 64 additions and 17 deletions
@ -0,0 +1,42 @@ |
|||
--TEST-- |
|||
Bug #38772 (inconsistent overriding of methods in different visibility contexts) |
|||
--FILE-- |
|||
<?php |
|||
class A { |
|||
|
|||
public function __construct() { |
|||
$this -> foo(); |
|||
} |
|||
|
|||
private function foo() { |
|||
echo __METHOD__ . "\r\n"; |
|||
} |
|||
} |
|||
|
|||
class B extends A { |
|||
public function foo() { |
|||
echo __METHOD__ . "\r\n"; |
|||
} |
|||
} |
|||
|
|||
class C extends A { |
|||
protected function foo() { |
|||
echo __METHOD__ . "\r\n"; |
|||
} |
|||
} |
|||
|
|||
class D extends A { |
|||
private function foo() { |
|||
echo __METHOD__ . "\r\n"; |
|||
} |
|||
} |
|||
|
|||
$a = new A(); |
|||
$b = new B(); |
|||
$c = new C(); |
|||
$d = new D(); |
|||
--EXPECT-- |
|||
A::foo |
|||
A::foo |
|||
A::foo |
|||
A::foo |
|||
Write
Preview
Loading…
Cancel
Save
Reference in new issue