<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" 
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:atom="http://www.w3.org/2005/Atom">
<channel>
<title>foreach 時使用 reference 的陷阱</title>
<link>http://blog.roodo.com/rocksaying/archives/3669955.html/</link>
<description><![CDATA[Tags: php foreach reference

前幾天在重構一段 PHP 程式碼時，不小心踩到 foreach 使用「參照(reference)」的陷阱。上網查了一下，似乎踩到的人還不少。我想了一下，把原因換成另一段程式碼形式說明，再說明解法。基本上，這是個 trick ，而不是 bug 。

]]>
	</description>
<language>zh-tw</language>
<generator>Roodo Blog System</generator>
<copyright>All Rights Reserved</copyright>
<atom:link href="http://blog.roodo.com/rocksaying/archives/3669955-comment.xml" rel="self" type="application/rss+xml" />
<item>
	<title>回應：foreach 時使用 reference 的陷阱</title>
	<description><![CDATA[這種寫法叫做畫蛇添足, 曲解基本觀念所致.]]>
	</description>
	<link>http://blog.roodo.com/rocksaying/archives/3669955.html</link>
	<guid>http://blog.roodo.com/rocksaying/archives/3669955.html#comment-15226463</guid>
		<category>文章回應</category>
	<pubDate>Tue, 11 Dec 2007 12:01:34 +0800</pubDate>
</item>
</channel>
</rss>