Bug #67880 [Opn->Fbk]: Class const with calculation.

From: Date: Thu, 21 Aug 2014 17:25:58 +0000
Subject: Bug #67880 [Opn->Fbk]: Class const with calculation.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187223@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=67880&edit=1

 ID:                 67880
 Updated by:         requinix@php.net
 Reported by:        tux at krageroby dot no
 Summary:            Class const with calculation.
-Status:             Open
+Status:             Feedback
 Type:               Bug
 Package:            Unknown/Other Function
 Operating System:   xUbuntu 14.04
 PHP Version:        5.6.0RC4
 Block user comment: N
 Private report:     N

 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php
for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php
for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.




Previous Comments:
------------------------------------------------------------------------
[2014-08-21 12:20:54] tux at krageroby dot no

Description:
------------
Declaring constants that does calculations like in the sample below only works sometimes.

One simple example posted below, I have also some heavier code (I could not reproduce in a small
example, but I would think the problem is covered by the other example) that works the first time
loaded, and then produce the message: Fatal error: Unsupported operand types in … until the
.php file is changed in any way. After the php file is changed, the code runs once before crashing
again.

Test script:
---------------
class Test
{
	const ONE = 1;
	const TWO = 2;
	const THREE = self::ONE + self::TWO;

	public function run ()
	{
		return self::THREE;
	}
}
$test = new Test();
echo $test->run();

Expected result:
----------------
3

Actual result:
--------------
Works in cli mode, but apache responds with: 500 internal server error

[Thu Aug 21 13:07:34.283310 2014] [mpm_itk:error] [pid 5184] child died with signal 11


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=67880&edit=1


Thread (5 messages)

« previous php.bugs (#187223) next »