svn: /phpdoc/en/trunk/reference/reflection/reflectionclass/ isinstantiable.xml

From: Date: Fri, 30 Mar 2012 11:11:35 +0000
Subject: svn: /phpdoc/en/trunk/reference/reflection/reflectionclass/ isinstantiable.xml
Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-9974@lists.php.net to get a copy of this message
vrana Fri, 30 Mar 2012 11:11:35 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=324631 Log: Classes with private constructors are not instantiable Changed paths: U phpdoc/en/trunk/reference/reflection/reflectionclass/isinstantiable.xml Modified: phpdoc/en/trunk/reference/reflection/reflectionclass/isinstantiable.xml =================================================================== --- phpdoc/en/trunk/reference/reflection/reflectionclass/isinstantiable.xml 2012-03-30 11:06:21 UTC (rev 324630) +++ phpdoc/en/trunk/reference/reflection/reflectionclass/isinstantiable.xml 2012-03-30 11:11:35 UTC (rev 324631) @@ -60,8 +60,19 @@ function f2() { } } -$classes = array("C", "iface", "ifaceImpl", "abstractClass", "D"); +class privateConstructor { + private function __construct() { } +} +$classes = array( + "C", + "iface", + "ifaceImpl", + "abstractClass", + "D", + "privateConstructor", +); + foreach($classes as $class ) { $reflectionClass = new ReflectionClass($class); echo "Is $class instantiable? ";

« previous php.doc.cvs (#9974) next »