note 97199 rejected from language.oop5.basic by danbrown

From: Date: Thu, 08 Apr 2010 13:34:14 +0000
Subject: note 97199 rejected from language.oop5.basic by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-168022@lists.php.net to get a copy of this message
Note Submitter: krishansharma25 at gmail dot com ---- <?php error_reporting( E_STRICT); class SimpleClass { public $var = 'a default value'; public function displayVar($a) { echo $this->var."++".$a."<br>"; } } class SimpleClass2 extends SimpleClass { public $var = 'a default value in sub class'; public function displayVar($a,$b) { echo $this->var."++".$a."****".$b."<br>"; } } $obj = new SimpleClass2(); $obj->displayVar("aaa"); ?> Above code should give an e_strict message but it does not.(When overriding methods, the parameter signature should remain the same or PHP will generate an E_STRICT level error. This does not apply to the constructor, which allows overriding with different parameters. ) Is there any updation in php or i am missing somethig. Please revert if someone know its reason...

« previous php.notes (#168022) next »