When it started?

Okay, all the jokes aside ...

I just noticed that I was able to reference the static class using $this::$name. I don’t remember having ever come across this before, since I always used self::$nameeither $this->namein my classes.

In which version of PHP did you $thisstart working with static class properties?

+3
source share
1 answer

From the list of changes to PHP5, v5.3.0 ( http://php.net/ChangeLog-5.php#5.3.0 ):

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

So I guess this is a fairly recent appearance. :)

(, ... , .)

+4

Source: https://habr.com/ru/post/1752910/


All Articles