#21155 [Bgs->Opn]: Macro Request

From: Date: Sun, 27 Apr 2003 14:41:45 +0000
Subject: #21155 [Bgs->Opn]: Macro Request
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-38510@lists.php.net to get a copy of this message
ID: 21155 User updated by: james at grickle dot org Reported By: james at grickle dot org -Status: Bogus +Status: Open Bug Type: Feature/Change Request Operating System: Slackware-current (12/22/02) PHP Version: 4.2.3 New Comment: __LINE__ and __FILE__ were just meant to be used as an example of how a macro feature might be used I intended it to be more of a preprocessor. So where ever it sees: DOERR(FATAL,"Database Error......"); it would replace it with errOut(FATAL, __FILE__ . ': ' . __LINE__ . ': ' . "Database Error......"); So __FILE__ and __LINE__ would actually be in the file and line the macro would be at. Using it much in the same way as the C preprocessor is/can be used. Previous Comments: ------------------------------------------------------------------------ [2003-04-26 09:44:55] helly@php.net Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Thank you for your interest in PHP. Maybe it would, but that is not the way __FILE__ and __LINE__ work. Simply use them as they are now: They always return the current file and line - no more no less. ------------------------------------------------------------------------ [2002-12-22 22:45:39] james at grickle dot org Hello, I would like to request something along the lines of macros. It would help a lot when you need to run __LINE__ and/or __FILE__ constants through a function. A simplified version of what I'd need them for. Currently I have: errOut([severity], [message]); Every time I use errOut I have __FILE__ and __LINE__ in the message: define(FATAL, 7); errOut(FATAL, __FILE__ . ": " . __LINE__ . ": Database error bla bla bla"); It could be shortened up by something like this: mdefine("DOERR", "errOut($1, __FILE__ . ': ' . __LINE__ . ': ' . $2)"); DOERR(FATAL,"Database Error bla bla bla"); This could be used for more vital things than that of course. Anything along those lines would be great. Thank You, James Harr ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=21155&edit=1

« previous php.bugs (#38510) next »