سؤال

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?

هل كانت مفيدة؟

المحلول

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.

From the manual:

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.

One work around exists here.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top