Inherit static properties in subclass without redeclaration?

Posted by David on Stack Overflow See other posts from Stack Overflow or by David
Published on 2010-05-01T22:11:16Z Indexed on 2010/05/01 22:17 UTC
Read the original article Hit count: 286

Hi, I'm having the same problem as this guy with the application I'm writing right now. The problem is that static properties are not being inherited in subclasses, and so if I use the static:: keyword in my main class, it sets the variable in my main class as well.

It works if I redeclare the static variables in my subclass, but I expect to have a large number of static properties and subclasses and wish to avoid code duplication. The top-rated response on the page I linked has a link to a few "workarounds", but it seems to have 404'd. Can anyone lend me some help or perhaps point me in the direction of said workarounds?

© Stack Overflow or respective owner

Related posts about php

Related posts about php5.3