php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25323 class constants odd behavior
Submitted: 2003-08-30 14:21 UTC Modified: 2003-10-16 00:04 UTC
Votes:6
Avg. Score:5.0 ± 0.0
Reproduced:6 of 6 (100.0%)
Same Version:6 (100.0%)
Same OS:5 (83.3%)
From: cunha17 at uol dot com dot br Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 5CVS-2003-09-20 (dev) OS: RedHat Linux 9.0
Private report: No CVE-ID: None
 [2003-08-30 14:21 UTC] cunha17 at uol dot com dot br
Description:
------------
Is this suppose to work ? Currently it does not.

class Priority {
        const DEBUG = 0;
        const INFO = 1;
        const WARN = 2;
        const ERROR = 3;
        const FATAL = 4;

        const MAX_PRIORITY = FATAL;
}

class ExtendedPriority extends Priority {
        const REMOTE = Priority::MAX_PRIORITY + 1;
        const URGENT = Priority::MAX_PRIORITY + 2;
}

if it's not supposed to work, there is some parser problem in ZE2 that accepts a constant expression based on string concatenation.

Reproduce code:
---------------
class test {
        const TEST = "hi";
        const TEST1 = self::TEST . "ih";
}


Expected result:
----------------
No parser error nor core dumps. Or a paser error if it's not supposed to work.

Actual result:
--------------
Segmentation Fault

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-10-15 20:04 UTC] lphuberdeau at phpquebec dot org
The bug seems to be fixed (snapshot of 2003-10-15).
 [2003-10-16 00:04 UTC] sniper@php.net
This bug has been fixed in CVS.

In case this was a PHP problem, snapshots of the sources are packaged
every three hours; this change will be in the next snapshot. You can
grab the snapshot at http://snaps.php.net/.
 
In case this was a documentation problem, the fix will show up soon at
http://www.php.net/manual/.

In case this was a PHP.net website problem, the change will show
up on the PHP.net site and on the mirror sites in short time.
 
Thank you for the report, and for helping us make PHP better.


 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Aug 14 13:01:27 2024 UTC