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

From: Date: Thu, 28 Aug 2014 19:59:39 +0000
Subject: Bug #67880 [Fbk->Opn]: Class const with calculation.
References: 1  Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187323@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 User updated by: tux at krageroby dot no Reported by: tux at krageroby dot no Summary: Class const with calculation. -Status: Feedback +Status: Open Type: Bug -Package: Unknown/Other Function +Package: opcache Operating System: xUbuntu 14.04 -PHP Version: 5.6.0RC4 +PHP Version: 5.6.0 Block user comment: N Private report: N New Comment: Tested again without opcache on, and the error is gone. Pretty sure it is opcache related. I have not been successful to create a backtrace. Previous Comments: ------------------------------------------------------------------------ [2014-08-21 17:25:57] requinix@php.net 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. ------------------------------------------------------------------------ [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

« previous php.bugs (#187323) next »