svn: /phpdoc/kr/trunk/language/oop5/ paamayim-nekudotayim.xml

[email protected] (Yu Ilho)
Newsgroups php.doc.kr
Message-ID <[email protected]>
acidd15                                  Sun, 11 Jan 2015 10:53:07 +0000

Revision: http://svn.php.net/viewvc?view=revision&revision=335717

Log:
initial translate.

Changed paths:
    A   phpdoc/kr/trunk/language/oop5/paamayim-nekudotayim.xml

Added: phpdoc/kr/trunk/language/oop5/paamayim-nekudotayim.xml
===================================================================
--- phpdoc/kr/trunk/language/oop5/paamayim-nekudotayim.xml	                        (rev 0)
+++ phpdoc/kr/trunk/language/oop5/paamayim-nekudotayim.xml	2015-01-11 10:53:07 UTC (rev 335717)
@@ -0,0 +1,140 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!-- $Revision$ -->
+<!-- EN-Revision: 321337 Maintainer: acidd15 Status: ready -->
+<!-- Reviewed: no -->
+
+<sect1 xml:id="language.oop5.paamayim-nekudotayim" xmlns="http://docbook.org/ns/docbook">
+ <title>스코프 해결 연산자 (::)</title>
+
+ <para>
+  스코프 해결연산자(또는 Paamayim Nekudotayim 으로 불리는) 또는 간단한 용어로, 더블콜론은 <link linkend="language.oop5.static">static</link>이나
+  <link linkend="language.oop5.constants">constant</link>와, 클래스의 재정의된 프로퍼티나 메서드에 접근할수 있도록 해주는 토큰입니다.
+ </para>
+
+ <para>
+  클래스 정의의 외부에서 이항목들을 참조할때, 클래스의 이름을 사용합니다.
+ </para>
+
+ <para>
+  PHP 5.3.0 이후로는, 값을 이용해서 클래스를 참조하는게 가능합니다.
+  변수의 값은 키워드여서는 안됩니다.(예를들면 <literal>self</literal>,
+  <literal>parent</literal> 과 <literal>static</literal>)
+ </para>
+
+ <para>
+  더블콜론이 Paamayim Nekudotayim 가 된것이 이상해 보일수 있습니다.
+  그렇지만, Zend Engine 0.5(PHP 3 엔진)를 작성하고 있는동안, Zend 팀은 그렇게 부르기로 했습니다.
+  이것은 더블콜론을 의미하는 히브리어 입니다!
+ </para>
+
+ <example>
+  <title>클래스 정의 외부에서 ::</title>
+  <programlisting role="php">
+<![CDATA[
+<?php
+class MyClass {
+    const CONST_VALUE = 'A constant value';
+}
+
+$classname = 'MyClass';
+echo $classname::CONST_VALUE; // As of PHP 5.3.0
+
+echo MyClass::CONST_VALUE;
+?>
+]]>
+  </programlisting>
+ </example>
+
+ <para>
+  다음 특별한 세가지 키워드 <varname>self</varname>, <varname>parent</varname> 과
+  <varname>static</varname> 는 클래스 정의 내부에서 프로퍼티와 메서드에 접근하기 위해 사용됩니다.
+ </para>
+
+ <example>
+  <title>클래스 정의 내부에서 ::</title>
+  <programlisting role="php">
+<![CDATA[
+<?php
+class OtherClass extends MyClass
+{
+    public static $my_static = 'static var';
+
+    public static function doubleColon() {
+        echo parent::CONST_VALUE . "\n";
+        echo self::$my_static . "\n";
+    }
+}
+
+$classname = 'OtherClass';
+echo $classname::doubleColon(); // As of PHP 5.3.0
+
+OtherClass::doubleColon();
+?>
+]]>
+  </programlisting>
+ </example>
+
+ <para>
+  부모 메서드의 정의를 재정의하여 확장할때, PHP 는 부모의 메서드를 호출하지 않습니다.
+  부모 메서드를 호출할지 안할지는 확장된 클래스에게 달려 있습니다. 이것은
+  <link
+  linkend="language.oop5.decon">생성자와 소멸자</link>, <link
+  linkend="language.oop5.overloading">오버로딩</link>, <link
+  linkend="language.oop5.magic">매직</link> 메서드 정의에도 적용됩니다.
+ </para>
+
+ <example>
+  <title>부모 메서드 호출하기</title>
+  <programlisting role="php">
+<![CDATA[
+<?php
+class MyClass
+{
+    protected function myFunc() {
+        echo "MyClass::myFunc()\n";
+    }
+}
+
+class OtherClass extends MyClass
+{
+    // Override parent's definition
+    public function myFunc()
+    {
+        // But still call the parent function
+        parent::myFunc();
+        echo "OtherClass::myFunc()\n";
+    }
+}
+
+$class = new OtherClass();
+$class->myFunc();
+?>
+]]>
+  </programlisting>
+ </example>
+ <para>
+  참고하세요. <link linkend="language.oop5.basic.class.this">정적 호출 트릭에 대한 예제</link>.
+ </para>
+
+</sect1>
+
+<!-- Keep this comment at the end of the file
+Local variables:
+mode: sgml
+sgml-omittag:t
+sgml-shorttag:t
+sgml-minimize-attributes:nil
+sgml-always-quote-attributes:t
+sgml-indent-step:1
+sgml-indent-data:t
+indent-tabs-mode:nil
+sgml-parent-document:nil
+sgml-default-dtd-file:"~/.phpdoc/manual.ced"
+sgml-exposed-tags:nil
+sgml-local-catalogs:nil
+sgml-local-ecat-files:nil
+End:
+vim600: syn=xml fen fdm=syntax fdl=2 si
+vim: et tw=78 syn=sgml
+vi: ts=1 sw=1
+-->


Property changes on: phpdoc/kr/trunk/language/oop5/paamayim-nekudotayim.xml
___________________________________________________________________
Added: svn:eol-style
   + native
Added: svn:keywords
   + Id Rev Revision Date LastChangedDate LastChangedRevision Author LastChangedBy HeadURL URL
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.