Bug #67880 [NEW]: Class const with calculation.

From: Date: Thu, 21 Aug 2014 12:20:55 +0000
Subject: Bug #67880 [NEW]: Class const with calculation.
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-187217@lists.php.net to get a copy of this message
From: tux at krageroby dot no Operating system: xUbuntu 14.04 PHP version: 5.6.0RC4 Package: Unknown/Other Function Bug Type: Bug Bug description:Class const with calculation. 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 bug report at https://bugs.php.net/bug.php?id=67880&edit=1 --

« previous php.bugs (#187217) next »