foreach ($dirDataDrivers as $driverClass) { if (true === $driverClass::check($dirPath)) { // ERROR LINE!!! // do staff... } }
But my code felt into error message: syntax error, unexpected T_PAAMAYIM_NEKUDOTAYIM. I've googled around and found that it means "Unexpected double-colon" from Hebrew. You can read about this error in details on PHP documentation website in "Scope Resolution Operator" article.
So the solution for this problem is:
/** * call static method when class name defined dynamically via variable */ $res = call_user_func( array($driverClass, 'check') , $dirPath );
And finally I'm glad to announce that in PHP 5.3 and further versions this problem will not occur anymore and we can write this code as:
$res = $driverClass::check($dirPath); // As of PHP 5.3.0
Have a nice day!
Outstanding post I enjoy your current content; appreciate how we outlined everything, what you are doing an excellent employment lots of other folks that you as a result of which kind of useful weblogs offer attention to be able to people relevant to many points. When i go through other sorts of intriguing blogs out of your internet sites along with I'm a great deal curious along with your blogs expertise, My partner and i in addition did start to write post and this also sort dialogue actually guide me personally out. My partner and i currently saved ones site as well as distributed your current web sites for you to the friends not only me nevertheless every one of them similar to your current running a blog expertise, desire people create much more exciting information sites in this way just one and also all the best . on your future sites.
ReplyDeleteJimmy Wilson-Bourne Legacy Leather Jacket
Superb article.
ReplyDelete17 Again Jacket Buy