PHP self Keyword

The self keyword is one I hadn’t learned. It’s equivalent to using $this in a static context, so: self::callStaticMethod();.

I had classes where I was using Classname::getConn(); and having to change Classname every time I change classes.  This allows me to do so without that change.

Leave a comment

Name: (Required)

eMail: (Required)

Website:

Comment: