|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2004-02-16 15:04 UTC] helly@php.net
[2004-02-16 16:55 UTC] jw at jwscripts dot com
[2004-06-09 11:13 UTC] D dot Kingma at jool dot nl
[2004-06-09 22:18 UTC] jw at jwscripts dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 08 02:00:02 2025 UTC |
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 [...]