ID: 29986
Updated by: [EMAIL PROTECTED]
Reported By: mitchel at sahertian dot com
-Status: No Feedback
+Status: Assigned
Bug Type: Scripting Engine problem
Operating System: Linux 2.6.8.1 x86
PHP Version: 5.0.1
-Assigned To:
+Assigned To: johannes
Previous Comments:
------------------------------------------------------------------------
[2006-02-24 15:52:03] RQuadling at GMail dot com
Windows XP SP2 running the latest PHP.
PHP 5.1.3-dev (cli) (built: Feb 20 2006 00:29:25)
Copyright (c) 1997-2006 The PHP Group
Zend Engine v2.1.0, Copyright (c) 1998-2006 Zend Technologies
with Zend Extension Manager v1.0.10, Copyright (c) 2003-2006, by
Zend Technologies
with Zend Optimizer v3.0.0-Beta2, Copyright (c) 1998-2006, by Zend
Technologies
Reproduce code:
---------------
<?php
class just_constants
{
// These don't work.
const BOOLEAN_CONSTANT = True;
const NULL_CONSTANT = Null;
// These do work.
const STRING_CONSTANT = 'This is a string';
const INTEGER_CONSTANT = 1000;
const FLOAT_CONSTANT = 3.1415926535897932384626433832795;
}
Reflection::export(new ReflectionClass('just_constants'));
?>
Expected result:
----------------
Class [ <user> class just_constants ] {
@@ D:\Data\PHP\Includes\ERT\rcerr.php 2-10
- Constants [5] {
Constant [ boolean BOOLEAN_CONSTANT ] { }
Constant [ null NULL_CONSTANT ] { }
Constant [ string STRING_CONSTANT ] { }
Constant [ integer INTEGER_CONSTANT ] { }
Constant [ double FLOAT_CONSTANT ] { }
}
- Static properties [0] {
}
- Static methods [0] {
}
- Properties [0] {
}
- Methods [0] {
}
}
Actual result:
--------------
Class [ <user> class just_constants ] {
@@ D:\Data\PHP\Includes\ERT\rcerr.php 2-10
- Constants [5] {
Constant [ unknown BOOLEAN_CONSTANT ] { }
Constant [ unknown NULL_CONSTANT ] { }
Constant [ string STRING_CONSTANT ] { }
Constant [ integer INTEGER_CONSTANT ] { }
Constant [ double FLOAT_CONSTANT ] { }
}
- Static properties [0] {
}
- Static methods [0] {
}
- Properties [0] {
}
- Methods [0] {
}
}
In zend_API.c (/* $Id: zend_API.c,v 1.347 2006/02/22 12:02:44 dmitry
Exp $ */) Lines 217 to 250 - zend_zval_type_name() has the capability
to return the 'boolean' and 'null' values. Though 'string' is shown as
'native string' in the source code and that change was made V1.304
17/08/2005 but has not been compiled maybe? Is the zend engine slow to
update as compared to the main PHP code? Are there other changes not
being made here? I did a binary search on all of the dlls and exes and
no mention of 'native string'. At around byte 0x2728B0 in php5ts.dll
the text for the return values from the zend_zval_type_name function
are stored.
------------------------------------------------------------------------
[2004-10-20 01:00:05] php-bugs at lists dot php dot net
No feedback was provided for this bug for over a week, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to "Open".
------------------------------------------------------------------------
[2004-10-12 09:33:24] [EMAIL PROTECTED]
Please try using this CVS snapshot:
http://snaps.php.net/php5-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php5-win32-latest.zip
------------------------------------------------------------------------
[2004-10-12 09:27:52] php at bobsilva dot com
This is fixed in 5.1 CVS
------------------------------------------------------------------------
[2004-09-08 16:08:43] ante dot dfg at moj dot net
Interestingly enough this example(btw there's an error at end of DEFINE
- define("FOOBAR",0x0008): <- this should be ;) when copy paste and run
dies with Fatal error: Trying to clone an uncloneable object of class
ReflectionClass in c:\serverroot\test.php on line 11
but If I put a reference in $o=new ReflectionClass("MyClass");
making it $o=&new ReflectionClass("MyClass");
then I actualy get the message ("actual result") that Michael
stated....
I'm using php 5.0.1 (release version) on XP Pro under Apache
1.3.31....
Hope this helps somehow...
------------------------------------------------------------------------
The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/29986
--
Edit this bug report at http://bugs.php.net/?id=29986&edit=1