php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #48958 bug in the define() funtion
Submitted: 2009-07-17 11:57 UTC Modified: 2009-07-17 12:40 UTC
From: wolff at ironshark dot de Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.2.10 OS: Linux
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: wolff at ironshark dot de
New email:
PHP Version: OS:

 

 [2009-07-17 11:57 UTC] wolff at ironshark dot de
Description:
------------
it is possible to overwrite defined variables

Reproduce code:
---------------
define('FOO','bar',true);
echo FOO; // will print "bar"

define('FOO','bar',true);
define('FOO','stuff',true);
echo FOO; // will print "bar"

define('FOO','bar',true);
define('FOO','stuff'); // <<< here is the bug
echo FOO; // will print "stuff"

Expected result:
----------------
FOO won't be overwritten

Actual result:
--------------
it will printed out "stuff"

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-07-17 12:40 UTC] jani@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php


 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Sun Jul 27 10:00:02 2025 UTC