views:

105

answers:

1

As far as I know, PHP is a dynamic type language. We don't need to declare variable and don't need to define data type of variables and function return.

I found an article on sitepoint and one commenter said PHP is not dynamic enough because...

PHP does to many things at compile-time (like the whole “static” “self::” stuff) instead run-time.

I'm curious with it. Can someone define what is dynamic type language in simplest form? Is PHP dynamic enough?

Thanks

+3  A: 

Is PHP dynamic enough?

This is purely subjective, but I'd say "yes" : as long as it allows you/me do do what is needed from it, it is good/dynamic/fast/whatever enough ;-)


About the static/self stuff : there have been some great improvements in PHP 5.3 (released at the end of June this year) : there is now Late Static Binding, which has been implemented precisely to answer that concern :

This feature was named "late static bindings" with an internal perspective in mind. "Late binding" comes from the fact that static:: will no longer be resolved using the class where the method is defined but it will rather be computed using runtime information. It was also called a "static binding" as it can be used for (but is not limited to) static method calls.

Of course, PHP 5.3 is not yet widely available... But that'll come, one day or another ^^

Pascal MARTIN