4 ms·
I sort of wish you had done: declare(types=strict); instead. That way other options can be added in the future.
by ars 12y ago
I sort of wish you had done:
declare(types=strict);
instead. That way other options can be added in the future.
- stephenr 12y agoi quite like this concept too, but both are still better than Hack's <?hh // strict Strict what?
- TazeTSchnitzel 12y agoHack's is a comment, not a proper pragma, too.
- stephenr 12y agoYeah that's kinda sucky too. I assume it's because they also support their "strict" mode with regular php files?
- TazeTSchnitzel 12y agoNot 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.
- giaour 12y agoI 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.
- TazeTSchnitzel 12y agoWell, there's also the fact that something that changes the language behaviour really should be a pragma and not a magic import statement.