Error in using already defined constants (PHP)

Bug #1514845 reported by Kai
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
php5 (Ubuntu)
Invalid
Undecided
Unassigned

Bug Description

Hello,

I have following problem. I am running Ubuntu 15.04, with PHP 5.6.14 by running the following code snippit in terminal I am receiving the concrete results, but if I am running the code from browser the constant first defined in bar.php seems to be temporary overwritten (for the concatenation). So the result of echo BAR_WITH_CONCAT is barBarwith_concat and not foowith_concat.

kindly regards

Kai

//foo.php
<?php
error_reporting();
phpinfo();

//error_reporting(E_ALL);

include ('bar.php');
include ('bar_2.php');
echo BAR;
echo BAR_WITH_CONCAT;

//bar.php
define('BAR','foo');

//bar_2.php
define('BAR','barBar');
define('BAR_WITH_CONCAT', BAR.'with_concat');

Tags: bot-comment
Revision history for this message
Kai (kkh-z) wrote :
Revision history for this message
Kai (kkh-z) wrote :
Revision history for this message
Kai (kkh-z) wrote :
Revision history for this message
Ubuntu Foundations Team Bug Bot (crichton) wrote :

Thank you for taking the time to report this bug and helping to make Ubuntu better. It seems that your bug report is not filed about a specific source package though, rather it is just filed against Ubuntu in general. It is important that bug reports be filed about source packages so that people interested in the package can find the bugs about it. You can find some hints about determining what package your bug might be about at https://wiki.ubuntu.com/Bugs/FindRightPackage. You might also ask for help in the #ubuntu-bugs irc channel on Freenode.

To change the source package that this bug is filed about visit https://bugs.launchpad.net/ubuntu/+bug/1514845/+editstatus and add the package name in the text box next to the word Package.

[This is an automated message. I apologize if it reached you inappropriately; please just reply to this message indicating so.]

tags: added: bot-comment
Kai (kkh-z)
affects: ubuntu → php5 (Ubuntu)
Revision history for this message
Ondřej Surý (ondrej) wrote :

Ubuntu 15.04 comes with php5 5.6.11+dfsg-1ubuntu3.1. Could you clarify that?

Revision history for this message
Kai (kkh-z) wrote :

Yesterday I made an dis update and got PHP 5.6.14+dfsg+deb.sury.org~vivid+1 before this update I also got the same problem

Revision history for this message
Ondřej Surý (ondrej) wrote :

Than you should not report this bug against Ubuntu. Upstream PHP bugtracker (bugs.php.net) would be most appropriate place (and wait until there's an php 5.6.15 update).

Changed in php5 (Ubuntu):
status: New → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.