Hacker News new | ask | show | jobs
by ars 4068 days ago
I sort of wish you had done:

  declare(types=strict);
instead. That way other options can be added in the future.
3 comments

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.

Well, there's also the fact that something that changes the language behaviour really should be a pragma and not a magic import statement.
i quite like this concept too, but both are still better than Hack's

    <?hh // strict
Strict what?
Hack's is a comment, not a proper pragma, too.
Yeah that's kinda sucky too. I assume it's because they also support their "strict" mode with regular php files?