I have a php 5.2 on my server (cant update) and it drops error on a static::routin()
call. How to solve it? Anyway, is there a way, to detect if this type of call is available, so that an intelligent call-mechanism can be added?
Asked
Active
Viewed 63 times
3

John Smith
- 283
- 5
- 12
-
5.2 is oooold. And either you _can_ update, or you are on a shared host of a hoster you should leave, because he gives you unmaintained package versions. – KingCrunch Aug 28 '12 at 12:34
-
You should not be using static methods to begin with. – tereško Sep 19 '12 at 13:58
1 Answers
1
Late static bindings only work from PHP 5.3. To get the called class name in version 5.2 you have to use work arounds.
As of PHP 5.3.0, PHP implements a feature called late static bindings which can be used to reference the called class in a context of static inheritance.

Zevi Sternlicht
- 5,399
- 19
- 31
-
3I think the OP knows that -- he mentioned his PHP version and said he couldn't update. – jprofitt Aug 28 '12 at 12:32
-
1@jprofitt actually his language doesnt sound as if the OP gets that, secondly I have offered him a work around! – Zevi Sternlicht Aug 28 '12 at 12:35