They are equivalent. If you are not coding by any code convention, use which you like better. Personally, I like to leave it out, as it is really just clutter to me.
More Related Contents:
- When should I use ‘self’ over ‘$this’?
- What does the variable $this mean in PHP?
- Use global variables in a class
- Can I extend a class using more than 1 class in PHP?
- Is it possible to define a class property value dynamically in PHP?
- Can I include code into a PHP class?
- mysqli_query() expects parameter 1 to be mysqli, object given
- Best practice on PHP singleton classes [duplicate]
- When to use static vs instantiated classes
- PHP OOP core framework
- declare property as object?
- Accessing Class Properties with Spaces
- Can you create instance properties dynamically in PHP?
- Returning a value in constructor function of a class
- How do I get a PHP class constructor to call its parent’s parent’s constructor?
- Nested or Inner Class in PHP
- Get all defined classes of a parent class in php
- How do I access static member of a class?
- Cannot use concatenation when declaring default class properties in PHP?
- Writing PHP functions that has many parameters/modifiers [closed]
- What is the difference between public, private, and protected?
- How to initialize static variables
- Initializing PHP class property declarations with simple expressions yields syntax error
- Pre-declare all private/local variables?
- Can I use PHP reserved names for my functions and classes?
- Understanding IoC Containers and Dependency Injection
- What is an abstract class in PHP?
- What’s difference between __construct and function with same name as class has? [duplicate]
- Static class initializer in PHP
- Call method by string?