|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-06-16 18:18 UTC] johannes@php.net
-Status: Open
+Status: Wont fix
[2014-06-16 18:18 UTC] johannes@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Thu Oct 08 09:00:02 2026 UTC |
Description: ------------ In PHP 5.6, const supports static expression. But it still does not support dynamic expression. So please implement the ability to use dynamic expressions when using const. I think that const should replace define() entirely. const is much more readable and natural than define(). Test script: --------------- <?php const PI = atan(1)*4; const RANDOM = rand(); echo PI . "\n"; echo RANDOM . "\n"; Expected result: ---------------- 3.141592653589793 445 Actual result: -------------- Parse error: syntax error, unexpected '(', expecting ',' or ';' in C:\Users\hack s_000\Desktop\test.php on line 2