#27265 [Ver->Bgs]: Reflection API :: Reflection_Property fails when a const is passed

From: Date: Mon, 16 Feb 2004 20:04:19 +0000
Subject: #27265 [Ver->Bgs]: Reflection API :: Reflection_Property fails when a const is passed
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-55026@lists.php.net to get a copy of this message
 ID:               27265
 Updated by:       helly@php.net
 Reported By:      jw at jwscripts dot com
-Status:           Verified
+Status:           Bogus
 Bug Type:         Zend Engine 2 problem
 Operating System: *
 PHP Version:      5CVS-2004-02-15
 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php

We are missing a class 'Reflection_Const'.


Previous Comments:
------------------------------------------------------------------------

[2004-02-15 15:00:46] jw at jwscripts dot com

Description:
------------
When passing a constant to the constructor of the Reflection_Property
class, an exception is thrown.

You can work around this, e.g., by creating an instance of the
Reflection_Object class instead, but this isn't very pretty.

The same problem occurres when a constant with one or more uppercased
characters is defined, e.g.:

const $TEST = "foo";

 

Reproduce code:
---------------
<?

class Foo {
	const TEST = "foo";
	// Fails too: static $TEST = "foo";
	// Success  : static $test = "foo";
}

class Types extends Reflection_Property {
	public function __construct($object, $name) {
		parent::__construct($object, $name);
	}
}

$types = new Types("Foo", "TEST");

?>

Expected result:
----------------
No output

Actual result:
--------------
Fatal error: Uncaught exception 'reflection_exception' with message
'Property Foo::$TEST does not exist' in [...] Stack trace: #0
[...](13): Types->__construct() #1 {main} thrown in [...] on line
[...]



------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=27265&edit=1


Thread (6 messages)

« previous php.bugs (#55026) next »