Doc #80651 [NEW]: document : Example #1 chinese language

From: Date: Thu, 21 Jan 2021 03:30:03 +0000
Subject: Doc #80651 [NEW]: document : Example #1 chinese language
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-18430@lists.php.net to get a copy of this message
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)

« previous php.doc.bugs (#18430) next »