Doc #72650 [Opn]: [FR] Traduction problem for visibility

From: Date: Sat, 23 Jul 2016 16:35:55 +0000
Subject: Doc #72650 [Opn]: [FR] Traduction problem for visibility
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-13745@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=72650&edit=1 ID: 72650 Updated by: pierrick@php.net Reported by: marsella dot lorenzo at gmail dot com Summary: [FR] Traduction problem for visibility Status: Open Type: Documentation Problem -Package: Translation problem +Package: Documentation problem PHP Version: Irrelevant Block user comment: N Private report: N New Comment: Also it's really bad practice because a parent class should not know about its child, the parent class do in fact have access to protected properties. <?php class A { public function test() { echo self::class . ':' . $this->foo; } } class B extends A { protected $foo = 'bar'; } (new B())->test(); // A:bar ?> Do we want to fix the english version to reflect the reality ? or should we fix the french one not to advocate bad practices ? Previous Comments: ------------------------------------------------------------------------ [2016-07-22 15:35:21] marsella dot lorenzo at gmail dot com Description: ------------ --- From manual page: http://www.php.net/language.oop5.visibility --- Traduction problem between : Members declared protected can be accessed only within the class itself and by inherited classes. L'accès aux éléments protégés est limité à la classe elle-même, ainsi qu'aux classes qui en héritent,--> et à ses classes parentes. <-- Protected members can't be accessed by parent class. Expected result: ---------------- L'accès aux éléments protégés est limité à la classe elle-même, ainsi qu'aux classes qui en héritent. ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=72650&edit=1

« previous php.doc.bugs (#13745) next »