note 97739 deleted from language.oop5.paamayim-nekudotayim by danbrown
| From: | danbrown@php.net | Date: | Wed, 05 May 2010 21:14:35 +0000 |
| Subject: | note 97739 deleted from language.oop5.paamayim-nekudotayim by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-168988@lists.php.net to get a copy of this message | ||
Note Submitter: remy dot damour at laposte dot net
----
As of php 5.3.0, you can use 'static' as scope value as in below example (add flexibility
to inheritance mechanism compared to 'self' keyword...)
<?php
class A {
const C = 'constA';
public function m() {
echo static::C;
}
}
class B extends A {
const C = 'constB';
}
$b = new B();
$b->m();
// output: constB