summaryrefslogtreecommitdiffhomepage
path: root/ru-ru/php-ru.html.markdown
diff options
context:
space:
mode:
authorNasgul <nasguling@gmail.com>2016-10-26 23:05:14 +0300
committerven <vendethiel@hotmail.fr>2016-10-26 22:05:14 +0200
commita0978c90d62156ed4bb062a4e84a6f9df16527de (patch)
treefc7e694e34628dbebbc29525b8f14bf235850e71 /ru-ru/php-ru.html.markdown
parent9420a489f9b45bb00dfe8cf7fd2c8e978378abbc (diff)
Edit ru translations (#2519)
* Delete unnecessary line on english. Delete unnecessary line on english. * Update examples add new io and func requestServer * Update go-ru.html.markdown * Add Late Static Binding Add Late Static Binding
Diffstat (limited to 'ru-ru/php-ru.html.markdown')
-rw-r--r--ru-ru/php-ru.html.markdown39
1 files changed, 39 insertions, 0 deletions
diff --git a/ru-ru/php-ru.html.markdown b/ru-ru/php-ru.html.markdown
index b5feb105..76b3777c 100644
--- a/ru-ru/php-ru.html.markdown
+++ b/ru-ru/php-ru.html.markdown
@@ -684,6 +684,45 @@ use My\Namespace as SomeOtherNamespace;
$cls = new SomeOtherNamespace\MyClass();
+*//**********************
+* Позднее статическое связывание.
+*
+*/
+
+class ParentClass
+{
+ public static function who()
+ {
+ echo "I'm a " . __CLASS__ . "\n";
+ }
+
+ public static function test()
+ {
+ // self ссылается на класс в котором определен метод.
+ self::who();
+ // static ссылается на класс в котором метод вызван.
+ static::who();
+ }
+}
+
+ParentClass::test();
+/*
+I'm a ParentClass
+I'm a ParentClass
+*/
+
+class ChildClass extends ParentClass
+{
+ public static function who()
+ {
+ echo "But I'm " . __CLASS__ . "\n";
+ }
+}
+
+ChildClass::test();
+/*
+I'm a ParentClass
+But I'm ChildClass
*/
```