PHP Classes

File: vendor/wp-coding-standards/wpcs/WordPress/Docs/Classes/ClassInstantiationStandard.xml

Recommend this page to a friend!
  Classes of Adeleye Ayodeji   Nolimitbuzz WP Theme   vendor/wp-coding-standards/wpcs/WordPress/Docs/Classes/ClassInstantiationStandard.xml   Download  
File: vendor/wp-coding-standards/wpcs/WordPress/Docs/Classes/ClassInstantiationStandard.xml
Role: Auxiliary data
Content type: text/plain
Description: Auxiliary data
Class: Nolimitbuzz WP Theme
WordPress theme to used as start of new themes
Author: By
Last change:
Date: 19 days ago
Size: 1,505 bytes
 

Contents

Class file image Download
<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 the object name and the open parenthesis when instantiating new object. ]]> </standard> <code_comparison> <code title="Valid: no whitespace between the object name and the parenthesis."> <![CDATA[ $a = new Foobar(); ]]> </code> <code title="Invalid: a space between the object name and the parenthesis."> <![CDATA[ $a = new Foobar<em> </em>(); ]]> </code> </code_comparison> <standard> <![CDATA[ Assigning the return value of "new" by reference was deprecated in PHP 5.3 and removed in PHP 7.0. New by reference should no longer be used. ]]> </standard> <code_comparison> <code title="Valid: object instantiation without reference."> <![CDATA[ $a = <em>new</em> Foobar(); ]]> </code> <code title="Invalid: object instantiation by reference."> <![CDATA[ $a = <em>& new</em> Foobar(); ]]> </code> </code_comparison> </documentation>