Originariamente inviato da nourdine
ma l'hai letta la definizione che ho riportato dal manuale!?
"... and overridden members or methods of a class"
Che cosa ci trovi di scorretto?
Codice PHP:
<pre>
<?php
error_reporting(E_ALL | E_STRICT);
ini_set('display_error', 1);
class Animal {
protected static $environment = "The Earth\r\n";
}
class Dolphin extends Animal {
protected static $environment = "The Sea\r\n";
public function getEnv() {
echo self::$environment;
echo parent::$environment;
}
}
$d = new Dolphin();
$d->getEnv();
?>
</pre>