php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #1270 no warning when trying to overwrite define/no undefine!?
Submitted: 1999-03-26 12:49 UTC Modified: 1999-06-01 15:43 UTC
From: mb at mbit dot de Assigned:
Status: Closed Package: Misbehaving function
PHP Version: 3.0.7 OS: linux
Private report: No CVE-ID: None
 [1999-03-26 12:49 UTC] mb at mbit dot de
1)
when trying something like this:

error_reporting(63);
define("CONSTANT", "Hello dfdfdffd.");
define("CONSTANT", "Hello world.");

it would be nice to get a warning when the second define takes no effect.

2)
in the doc-file (.../lang-const.html#CONSTANTS, Date: 1998-12-28, Release: 3.0.7-dev) I found:

<?php
define("CONSTANT", "Hello world.");
echo CONSTANT; // outputs "Hello world."
undefine ("CONSTANT");
?>

but i results in:

Hello world.<br>
<b>Fatal error</b>:  Call to unsupported or undefined function undefine() in <b>...</b> on line <b>...</b><br>

and in the actuell doc-file I miss it!?

3)
is it possible to test a constant wether it is set like:

define("CONSTANT", "Hello world.");
if(isset(CONSTANT))
    ......

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [1999-06-01 15:43 UTC] jim at cvs dot php dot net
1) File a feature request.

2) The docs are wrong. This has been fixed.

3) Use defined().
 
PHP Copyright © 2001-2026 The PHP Group
All rights reserved.
Last updated: Sat Jul 04 13:00:01 2026 UTC