Home > Archive > 2010 > November

Scalar type hints in upcoming PHP version?

By Marc Ermshaus on Thursday, November 25, 2010 at 11:55 pm.

Sebastian Bergmann writes that PHP 5.3.99 (which might be released as PHP 5.4) will introduce type hinting for scalar data types (e. g. function f(int $i, string $s) {}).

There is one thing to note: It seems like there are no plans to check or enforce the new type hints in the interpreter, so this feature might be purely syntactical. I am not sure whether this makes a lot of sense to me.

Add new comment

Name*:

Please leave the following field empty:

E-Mail:

Website:

Message*:

Please use HTML for formatting. Allowed tags:
<a href="">, <blockquote cite="">, <em>, <ul>, <ol>, <li>, <pre>, <strong>, <![CDATA[ … ]]>

<p> tags will be added automatically.

All comments are published under the CC BY-SA license.