Doc #80651 [NEW]: document : Example #1 chinese language
From: super at rongsp dot com
Operating system: windows10
PHP version: Irrelevant
Package: Documentation problem
Bug Type: Documentation Problem
Bug description:document : Example #1 chinese language
Description:
------------
---
From manual page: https://php.net/language.oop5.static
---
From https://www.php.net/manual/zh/language.oop5.static.php
<?php
class Foo
{
public static $my_static = 'foo';
public function staticValue() {
return self::$my_static;
}
}
class Bar extends Foo
{
public function fooStatic() {
return parent::$my_static;
}
}
print Foo::$my_static . "\n";
$foo = new Foo();
print $foo->staticValue() . "\n";
print $foo->my_static . "\n"; // Undefined "Property" my_static
print $foo::$my_static . "\n";
$classname = 'Foo';
print $classname::$my_static . "\n"; // As of PHP 5.3.0
print Bar::$my_static . "\n";
$bar = new Bar();
print $bar->fooStatic() . "\n";
?>
</programlisting>
</example>
<example>
<title>éææ¹æ³ç¤ºä¾</title>
<programlisting role="php">
<![CDATA[
<?php
class Foo {
public static function aStaticMethod() {
// ...
}
}
Foo::aStaticMethod();
$classname = 'Foo';
$classname::aStaticMethod(); // èª PHP 5.3.0 èµ·
?>
--------------------------
</programlisting>
</example>
<example>
<title>éææ¹æ³ç¤ºä¾</title>
<programlisting role="php">
<![CDATA[
--------------------------
Test script:
---------------
<?php
class Foo
{
public static $my_static = 'foo';
public function staticValue() {
return self::$my_static;
}
}
class Bar extends Foo
{
public function fooStatic() {
return parent::$my_static;
}
}
print Foo::$my_static . "\n";
$foo = new Foo();
print $foo->staticValue() . "\n";
print $foo->my_static . "\n"; // Undefined "Property" my_static
print $foo::$my_static . "\n";
$classname = 'Foo';
print $classname::$my_static . "\n"; // As of PHP 5.3.0
print Bar::$my_static . "\n";
$bar = new Bar();
print $bar->fooStatic() . "\n";
?>
<?php
class Foo {
public static function aStaticMethod() {
// ...
}
}
Foo::aStaticMethod();
$classname = 'Foo';
$classname::aStaticMethod(); // èª PHP 5.3.0 èµ·
?>
--
Edit bug report at https://bugs.php.net/bug.php?id=80651&edit=1
--
Fix committed: https://bugs.php.net/fix.php?id=80651&r=fixed
Fixed in release: https://bugs.php.net/fix.php?id=80651&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=80651&r=needtrace
Need Reproduce Script: https://bugs.php.net/fix.php?id=80651&r=needscript
Try newer version: https://bugs.php.net/fix.php?id=80651&r=oldversion
Not developer issue: https://bugs.php.net/fix.php?id=80651&r=support
Expected behavior: https://bugs.php.net/fix.php?id=80651&r=notwrong
Not enough info: https://bugs.php.net/fix.php?id=80651&r=notenoughinfo
Submitted twice: https://bugs.php.net/fix.php?id=80651&r=submittedtwice
register_globals: https://bugs.php.net/fix.php?id=80651&r=globals
PHP version support discontinued: https://bugs.php.net/fix.php?id=80651&r=phptooold
Daylight Savings: https://bugs.php.net/fix.php?id=80651&r=dst
IIS Stability: https://bugs.php.net/fix.php?id=80651&r=isapi
Install GNU Sed: https://bugs.php.net/fix.php?id=80651&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=80651&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=80651&r=nozend
MySQL Configuration Error: https://bugs.php.net/fix.php?id=80651&r=mysqlcfg
Thread (2 messages)
- super at rongsp dot com