|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #42816 [PATCH] Add support for core and magic constants to error.php
Submitted: 2007-10-01 16:44 UTC Modified: 2018-07-23 10:22 UTC
Avg. Score:4.5 ± 0.5
Reproduced:4 of 4 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: Assigned:
Status: Analyzed Package: Website problem
PHP Version: Irrelevant OS: Irrelevant
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
Block user comment
Status: Assign to:
Bug Type:
New email:
PHP Version: OS:


 [2007-10-01 16:44 UTC]
The (extremely useful)$keyword redirect currently doesn't support the array of pre-defined constants available within PHP. This is an extra problem because the manual search typically doesn't return relevant results for many of them: as an example, try <> -- the right place to go would be <>, but that's not in the list.

I've concocted a patch for error.php to add support for the "core predefined constants" and the magic constants (including __NAMESPACE__, since it looks like we'll be getting that one soon enough), and it's at <>. Hard-coding the constants into the manual page moves array probably isn't the best approach, but there's going to need to be an evil-looking list somewhere, I guess.

This patch doesn't address the longer list of "standard predefined constants", but it's a start. If the approach is acceptable (or a better one is recommended), I'll look at cooking up a patch for those as well.


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2007-10-10 11:40 UTC]
I love the idea, but I really don't want _all_ the constants listed in the error handler - and needing to update the error handler on every new constant...

I however can't come up with better way..
 [2008-11-29 16:40 UTC]
Couldn't PhD perhaps generate a file with core/standard constants for each time the manual is pushed to the mirrors?
 [2018-07-23 10:22 UTC]
-Status: Open +Status: Analyzed
 [2018-07-23 10:22 UTC]
Coming back to this one, perhaps we look into using a database an sqlite database for lookups (I'm pretty sure we have such for indexing), and then a handler to determine where to redirect to based on a lookup so we never have to add new constants. It does also seem more efficient than my initial idea of extending the hack by letting PhD generate a list for php-web.
 [2021-04-28 01:56 UTC] pipahaha47 at gmail dot com
Your article is very detailed and easy to understand, This is a must for readers who need advanced knowledge like me, thanks!
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Sep 26 23:03:37 2021 UTC