<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Read-only object variables in php using magic methods</title>
	<atom:link href="http://cormacscode.wordpress.com/2009/01/22/read-only-object-variables-in-php-using-magic-methods/feed/" rel="self" type="application/rss+xml" />
	<link>http://cormacscode.wordpress.com/2009/01/22/read-only-object-variables-in-php-using-magic-methods/</link>
	<description>Web / internet development, mostly using php / mysql</description>
	<lastBuildDate>Wed, 28 Oct 2009 04:37:28 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: cormacscode</title>
		<link>http://cormacscode.wordpress.com/2009/01/22/read-only-object-variables-in-php-using-magic-methods/#comment-314</link>
		<dc:creator>cormacscode</dc:creator>
		<pubDate>Fri, 03 Apr 2009 10:12:20 +0000</pubDate>
		<guid isPermaLink="false">http://cormacscode.wordpress.com/?p=78#comment-314</guid>
		<description>AFAIK you &lt;strong&gt;can&#039;t&lt;/strong&gt; have read-only object variables without __get() and __set() methods. If you can access a variable you can read it &lt;strong&gt;and&lt;/strong&gt; modify it. Am I wrong? Do you know something I don&#039;t?
How the code above works is access to the variable is set to private, so it can&#039;t be accessed at all from outside the object, and then I use the __get() method to allow it to be read. The empty __set() method is just there to stop an exception being thrown if you try to modify the variable</description>
		<content:encoded><![CDATA[<p>AFAIK you <strong>can&#8217;t</strong> have read-only object variables without __get() and __set() methods. If you can access a variable you can read it <strong>and</strong> modify it. Am I wrong? Do you know something I don&#8217;t?<br />
How the code above works is access to the variable is set to private, so it can&#8217;t be accessed at all from outside the object, and then I use the __get() method to allow it to be read. The empty __set() method is just there to stop an exception being thrown if you try to modify the variable</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Roy</title>
		<link>http://cormacscode.wordpress.com/2009/01/22/read-only-object-variables-in-php-using-magic-methods/#comment-313</link>
		<dc:creator>Roy</dc:creator>
		<pubDate>Fri, 03 Apr 2009 10:01:13 +0000</pubDate>
		<guid isPermaLink="false">http://cormacscode.wordpress.com/?p=78#comment-313</guid>
		<description>I understand that the private/public/protected are the access specifiers in oops. where as in your example the variable is defined as private so its scope is limited to only that class. 

But I am bit confuse about the relation between __get() method and making variable readonly. I mean we can have read only variables without __get n __set methods.


can u please explain more on this</description>
		<content:encoded><![CDATA[<p>I understand that the private/public/protected are the access specifiers in oops. where as in your example the variable is defined as private so its scope is limited to only that class. </p>
<p>But I am bit confuse about the relation between __get() method and making variable readonly. I mean we can have read only variables without __get n __set methods.</p>
<p>can u please explain more on this</p>
]]></content:encoded>
	</item>
</channel>
</rss>
