-
-
Save nikic/c504dd761e7eebfca7ca to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Things that I would like to explicitely discourage in our documentation | |
(with a nice threat of deprecation): | |
What: Alternative array syntax | |
Kill: $foo{'bar'} | |
Instead: $foo['bar'] | |
What: PHP4-style property declaration | |
Kill: var $foo; | |
Instead: public $foo; | |
What: PHP4-style constructor | |
Kill: class Foo { function Foo() {} } | |
Instead: class Foo { function __construct() {} } | |
What: Weird string interpolation syntax (1) | |
Kill: "a ${foo} b" | |
Instead: "a $foo b" | |
What: Weird string interpolation syntax (2) | |
Kill: "a ${foo['bar']} b" | |
Instead: "a {$foo['bar']} b" or "a $foo[bar] b" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
As pointed out by @bwoebi, there is also:
What: Frivolous case seperator
Kill: case "value";
Instead: case "value":