I was wondering whether it is the intent of the development team of the PHP language to make it into a full fledged statically typed OOP language at some point. Any ideas about this?

Edit:
To add to that: Will this be a performance hit for a non-compiled language? Or are there similar purpose scripting languages that have these capabilities already?

Edit 2:
I meant statically in stead of strong typed; adjusted. Thank you Daniel Pryden for the heads up.

Comments

its <i>sort of</i> OOP, it has the classes and interfaces, and you can even specify what kind of class you want passed into a method, but it doesn't seem to have the full fledged OOP label yet. ;D

Interesting that you changed it to "statically typed". I like Chris Smith's definitions: Strong typing: "A type system that I like and feel comfortable with." Weak typing: "A type system that worries me, or makes me feel uncomfortable." You might also want to read this link: pphsg.org/cdsmith/types.html

Written by Daniel Pryden

Accepted Answer

Careful. "Strongly typed" is a vague term that means different things to different people. "Statically typed" is a very specific thing. You can have "strong dynamic" (e.g. Python) and "loose static" (e.g. C, with type punning) systems.

Most of the responses here are assuming you're asking if PHP will ever become a statically typed language. I agree with the other responses -- it is highly unlikely that PHP will ever become a statically typed language.

However, PHP is also not currently very strongly typed, either. "Automatic type conversion" is one of the worst features in any language, IMHO. As to whether PHP will ever become a strongly typed (i.e. with a "sound" type system) dynamic language -- well, it's not a complete impossibility. But I wouldn't hold my breath. Especially when most of the PHP community doesn't even understand the difference anyway, what would be the point?

Written by Daniel Pryden
This page was build to provide you fast access to the question and the direct accepted answer.
The content is written by members of the stackoverflow.com community.
It is licensed under cc-wiki