note 106652 rejected from language.oop5.visibility by thiago
| From: | thiago@php.net | Date: | Thu, 24 Nov 2011 20:04:04 +0000 |
| Subject: | note 106652 rejected from language.oop5.visibility by thiago | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-184664@lists.php.net to get a copy of this message | ||
Note Submitter: luraschigabriel at gmail dot com
----
The sample code:
<?php
abstract class A {
protected function __construct() {
echo "A constructor\n";
}
}
class B extends A {
/* NO __construct() declared */
public function foo() {
echo "foo method";
}
}
class C {
public $B;
function __construct() {
$this->B = new B(); // Produces an error because B has no construct declared.
}
}
$c = new C();
?>
Produces an error: document line 18 - Call to protected A::__construct() from context 'C'.
This is a BUG???