-
-
Notifications
You must be signed in to change notification settings - Fork 492
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
oltho
committed
Sep 20, 2019
1 parent
2f396d1
commit 6aec321
Showing
1 changed file
with
53 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
<documentation title="Class Instantiation"> | ||
<standard> | ||
<![CDATA[ | ||
Instantiation of an object should be done with parenthesis. | ||
]]> | ||
</standard> | ||
<code_comparison> | ||
<code title="Valid: with parenthesis."> | ||
<![CDATA[ | ||
$a = new Foobar<em>()</em>; | ||
]]> | ||
</code> | ||
<code title="Invalid: without parenthesis."> | ||
<![CDATA[ | ||
$a = new Foobar; | ||
]]> | ||
</code> | ||
</code_comparison> | ||
<standard> | ||
<![CDATA[ | ||
Don't use spaces between object name and open parenthesis when instantiating new object. | ||
]]> | ||
</standard> | ||
<code_comparison> | ||
<code title="Valid: no spaces between object name and parenthesis."> | ||
<![CDATA[ | ||
$a = new Foobar(); | ||
]]> | ||
</code> | ||
<code title="Invalid: spaces between object name and parenthesis."> | ||
<![CDATA[ | ||
$a = new Foobar<em> </em>(); | ||
]]> | ||
</code> | ||
</code_comparison> | ||
<standard> | ||
<![CDATA[ | ||
Object instantiation by reference is not supported by PHP anymore. | ||
]]> | ||
</standard> | ||
<code_comparison> | ||
<code title="Valid: object instantiation without reference."> | ||
<![CDATA[ | ||
$a = new Foobar(); | ||
]]> | ||
</code> | ||
<code title="Invalid: object instantiation by reference."> | ||
<![CDATA[ | ||
$a = <em>&</em> new Foobar(); | ||
]]> | ||
</code> | ||
</code_comparison> | ||
</documentation> |