ID:               19610
 Updated by:       [EMAIL PROTECTED]
 Reported By:      [EMAIL PROTECTED]
-Status:           Open
+Status:           Feedback
 Bug Type:         Feature/Change Request
 Operating System: all
 PHP Version:      4.2.3
 New Comment:

I seem to fail to understand your exackt concerns. Can you elaborate a
bit more on

"things get confusing while editing code and youre bound to come to
unused/unreferenced constants (or missing ones)."

especially the second part of the sentence ?


Wouldn't a simply call to function solve the problem (which itself
isn't yet clear to me).

Requesting feedback.


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

[2002-09-26 05:47:39] [EMAIL PROTECTED]

lets say for example you have vast ammounts of code which use a
language system which is based on define() statements, and ofcourse
addressing of theese in the source code in the following way:

echo date(_MB_TODAYSDATE,time());

things get confusing while editing code and youre bound to come to
unused/unreferenced constants (or missing ones).

having the handler would help us do two things:

#1 using the define() statement to call a handler with the $key, $val
pair, in which a person could for example store this in a database (to
display and edit on a webpage for example)

#2 - this is a three part advancement

a) a person could count how many times a variable has been referenced
(and store that number into the database, so eventually after
playtesting every part of the software you find "unused" keys);

b) a person could also store information on constants that are not
really defined (a defined() check to acctually throw out errors or
create "unused" defines in the database, for easy editing later)

c) a constant doesnt really need to be defined, it can be also fetched
from the database on first reference - or whatever other behaviour the
user wants to make

this could/should be done in the way like set_error_handler and
restore_error_handler, with the sole difference that you would need two
function names as the parameters (or have two functions which have
one), i dont see a problem implementing this in 4.3 or 5.0 the latest,
as it would really proove usefull to many people (mainly the ones who
made their language system based on define statements in order to help
them clean their code or transfer to a more advanced multilanguage
system, operated with a database, xml, whatever they think of when
writing a handler for this)

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


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

Reply via email to