﻿<?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/"
		>
<channel>
	<title>评论：PHP继承构造函数的可见性不能声明为private</title>
	<atom:link href="http://laigw.name/post/311.html/feed" rel="self" type="application/rss+xml" />
	<link>http://laigw.name/post/311.html</link>
	<description>Keep it simple, stupid. Simplicity is beauty.</description>
	<lastBuildDate>Sat, 04 Feb 2012 08:59:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>来自：Gavin</title>
		<link>http://laigw.name/post/311.html/comment-page-1#comment-532</link>
		<dc:creator>Gavin</dc:creator>
		<pubDate>Sat, 04 Feb 2012 08:59:31 +0000</pubDate>
		<guid isPermaLink="false">http://laigw.name/?p=311#comment-532</guid>
		<description>嗯，thx</description>
		<content:encoded><![CDATA[<p>嗯，thx</p>
]]></content:encoded>
	</item>
	<item>
		<title>来自：Gavin</title>
		<link>http://laigw.name/post/311.html/comment-page-1#comment-531</link>
		<dc:creator>Gavin</dc:creator>
		<pubDate>Sat, 04 Feb 2012 08:59:00 +0000</pubDate>
		<guid isPermaLink="false">http://laigw.name/?p=311#comment-531</guid>
		<description>此乃正解，thx，^_^</description>
		<content:encoded><![CDATA[<p>此乃正解，thx，^_^</p>
]]></content:encoded>
	</item>
	<item>
		<title>来自：surmise</title>
		<link>http://laigw.name/post/311.html/comment-page-1#comment-526</link>
		<dc:creator>surmise</dc:creator>
		<pubDate>Sat, 31 Dec 2011 04:58:40 +0000</pubDate>
		<guid isPermaLink="false">http://laigw.name/?p=311#comment-526</guid>
		<description>哥子，你贴的第一段代码与第二段代码中的类A的构造方法访问修饰符不同。
就第二段来说，A类中的构造方法为受保护的，B类中的构造方法为私有的，这还能不错？子类中重写的方法的访问权限不能低于父类中该方法的权限。即：一定要高于等于。</description>
		<content:encoded><![CDATA[<p>哥子，你贴的第一段代码与第二段代码中的类A的构造方法访问修饰符不同。<br />
就第二段来说，A类中的构造方法为受保护的，B类中的构造方法为私有的，这还能不错？子类中重写的方法的访问权限不能低于父类中该方法的权限。即：一定要高于等于。</p>
]]></content:encoded>
	</item>
	<item>
		<title>来自：walking_jiangjituo</title>
		<link>http://laigw.name/post/311.html/comment-page-1#comment-434</link>
		<dc:creator>walking_jiangjituo</dc:creator>
		<pubDate>Tue, 02 Aug 2011 14:31:56 +0000</pubDate>
		<guid isPermaLink="false">http://laigw.name/?p=311#comment-434</guid>
		<description>子类中重载的方法，不能低于父类中访问权限(子类可以放大权限，但不能缩小权限)</description>
		<content:encoded><![CDATA[<p>子类中重载的方法，不能低于父类中访问权限(子类可以放大权限，但不能缩小权限)</p>
]]></content:encoded>
	</item>
	<item>
		<title>来自：Gavin</title>
		<link>http://laigw.name/post/311.html/comment-page-1#comment-310</link>
		<dc:creator>Gavin</dc:creator>
		<pubDate>Sat, 07 Aug 2010 09:57:59 +0000</pubDate>
		<guid isPermaLink="false">http://laigw.name/?p=311#comment-310</guid>
		<description>细想了一下，这样的解释似乎不对。
的确，“构造函数是new类的时候”就开始调用了，但构造函数设定为private应该是可行的吖，因为就想限定调用者使用new生成ClassB的实例，只能使用getInstance来获得一个单例。
这样做在非继承类里是可以的，如第一段代码所示。但在继承类里就不行了。</description>
		<content:encoded><![CDATA[<p>细想了一下，这样的解释似乎不对。<br />
的确，“构造函数是new类的时候”就开始调用了，但构造函数设定为private应该是可行的吖，因为就想限定调用者使用new生成ClassB的实例，只能使用getInstance来获得一个单例。<br />
这样做在非继承类里是可以的，如第一段代码所示。但在继承类里就不行了。</p>
]]></content:encoded>
	</item>
	<item>
		<title>来自：Gavin</title>
		<link>http://laigw.name/post/311.html/comment-page-1#comment-292</link>
		<dc:creator>Gavin</dc:creator>
		<pubDate>Mon, 05 Apr 2010 06:21:04 +0000</pubDate>
		<guid isPermaLink="false">http://laigw.name/?p=311#comment-292</guid>
		<description>嗯，有道理。。。thx</description>
		<content:encoded><![CDATA[<p>嗯，有道理。。。thx</p>
]]></content:encoded>
	</item>
	<item>
		<title>来自：jorn</title>
		<link>http://laigw.name/post/311.html/comment-page-1#comment-290</link>
		<dc:creator>jorn</dc:creator>
		<pubDate>Tue, 09 Mar 2010 07:42:48 +0000</pubDate>
		<guid isPermaLink="false">http://laigw.name/?p=311#comment-290</guid>
		<description>很简单， 构造函数是在你的类 new的时候， 就开始使用了， 如果，你在构造函数里使用private， 那么与他的理论就起冲突了。</description>
		<content:encoded><![CDATA[<p>很简单， 构造函数是在你的类 new的时候， 就开始使用了， 如果，你在构造函数里使用private， 那么与他的理论就起冲突了。</p>
]]></content:encoded>
	</item>
</channel>
</rss>

