php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #50233 This is not enought description.
Submitted: 2009-11-19 16:00 UTC Modified: 2009-11-24 17:52 UTC
Votes:4
Avg. Score:3.0 ± 0.0
Reproduced:4 of 4 (100.0%)
Same Version:0 (0.0%)
Same OS:0 (0.0%)
From: k_radek at yahoo dot pl Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.2.11 OS: GNU/Linux
Private report: No CVE-ID: None
 [2009-11-19 16:00 UTC] k_radek at yahoo dot pl
Description:
------------
Last paremeter defined in a function says that you can define constant with case-insensitive option but says nothing about that it allows you to REDEFINE constant...

Reproduce code:
---------------
---
From manual page: function.define#Parameters
---

"If set to TRUE, the constant will be defined case-insensitive. The default behavior is case-sensitive; i.e. CONSTANT and Constant represent different values."

Expected result:
----------------
"If set to TRUE, the constant will be defined case-insensitive. The default behavior is case-sensitive; i.e. CONSTANT and Constant represent different values. It allows you to redefine constant."

Actual result:
--------------
"If set to TRUE, the constant will be defined case-insensitive. The default behavior is case-sensitive; i.e. CONSTANT and Constant represent different values."

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-23 20:44 UTC] bjori@php.net
That makes no sense.
Reclassified as an engine problem.
 [2009-11-23 20:49 UTC] bjori@php.net
Actually, I cannot reproduce this.

You are probably talking about something like this:
<?php
define("fOo", "bar", 0); 
var_dump(fOo);
define("FOO", "foobar", 1); 
var_dump(fOo, foo);
?>

Note that "fOo" still references the original "bar", while any other variations of "foo" reference the latter, case-insensitive declaration.
Thats expected behavior.
 [2009-11-23 21:05 UTC] bjori@php.net
Actually, see bug#50184 (which is an open doc issue)
 [2009-11-24 17:52 UTC] k_radek at yahoo dot pl
Exactly. Same bug here bug#50184.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 17 06:01:32 2025 UTC