mirror of
https://github.com/adambard/learnxinyminutes-docs.git
synced 2025-08-09 16:26:53 +02:00
Fixed line wrapping
This commit is contained in:
@@ -455,8 +455,10 @@ class MyClass
|
|||||||
|
|
||||||
// Static variables and their visibility
|
// Static variables and their visibility
|
||||||
public static $publicStaticVar = 'publicStatic';
|
public static $publicStaticVar = 'publicStatic';
|
||||||
private static $privateStaticVar = 'privateStatic'; // Accessible within the class only
|
// Accessible within the class only
|
||||||
protected static $protectedStaticVar = 'protectedStatic'; // Accessible from the class and subclasses
|
private static $privateStaticVar = 'privateStatic';
|
||||||
|
// Accessible from the class and subclasses
|
||||||
|
protected static $protectedStaticVar = 'protectedStatic';
|
||||||
|
|
||||||
// Properties must declare their visibility
|
// Properties must declare their visibility
|
||||||
public $property = 'public';
|
public $property = 'public';
|
||||||
@@ -482,8 +484,9 @@ class MyClass
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
Declaring class properties or methods as static makes them accessible without needing an instantiation of the class.
|
* Declaring class properties or methods as static makes them accessible without
|
||||||
A property declared as static can not be accessed with an instantiated class object (though a static method can).
|
* needing an instantiation of the class. A property declared as static can not
|
||||||
|
* be accessed with an instantiated class object (though a static method can).
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public static function myStaticMethod()
|
public static function myStaticMethod()
|
||||||
@@ -674,10 +677,14 @@ $cls = new SomeOtherNamespace\MyClass();
|
|||||||
|
|
||||||
## More Information
|
## More Information
|
||||||
|
|
||||||
Visit the [official PHP documentation](http://www.php.net/manual/) for reference and community input.
|
Visit the [official PHP documentation](http://www.php.net/manual/) for reference
|
||||||
|
and community input.
|
||||||
|
|
||||||
If you're interested in up-to-date best practices, visit [PHP The Right Way](http://www.phptherightway.com/).
|
If you're interested in up-to-date best practices, visit
|
||||||
|
[PHP The Right Way](http://www.phptherightway.com/).
|
||||||
|
|
||||||
If you're coming from a language with good package management, check out [Composer](http://getcomposer.org/).
|
If you're coming from a language with good package management, check out
|
||||||
|
[Composer](http://getcomposer.org/).
|
||||||
|
|
||||||
For common standards, visit the PHP Framework Interoperability Group's [PSR standards](https://github.com/php-fig/fig-standards).
|
For common standards, visit the PHP Framework Interoperability Group's
|
||||||
|
[PSR standards](https://github.com/php-fig/fig-standards).
|
||||||
|
Reference in New Issue
Block a user