note 106652 added to language.oop5.visibility

From: Date: Thu, 24 Nov 2011 19:46:09 +0000
Subject: note 106652 added to language.oop5.visibility
Groups: php.notes 
Request: Send a blank email to php-notes+get-184663@lists.php.net to get a copy of this message
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??? ---- Server IP: 201.216.232.3 Probable Submitter: 200.61.186.57 ---- Manual Page -- http://www.php.net/manual/en/language.oop5.visibility.php Edit -- https://master.php.net/note/edit/106652 Del: integrated -- https://master.php.net/note/delete/106652/integrated Del: useless -- https://master.php.net/note/delete/106652/useless Del: bad code -- https://master.php.net/note/delete/106652/bad+code Del: spam -- https://master.php.net/note/delete/106652/spam Del: non-english -- https://master.php.net/note/delete/106652/non-english Del: in docs -- https://master.php.net/note/delete/106652/in+docs Del: other reasons-- https://master.php.net/note/delete/106652 Reject -- https://master.php.net/note/reject/106652 Search -- https://master.php.net/manage/user-notes.php

« previous php.notes (#184663) next »