<?xml version="1.0" encoding="UTF-8" ?><oembed><version>1.0</version><provider_name>Jui-Nan Lin&#039;s Blog</provider_name><provider_url>https://jnlin.org</provider_url><author_name>jnlin</author_name><author_url>https://jnlin.org/author/jnlin/</author_url><title>PHP 5.4 的新功能...</title><html>&lt;a href=&quot;http://www.php.net/&quot;&gt;PHP&lt;/a&gt; 5.4 在 3/1 已經發布了，其中我覺得比較重要的幾個新功能：
&lt;ul&gt;
	&lt;li&gt;&lt;a href=&quot;http://tw2.php.net/manual/en/language.oop5.traits.php&quot;&gt;Traits&lt;/a&gt; - 看範例應該就會懂用法了，code reuse用的。&lt;/li&gt;
	&lt;li&gt;內建Web Server，開發測試的時候不需要設定 apache 或 nginx 了。&lt;/li&gt;
	&lt;li&gt;Closure 裡面支援 $this。&lt;/li&gt;
	&lt;li&gt;&lt;code&gt;$a = [1,2,4,5];&lt;/code&gt; 這樣的 Array Notation。&lt;/li&gt;
	&lt;li&gt;&lt;code&gt;func()[0]&lt;/code&gt; 和 &lt;code&gt;(new Foo)-&gt;bar()&lt;/code&gt; 這樣的寫法。&lt;/li&gt;
	&lt;li&gt;json_encode() 的第二個參數可以給 JSON_PRETTY_PRINT（印出人類方便閱讀的 JSON 格式）與 JSON_UNESCAPED_UNICODE（不要 escape unicode 字元）&lt;/li&gt;
&lt;/ul&gt;

然後 5.4 &lt;a href=&quot;http://news.php.net/php.bugs/167978&quot;&gt;剛出的新功能就有 bug 了&lt;/a&gt;...XD


</html><type>rich</type></oembed>