Re:Comparing the PHP 7 and Hack Type Systems
by ars on Sunday April 26, 2015 @10:52PM
(#9444183)
I sort of wish you had done:
instead. That way other options can be added in the future.
[ Parent
| on HN ]
Re:Comparing the PHP 7 and Hack Type Systems
by TazeTSchnitzel on Monday April 27, 2015 @07:33AM
(#9445547)
Not syntactically legal, unless it's special-cased or we unusually make a lowercase constant for that purpose. declare() takes a constant value.
Well, it could've been this:
declare(types="strict");
Alas, we are beyond feature-freeze now. Also, I quit PHP development.I believe there was some discussion of using the same strict declaration as javascript ('use "strict";'), but there's already an "easter egg" in PHP that causes your program to exit and prints out something like "I think you're using the wrong language."
For some reason, this Easter egg was deemed too important to displace with an actual language construct.
Re:Comparing the PHP 7 and Hack Type Systems
by TazeTSchnitzel on Wednesday April 29, 2015 @01:52PM
(#9460217)
Well, there's also the fact that something that changes the language behaviour really should be a pragma and not a magic import statement.
Re:Comparing the PHP 7 and Hack Type Systems
by stephenr on Monday April 27, 2015 @05:16AM
(#9445136)
i quite like this concept too, but both are still better than Hack's
<?hh // strict
Strict what?
Re:Comparing the PHP 7 and Hack Type Systems
by TazeTSchnitzel on Monday April 27, 2015 @07:34AM
(#9445552)
Hack's is a comment, not a proper pragma, too.