<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="ja">
		<id>https://wiki.nonip.net/index.php?action=history&amp;feed=atom&amp;title=Php%2Freflection</id>
		<title>Php/reflection - 変更履歴</title>
		<link rel="self" type="application/atom+xml" href="https://wiki.nonip.net/index.php?action=history&amp;feed=atom&amp;title=Php%2Freflection"/>
		<link rel="alternate" type="text/html" href="https://wiki.nonip.net/index.php?title=Php/reflection&amp;action=history"/>
		<updated>2026-04-24T18:59:26Z</updated>
		<subtitle>このウィキのこのページに関する変更履歴</subtitle>
		<generator>MediaWiki 1.24.2</generator>

	<entry>
		<id>https://wiki.nonip.net/index.php?title=Php/reflection&amp;diff=4592&amp;oldid=prev</id>
		<title>2017年7月20日 (木) 04:45にAdminによる</title>
		<link rel="alternate" type="text/html" href="https://wiki.nonip.net/index.php?title=Php/reflection&amp;diff=4592&amp;oldid=prev"/>
				<updated>2017-07-20T04:45:01Z</updated>
		
		<summary type="html">&lt;p&gt;&lt;/p&gt;
&lt;table class='diff diff-contentalign-left'&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;col class='diff-marker' /&gt;
				&lt;col class='diff-content' /&gt;
				&lt;tr style='vertical-align: top;'&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;←前の版&lt;/td&gt;
				&lt;td colspan='2' style=&quot;background-color: white; color:black; text-align: center;&quot;&gt;2017年7月20日 (木) 04:45時点における版&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;行59:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;行59:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; $reflMethod = new ReflectionMethod('User', 'getBirthday');&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; $reflMethod = new ReflectionMethod('User', 'getBirthday');&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; $reflMethod-&amp;gt;setAccessible(true);&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; $reflMethod-&amp;gt;setAccessible(true);&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; echo $reflMethod-&amp;gt;invoke($user); // 2000-10-10&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;==privateのpropertyを書き換えた後、methodを実行するサンプル==&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; $reflectionClass = new ReflectionClass('User');&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; $reflectionProperty = $reflectionClass-&amp;gt;getProperty('_name');&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; $reflectionProperty-&amp;gt;setAccessible(true);&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; $reflectionProperty-&amp;gt;setValue($user, 'sato');&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot;&gt;&amp;#160;&lt;/td&gt;&lt;td class='diff-marker'&gt;+&lt;/td&gt;&lt;td style=&quot;color:black; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt; $reflMethod = $reflectionClass-&amp;gt;getMethod('getBirthday');&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; echo $reflMethod-&amp;gt;invoke($user); // 2000-10-10&lt;/div&gt;&lt;/td&gt;&lt;td class='diff-marker'&gt;&amp;#160;&lt;/td&gt;&lt;td style=&quot;background-color: #f9f9f9; color: #333333; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #e6e6e6; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#160; echo $reflMethod-&amp;gt;invoke($user); // 2000-10-10&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>Admin</name></author>	</entry>

	<entry>
		<id>https://wiki.nonip.net/index.php?title=Php/reflection&amp;diff=518&amp;oldid=prev</id>
		<title>127.0.0.1: ページの作成:「==php_refrectionとは== クラスの情報を取得・書き換えできるクラス。php5からコアに追加された   ==クラス情報取得サンプル==    clas...」</title>
		<link rel="alternate" type="text/html" href="https://wiki.nonip.net/index.php?title=Php/reflection&amp;diff=518&amp;oldid=prev"/>
				<updated>2015-05-19T18:13:20Z</updated>
		
		<summary type="html">&lt;p&gt;ページの作成:「==php_refrectionとは== クラスの情報を取得・書き換えできるクラス。php5からコアに追加された   ==クラス情報取得サンプル==    clas...」&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新規ページ&lt;/b&gt;&lt;/p&gt;&lt;div&gt;==php_refrectionとは==&lt;br /&gt;
クラスの情報を取得・書き換えできるクラス。php5からコアに追加された&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==クラス情報取得サンプル==&lt;br /&gt;
 &lt;br /&gt;
 class User&lt;br /&gt;
 {&lt;br /&gt;
     private $_name;&lt;br /&gt;
     private $_birthday;&lt;br /&gt;
     public function __construct($name, $birthday)&lt;br /&gt;
     {&lt;br /&gt;
         $this-&amp;gt;_name = $name;&lt;br /&gt;
         $this-&amp;gt;_birthday = $birthday;&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 $reflClass = new ReflectionClass('User');&lt;br /&gt;
 echo $reflClass-&amp;gt;getName(); // User&lt;br /&gt;
 echo $reflClass-&amp;gt;getNamespaceName(); // &lt;br /&gt;
 echo $reflClass-&amp;gt;getShortName(); // User&lt;br /&gt;
 echo $reflClass-&amp;gt;getFileName(); // /var/www/test/sample.php&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
==privateでもアクセスできるようにmethodを書き換えるサンプル==&lt;br /&gt;
 class User&lt;br /&gt;
 {&lt;br /&gt;
     private $_name;&lt;br /&gt;
     private $_birthday;&lt;br /&gt;
     public function __construct($name, $birthday)&lt;br /&gt;
     {&lt;br /&gt;
         $this-&amp;gt;_name = $name;&lt;br /&gt;
         $this-&amp;gt;_birthday = $birthday;&lt;br /&gt;
     }&lt;br /&gt;
     public function getName()&lt;br /&gt;
     {&lt;br /&gt;
         return $this-&amp;gt;_name;&lt;br /&gt;
     }&lt;br /&gt;
     private function getBirthday()&lt;br /&gt;
     {&lt;br /&gt;
         return $this-&amp;gt;_birthday;&lt;br /&gt;
     }&lt;br /&gt;
 }&lt;br /&gt;
 $user = new User(&amp;quot;taro&amp;quot;, &amp;quot;2000-10-10&amp;quot;);&lt;br /&gt;
 $reflectionClass = new ReflectionClass('User');&lt;br /&gt;
 $reflMethod = $reflectionClass-&amp;gt;getMethod('getBirthday');&lt;br /&gt;
 $reflMethod-&amp;gt;setAccessible(true);&lt;br /&gt;
 echo $reflMethod-&amp;gt;invoke($user); // 2000-10-10&lt;br /&gt;
 &lt;br /&gt;
&lt;br /&gt;
==privateでもアクセスできるようにpropertyを書き換えるサンプル==&lt;br /&gt;
 $reflectionClass = new ReflectionClass('User');&lt;br /&gt;
 $reflectionProperty = $reflectionClass-&amp;gt;getProperty('_name');&lt;br /&gt;
 $reflectionProperty-&amp;gt;setAccessible(true);&lt;br /&gt;
 $reflectionProperty-&amp;gt;setValue($user, 'sato');&lt;br /&gt;
 echo $reflectionProperty-&amp;gt;getValue($user); // sato&lt;br /&gt;
&lt;br /&gt;
==ReflectionMethodを使ってprivateのmethodをそのままロードする方法==&lt;br /&gt;
 $reflMethod = new ReflectionMethod('User', 'getBirthday');&lt;br /&gt;
 $reflMethod-&amp;gt;setAccessible(true);&lt;br /&gt;
 echo $reflMethod-&amp;gt;invoke($user); // 2000-10-10&lt;/div&gt;</summary>
		<author><name>127.0.0.1</name></author>	</entry>

	</feed>