|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-11-06 17:08 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Thu Dec 04 06:00:01 2025 UTC |
Description: ------------ Property is declared twice, see below.. Reproduce code: --------------- <?php abstract class Base { private $var; function __construct() { $this->initAttributes(); $this->doit(); } final private function initAttributes( ) { $this->var = false; } abstract protected function doit(); } class Ext extends Base { protected function doit() { $this->var = 1; } } class Bla { static private $instance = false; static function instance() { Bla::$instance = new Ext(); return Bla::$instance; } } $bla = Bla::instance(); var_dump($bla); ?> Expected result: ---------------- object(Ext)#1 (2) { ["var:private"]=> int(1) } Actual result: -------------- object(Ext)#1 (2) { ["var:private"]=> bool(false) ["var"]=> int(1) }