<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>猫言猫语 &#187; PHP</title>
	<atom:link href="http://www.wuwx.net/tags/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.wuwx.net</link>
	<description>严以律己·宽以待人·自强不息·知行合一</description>
	<lastBuildDate>Mon, 19 Dec 2011 00:27:27 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3</generator>
	<atom:link rel='hub' href='http://www.wuwx.net/?pushpress=hub'/>
<cloud domain='www.wuwx.net' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
		<item>
		<title>Zend Server 5.5安装流程</title>
		<link>http://www.wuwx.net/archives/6048</link>
		<comments>http://www.wuwx.net/archives/6048#comments</comments>
		<pubDate>Fri, 04 Nov 2011 08:20:47 +0000</pubDate>
		<dc:creator>有颜色的猫</dc:creator>
				<category><![CDATA[编程开发]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://www.wuwx.net/archives/6048</guid>
		<description><![CDATA[之后会给你安装好Apache，MySQL，PHP。不过安装后一直无法访问，Apache提示500错误，这是个囧事……]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.wuwx.net/wp-content/uploads/2011/11/image8.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wuwx.net/wp-content/uploads/2011/11/image_thumb8.png" width="706" height="534" /></a></p>
<p><span id="more-6048"></span><a href="http://www.wuwx.net/wp-content/uploads/2011/11/image9.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wuwx.net/wp-content/uploads/2011/11/image_thumb9.png" width="706" height="534" /></a>
<p><a href="http://www.wuwx.net/wp-content/uploads/2011/11/image10.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wuwx.net/wp-content/uploads/2011/11/image_thumb10.png" width="706" height="534" /></a></p>
<p><a href="http://www.wuwx.net/wp-content/uploads/2011/11/image11.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wuwx.net/wp-content/uploads/2011/11/image_thumb11.png" width="706" height="534" /></a></p>
<p><a href="http://www.wuwx.net/wp-content/uploads/2011/11/image12.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wuwx.net/wp-content/uploads/2011/11/image_thumb12.png" width="706" height="534" /></a></p>
<p><a href="http://www.wuwx.net/wp-content/uploads/2011/11/image13.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wuwx.net/wp-content/uploads/2011/11/image_thumb13.png" width="706" height="534" /></a></p>
<p><a href="http://www.wuwx.net/wp-content/uploads/2011/11/image14.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wuwx.net/wp-content/uploads/2011/11/image_thumb14.png" width="706" height="534" /></a></p>
<p>之后会给你安装好Apache，MySQL，PHP。不过安装后一直无法访问，Apache提示500错误，这是个囧事……</p>
 <img src="http://www.wuwx.net/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=6048" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.wuwx.net/archives/6048/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Studio 8安装流程</title>
		<link>http://www.wuwx.net/archives/6033</link>
		<comments>http://www.wuwx.net/archives/6033#comments</comments>
		<pubDate>Thu, 03 Nov 2011 00:02:27 +0000</pubDate>
		<dc:creator>有颜色的猫</dc:creator>
				<category><![CDATA[编程开发]]></category>
		<category><![CDATA[Editor]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Studio]]></category>
		<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://www.wuwx.net/archives/6033</guid>
		<description><![CDATA[]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.wuwx.net/wp-content/uploads/2011/11/image.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wuwx.net/wp-content/uploads/2011/11/image_thumb.png" width="509" height="398" /></a></p>
<p><span id="more-6033"></span><a href="http://www.wuwx.net/wp-content/uploads/2011/11/image1.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wuwx.net/wp-content/uploads/2011/11/image_thumb1.png" width="509" height="398" /></a>
<p><a href="http://www.wuwx.net/wp-content/uploads/2011/11/image2.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wuwx.net/wp-content/uploads/2011/11/image_thumb2.png" width="509" height="398" /></a></p>
<p><a href="http://www.wuwx.net/wp-content/uploads/2011/11/image3.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wuwx.net/wp-content/uploads/2011/11/image_thumb3.png" width="509" height="398" /></a></p>
<p><a href="http://www.wuwx.net/wp-content/uploads/2011/11/image4.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wuwx.net/wp-content/uploads/2011/11/image_thumb4.png" width="509" height="398" /></a></p>
<p><a href="http://www.wuwx.net/wp-content/uploads/2011/11/image5.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wuwx.net/wp-content/uploads/2011/11/image_thumb5.png" width="509" height="398" /></a></p>
<p><a href="http://www.wuwx.net/wp-content/uploads/2011/11/image6.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wuwx.net/wp-content/uploads/2011/11/image_thumb6.png" width="500" height="500" /></a></p>
<p><a href="http://www.wuwx.net/wp-content/uploads/2011/11/image7.png"><img style="background-image: none; border-bottom: 0px; border-left: 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px" title="image" border="0" alt="image" src="http://www.wuwx.net/wp-content/uploads/2011/11/image_thumb7.png" width="462" height="312" /></a></p>
 <img src="http://www.wuwx.net/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=6033" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.wuwx.net/archives/6033/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CentOS5下PHP连接Sybase的方法</title>
		<link>http://www.wuwx.net/archives/5967</link>
		<comments>http://www.wuwx.net/archives/5967#comments</comments>
		<pubDate>Mon, 30 May 2011 02:29:10 +0000</pubDate>
		<dc:creator>有颜色的猫</dc:creator>
				<category><![CDATA[开源技术]]></category>
		<category><![CDATA[centos]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Sybase]]></category>

		<guid isPermaLink="false">http://www.wuwx.net/archives/5967</guid>
		<description><![CDATA[第一步：先安装freetds及相关库 yum install freetds freetds-devel 第二步：下载php源码及编译sybase扩展 wget http://cn.php.net/get/php-5.3.6.tar.bz2/from/this/mirrortar jxvf php-5.3.6.tar.bz2 cd php-5.3.6/ext/sybase_ct/phpize./configure --with-sybase-ct=/usrmakemake install 第三步：载入PHP的sybase扩展 cd /etc/php.dvim sybase_ct.ini extension=sybase_ct.so 第四步：重新启动Apache完成 service httpd restart]]></description>
			<content:encoded><![CDATA[<h4>第一步：先安装freetds及相关库</h4>
<p>yum install freetds freetds-devel</p>
<h4>第二步：下载php源码及编译sybase扩展</h4>
<p>wget http://cn.php.net/get/php-5.3.6.tar.bz2/from/this/mirror<br />tar jxvf php-5.3.6.tar.bz2 <br />cd php-5.3.6/ext/sybase_ct/<br />phpize<br />./configure --with-sybase-ct=/usr<br />make<br />make install</p>
<h4>第三步：载入PHP的sybase扩展</h4>
<p>cd /etc/php.d<br />vim sybase_ct.ini <br />extension=sybase_ct.so</p>
<h4>第四步：重新启动Apache完成</h4>
<p>service httpd restart</p>
 <img src="http://www.wuwx.net/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=5967" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.wuwx.net/archives/5967/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>配置Nginx使其支持Symfony</title>
		<link>http://www.wuwx.net/archives/5886</link>
		<comments>http://www.wuwx.net/archives/5886#comments</comments>
		<pubDate>Sun, 31 Jan 2010 04:07:22 +0000</pubDate>
		<dc:creator>有颜色的猫</dc:creator>
				<category><![CDATA[开源技术]]></category>
		<category><![CDATA[fastcgi]]></category>
		<category><![CDATA[nginx]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://www.wuwx.net/archives/5886</guid>
		<description><![CDATA[location ~ \.php($&#124;/) {&#160;&#160;&#160; set&#160; $script&#160;&#160;&#160;&#160; $uri;&#160;&#160;&#160; set&#160; $path_info&#160; "";&#160;&#160;&#160; if ($uri ~ "^(.+\.php)(/.*)") {&#160;&#160;&#160;&#160;&#160;&#160;&#160; set&#160; $script&#160;&#160;&#160;&#160; $1;&#160;&#160;&#160;&#160;&#160;&#160;&#160; set&#160; $path_info&#160; $2;&#160;&#160;&#160; }&#160;&#160;&#160; fastcgi_pass&#160;&#160; 127.0.0.1:9000;&#160;&#160;&#160; include&#160;&#160;&#160;&#160;&#160;&#160;&#160; fastcgi_params;&#160;&#160;&#160; fastcgi_param&#160; PATH_INFO&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160;&#160; $path_info;&#160;&#160;&#160; fastcgi_param&#160; SCRIPT_FILENAME&#160;&#160;&#160; /var/www/example-org/wwwroot/web$script;&#160;&#160;&#160; fastcgi_param&#160; SCRIPT_NAME&#160;&#160;&#160;&#160;&#160;&#160;&#160; $script;}]]></description>
			<content:encoded><![CDATA[<blockquote><p>location ~ \.php($|/) {<br />&nbsp;&nbsp;&nbsp; set&nbsp; $script&nbsp;&nbsp;&nbsp;&nbsp; $uri;<br />&nbsp;&nbsp;&nbsp; set&nbsp; $path_info&nbsp; "";<br />&nbsp;&nbsp;&nbsp; if ($uri ~ "^(.+\.php)(/.*)") {<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set&nbsp; $script&nbsp;&nbsp;&nbsp;&nbsp; $1;<br />&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; set&nbsp; $path_info&nbsp; $2;<br />&nbsp;&nbsp;&nbsp; }<br />&nbsp;&nbsp;&nbsp; fastcgi_pass&nbsp;&nbsp; 127.0.0.1:9000;<br />&nbsp;&nbsp;&nbsp; include&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; fastcgi_params;<br />&nbsp;&nbsp;&nbsp; fastcgi_param&nbsp; PATH_INFO&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $path_info;<br />&nbsp;&nbsp;&nbsp; fastcgi_param&nbsp; SCRIPT_FILENAME&nbsp;&nbsp;&nbsp; /var/www/example-org/wwwroot/web$script;<br />&nbsp;&nbsp;&nbsp; fastcgi_param&nbsp; SCRIPT_NAME&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; $script;<br />}</p>
</blockquote>
 <img src="http://www.wuwx.net/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=5886" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.wuwx.net/archives/5886/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>普通PHP处理流程与CakePHP处理流程</title>
		<link>http://www.wuwx.net/archives/5883</link>
		<comments>http://www.wuwx.net/archives/5883#comments</comments>
		<pubDate>Sat, 16 Jan 2010 05:41:58 +0000</pubDate>
		<dc:creator>有颜色的猫</dc:creator>
				<category><![CDATA[开源技术]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[mvc]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[流程]]></category>

		<guid isPermaLink="false">http://www.wuwx.net/archives/5883</guid>
		<description><![CDATA[&#160; &#160;]]></description>
			<content:encoded><![CDATA[<p>&nbsp;<img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.wuwx.net/wp-content/uploads/2010/01/image10.png" width="555" height="274"> </p>
<p>&nbsp;<img style="border-right-width: 0px; display: inline; border-top-width: 0px; border-bottom-width: 0px; border-left-width: 0px" title="image" border="0" alt="image" src="http://www.wuwx.net/wp-content/uploads/2010/01/image11.png" width="520" height="396"></p>
 <img src="http://www.wuwx.net/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=5883" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.wuwx.net/archives/5883/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>老版本PHP的下载地址</title>
		<link>http://www.wuwx.net/archives/5825</link>
		<comments>http://www.wuwx.net/archives/5825#comments</comments>
		<pubDate>Tue, 13 Oct 2009 01:46:44 +0000</pubDate>
		<dc:creator>有颜色的猫</dc:creator>
				<category><![CDATA[编程开发]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[下载]]></category>

		<guid isPermaLink="false">http://www.wuwx.net/archives/5825</guid>
		<description><![CDATA[　　由于PHP4版本已老，PHP官方已不再对其维护支持，官方站上的PHP版本目前只有5.2、5.3、6.0的PHP下载，而一些老项目还是使用PHP4编写的，而存在一些版本兼容问题导致还无法迁移到PHP5，这样在重新部署环境的时候就需要下载PHP4了。 　　由于官方不直接提供PHP4的下载，我们就需要自己找，Google之后，发现一站点：http://museum.php.net/，上面的PHP版本还挺全的，甚至连PHP1都有，是不是很雷人呢……，有需要老版本PHP的赶紧收藏下来，否则以后又找不到了。]]></description>
			<content:encoded><![CDATA[<p>　　由于PHP4版本已老，PHP官方已不再对其维护支持，官方站上的PHP版本目前只有5.2、5.3、6.0的PHP下载，而一些老项目还是使用PHP4编写的，而存在一些版本兼容问题导致还无法迁移到PHP5，这样在重新部署环境的时候就需要下载PHP4了。</p>
<p>　　由于官方不直接提供PHP4的下载，我们就需要自己找，Google之后，发现一站点：<a title="http://museum.php.net/" href="http://museum.php.net/">http://museum.php.net/</a>，上面的PHP版本还挺全的，甚至连PHP1都有，是不是很雷人呢……，有需要老版本PHP的赶紧收藏下来，否则以后又找不到了。</p>
 <img src="http://www.wuwx.net/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=5825" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.wuwx.net/archives/5825/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP魔术函数的性能测试</title>
		<link>http://www.wuwx.net/archives/5816</link>
		<comments>http://www.wuwx.net/archives/5816#comments</comments>
		<pubDate>Thu, 24 Sep 2009 00:04:42 +0000</pubDate>
		<dc:creator>有颜色的猫</dc:creator>
				<category><![CDATA[编程开发]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[函数]]></category>
		<category><![CDATA[性能]]></category>
		<category><![CDATA[测试]]></category>
		<category><![CDATA[魔术方法]]></category>

		<guid isPermaLink="false">http://www.wuwx.net/archives/5816</guid>
		<description><![CDATA[测试方法，新建一个名为User的PHP类，循环1000000次读取相关属性测试。 第一个测试，设置$username为私有方法，在循环内部生成类对象，使用__get获得其值 &#60;?php class User &#123; private $username; public function __get&#40;$name&#41; &#123; return $this-&#62;$name; &#125; &#125; for &#40;$i = 0; $i &#60; 1000000; $i++&#41; &#123; $user = new User; $user-&#62;username; &#125; ?&#62; real 0m4.487s user 0m4.192s sys 0m0.291s 第二个测试，设置$username为公有方法，在循环内部生成类对象，直接获得其值 &#60;?php class User &#123; public $username; public function __get&#40;$name&#41; &#123; return $this-&#62;$name; &#125; &#125; for &#40;$i [...]]]></description>
			<content:encoded><![CDATA[<p>测试方法，新建一个名为User的PHP类，循环1000000次读取相关属性测试。  第一个测试，设置$username为私有方法，在循环内部生成类对象，使用__get获得其值</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">class</span> User <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$username</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __get<span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #000088;">$name</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">1000000</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> User<span style="color: #339933;">;</span>
    <span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">username</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">real    0m4.487s
user    0m4.192s
sys     0m0.291s</pre></div></div>

<p>第二个测试，设置$username为公有方法，在循环内部生成类对象，直接获得其值</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">class</span> User <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$username</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __get<span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #000088;">$name</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">1000000</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> User<span style="color: #339933;">;</span>
    <span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">username</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> 
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">real    0m1.403s
user    0m1.395s
sys     0m0.008s</pre></div></div>

<p>第三个测试，设置$username为私有方法，在循环外部生成类对象，使用__get获得其值</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">class</span> User <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">private</span> <span style="color: #000088;">$username</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __get<span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #000088;">$name</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> User<span style="color: #339933;">;</span>
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">1000000</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">username</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> 
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">real    0m2.677s
user    0m2.453s
sys     0m0.224s</pre></div></div>

<p>第四个测试，设置$username为公有方法，在循环外部生成类对象，直接获得其值</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">class</span> User <span style="color: #009900;">&#123;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000088;">$username</span><span style="color: #339933;">;</span>
    <span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> __get<span style="color: #009900;">&#40;</span><span style="color: #000088;">$name</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
        <span style="color: #b1b100;">return</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #000088;">$name</span><span style="color: #339933;">;</span>
    <span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span> 
<span style="color: #000088;">$user</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> User<span style="color: #339933;">;</span>
<span style="color: #b1b100;">for</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$i</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">1000000</span><span style="color: #339933;">;</span> <span style="color: #000088;">$i</span><span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
    <span style="color: #000088;">$user</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">username</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span> 
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>


<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">real    0m0.543s
user    0m0.537s
sys     0m0.007s</pre></div></div>

<p><img src="http://www.wuwx.net/wp-content/uploads/2009/09/Book1_11472_image001.gif" alt="Book1_11472_image001" title="Book1_11472_image001" width="487" height="280" class="alignnone size-full wp-image-5817" /></p>
<p>可见新建类操作与使用魔术方法都比较消耗资源，使用的时候一定要小心谨慎哦……</p>
 <img src="http://www.wuwx.net/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=5816" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.wuwx.net/archives/5816/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Zend Framework Controller流程图</title>
		<link>http://www.wuwx.net/archives/5768</link>
		<comments>http://www.wuwx.net/archives/5768#comments</comments>
		<pubDate>Wed, 20 May 2009 01:32:29 +0000</pubDate>
		<dc:creator>有颜色的猫</dc:creator>
				<category><![CDATA[编程开发]]></category>
		<category><![CDATA[Controller]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://www.wuwx.net/archives/5768</guid>
		<description><![CDATA[　　从图中可以看出，在Zend Framework Controller分发流程中，Request Object几乎贯穿了整个框架的处理流程，假如程序的本质是I/O，Web的本质就是Request/Response。 　　整个处理流程中，组件只与Request Object发生耦合，Router通过读取Request Object中的值，再适当地更改其部分值，为Dispatcher指明方向，生成适当的具体控制器类，达到路由的效果。 　　在各个处理流程中各个组件可以被替换，藕荷度小，符合设计模式，看上去很美。 &#160;]]></description>
			<content:encoded><![CDATA[<p>　　从图中可以看出，在Zend Framework Controller分发流程中，Request Object几乎贯穿了整个框架的处理流程，假如程序的本质是I/O，Web的本质就是Request/Response。</p>
<p>　　整个处理流程中，组件只与Request Object发生耦合，Router通过读取Request Object中的值，再适当地更改其部分值，为Dispatcher指明方向，生成适当的具体控制器类，达到路由的效果。</p>
<p>　　在各个处理流程中各个组件可以被替换，藕荷度小，符合设计模式，看上去很美。</p>
<p>&nbsp;</p>
<p><img title="zend.controller.basics" style="border-right: 0px; border-top: 0px; display: inline; border-left: 0px; border-bottom: 0px" height="563" alt="zend.controller.basics" src="http://www.wuwx.net/wp-content/uploads/2009/05/zendcontrollerbasics.png" width="483" border="0"></p>
 <img src="http://www.wuwx.net/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=5768" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.wuwx.net/archives/5768/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CakePHP、symfony、Zend Framework搜索量指数对比</title>
		<link>http://www.wuwx.net/archives/5764</link>
		<comments>http://www.wuwx.net/archives/5764#comments</comments>
		<pubDate>Tue, 14 Apr 2009 06:37:42 +0000</pubDate>
		<dc:creator>有颜色的猫</dc:creator>
				<category><![CDATA[开源技术]]></category>
		<category><![CDATA[CakePHP]]></category>
		<category><![CDATA[Framework]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://www.wuwx.net/archives/5764</guid>
		<description><![CDATA[　　蓝色的是CakePHP、红色是symfony、橙色是Zend Framework，在关注度上基本都是齐头并进。Zend Framework毕竟是PHP官方出的框架，因此新闻引用量明显要大于其他两个。]]></description>
			<content:encoded><![CDATA[<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="viz" border="0" alt="viz" src="http://www.wuwx.net/wp-content/uploads/2009/04/viz.png" width="580" height="260"> </p>
<p>　　蓝色的是CakePHP、红色是symfony、橙色是Zend Framework，在关注度上基本都是齐头并进。Zend Framework毕竟是PHP官方出的框架，因此新闻引用量明显要大于其他两个。</p>
 <img src="http://www.wuwx.net/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=5764" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.wuwx.net/archives/5764/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>PHP命名空间的那个反斜杆实在太丑了</title>
		<link>http://www.wuwx.net/archives/5760</link>
		<comments>http://www.wuwx.net/archives/5760#comments</comments>
		<pubDate>Tue, 07 Apr 2009 16:03:47 +0000</pubDate>
		<dc:creator>有颜色的猫</dc:creator>
				<category><![CDATA[开源技术]]></category>
		<category><![CDATA[namespaces]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.wuwx.net/archives/5760</guid>
		<description><![CDATA[　　看看下面这段示例代码，其中带各种“\”反斜杆部分的内容，就是PHP 5.3中即将出现的命名空间。各位看这段代码写的恶心不……，幸好不是我写的，这可是官方的示例代码。假如IDE不支持的话，写这段代码、维护这段代码都是个噩梦…… 　　在其他语言飞速进步，新型框架层出不穷之际，PHP却改的越来越没有自己的特点了，非但没有发挥自己动态的长处，却不断地向Java语法靠近，假如真的都需要Java，我们还用PHP干什么呢。 http://php.net/manual/en/language.namespaces.rationale.php]]></description>
			<content:encoded><![CDATA[<p>　　看看下面这段示例代码，其中带各种“\”反斜杆部分的内容，就是PHP 5.3中即将出现的命名空间。各位看这段代码写的恶心不……，幸好不是我写的，这可是官方的示例代码。假如IDE不支持的话，写这段代码、维护这段代码都是个噩梦……</p>
<p>　　在其他语言飞速进步，新型框架层出不穷之际，PHP却改的越来越没有自己的特点了，非但没有发挥自己动态的长处，却不断地向Java语法靠近，假如真的都需要Java，我们还用PHP干什么呢。</p>
<p><a title="http://php.net/manual/en/language.namespaces.rationale.php" href="http://php.net/manual/en/language.namespaces.rationale.php">http://php.net/manual/en/language.namespaces.rationale.php</a></p>
<p><img style="border-bottom: 0px; border-left: 0px; display: inline; border-top: 0px; border-right: 0px" title="image" border="0" alt="image" src="http://www.wuwx.net/wp-content/uploads/2009/04/image.png" width="617" height="334"></p>
 <img src="http://www.wuwx.net/wp-content/plugins/wordpress-feed-statistics/feed-statistics.php?view=1&post_id=5760" width="1" height="1" style="display: none;" />]]></content:encoded>
			<wfw:commentRss>http://www.wuwx.net/archives/5760/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

