cvs: phpdoc-de /language/oop5 reflection.xml /reference/mail constants.xml

From: Date: Wed, 24 Sep 2008 21:03:59 +0000
Subject: cvs: phpdoc-de /language/oop5 reflection.xml /reference/mail constants.xml
Groups: php.doc.de 
Request: Send a blank email to doc-de+get-2811@lists.php.net to get a copy of this message
hholzgra Wed Sep 24 21:03:59 2008 UTC Added files: /phpdoc-de/reference/mail constants.xml Modified files: /phpdoc-de/language/oop5 reflection.xml Log: translation updates http://cvs.php.net/viewvc.cgi/phpdoc-de/language/oop5/reflection.xml?r1=1.12&r2=1.13&diff_format=u Index: phpdoc-de/language/oop5/reflection.xml diff -u phpdoc-de/language/oop5/reflection.xml:1.12 phpdoc-de/language/oop5/reflection.xml:1.13 --- phpdoc-de/language/oop5/reflection.xml:1.12 Sat Aug 9 12:40:38 2008 +++ phpdoc-de/language/oop5/reflection.xml Wed Sep 24 21:03:58 2008 @@ -1,6 +1,6 @@ <?xml version="1.0" encoding="utf-8"?> -<!-- $Revision: 1.12 $ --> -<!-- EN-Revision: 1.36 Maintainer: hholzgra Status: ready --> +<!-- $Revision: 1.13 $ --> +<!-- EN-Revision: 1.38 Maintainer: hholzgra Status: ready --> <!-- Credits: simp --> <sect1 xml:id="language.oop5.reflection" xmlns="http://docbook.org/ns/docbook"> <title>Reflection</title> @@ -180,6 +180,7 @@ public string getName() public bool isInternal() public bool isDisabled() + public mixed getClosure() /* Ab PHP 5.3.0 */ public bool isUserDefined() public string getFileName() public int getStartLine() @@ -403,6 +404,7 @@ public bool isAbstract() public bool isFinal() public int getModifiers() + public mixed getClosure() /* Ab PHP 5.3.0 */ public bool isInstance(stdclass object) public stdclass newInstance(mixed args) public stdclass newInstanceArgs(array args) @@ -673,6 +675,27 @@ ]]> </programlisting> </example> + <example> + <title>Closure mit Hilfe der <classname>ReflectionMethod</classname> Klasse abfragen</title> + <programlisting role='php'> +<![CDATA[ +<?php + +class Example { + static function printer () { + echo "Hello World!\n"; + } +} + +$class = new ReflectionClass('Example'); +$method = $class->getMethod('printer'); +$closure = $method->getClosure(); /* Ab PHP 5.3.0 */ +$closure(); // Hello World! + +?> +]]> + </programlisting> + </example> <note> <simpara> Der Versuch, eine private, protected oder abstract Methode aufzurufen, @@ -778,6 +801,32 @@ ]]> </programlisting> </example> + <example> + <title>Getting value from private and protected properties using <classname>ReflectionProperty</classname> class</title> + <programlisting role='php'> +<![CDATA[ +<?php + +class Foo { +public $x = 1; +protected $y = 2; +private $z = 3; +} + +$obj = new Foo; + +$prop = new ReflectionProperty('Foo', 'y'); +$prop->setAccessible(true); /* As of PHP 5.3.0 */ +var_dump($prop->getValue($obj)); // int(2) + +$prop = new ReflectionProperty('Foo', 'z'); +$prop->setAccessible(true); /* As of PHP 5.3.0 */ +var_dump($prop->getValue($obj)); // int(2) + +?> +]]> + </programlisting> + </example> <note> <simpara> Der Versuch, den Wert einer private oder protected Klasseneigenschaft http://cvs.php.net/viewvc.cgi/phpdoc-de/reference/mail/constants.xml?view=markup&rev=1.1 Index: phpdoc-de/reference/mail/constants.xml +++ phpdoc-de/reference/mail/constants.xml <?xml version="1.0" encoding="utf-8"?> <!-- $Revision: 1.1 $ --> <!-- EN-Revision: 1.2 Maintainer: hholzgra Status: ready --> <appendix xml:id="mail.constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink"> &reftitle.constants; &no.constants; </appendix> <!-- 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:"../../../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 -->

« previous php.doc.de (#2811) next »