|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2010-12-28 12:52 UTC] jani@php.net
-Summary: new const keyword outside a class
definition
+Summary: Allow using const keyword outside a
class definition
-Package: Feature/Change Request
+Package: Scripting Engine problem
-Operating System: all
+Operating System: *
-PHP Version: 5.3.0
+PHP Version: *
[2015-03-21 20:19 UTC] nikic@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: nikic
[2015-03-21 20:19 UTC] nikic@php.net
|
|||||||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 00:00:01 2025 UTC |
Description: ------------ comparison const and define. define() allows expressions as the value. but const only allows scalar. Reproduce code: --------------- const FIRST_CONSTANT = __DIR__.DIRECTORY_SEPARATOR; // parse error define('SECOND_CONSTANT', __DIR__.DIRECTORY_SEPARATOR); // this work const THIRD_CONSTANT = SECOND_CONSTANT; // this work too Expected result: ---------------- const FIRST_CONSTANT = __DIR__.DIRECTORY_SEPARATOR; // expected same define() work define('SECOND_CONSTANT', __DIR__.DIRECTORY_SEPARATOR); // this work const THIRD_CONSTANT = SECOND_CONSTANT; // this work too