tags:

views:

93

answers:

1

Ok, all jokes aside...

I just noticed that I was able to refer to a static class propery using $this::$name. I don't remember ever running across that before since I always used self::$name or $this->name in my classes.

In what version of PHP did $this start working with static class properties?

+4  A: 

From the PHP5 changelog, v5.3.0 ( http://php.net/ChangeLog-5.php#5.3.0 ):

Added support for dynamic access of static members using $foo::myFunc(). (Etienne Kneuss)

So I suppose it's a fairly recent occurrence. :)

(Oh, and this refers to calling methods statically...I wonder if it's the same for accessing properties.)

Faisal
"I wonder if it's the same for accessing properties." -- *Yes*, it is.
salathe