|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2014-08-01 17:21 UTC] tyrael@php.net
-Type: Bug
+Type: Feature/Change Request
[2016-06-14 13:10 UTC] cmb@php.net
-Status: Open
+Status: Closed
-Assigned To:
+Assigned To: cmb
[2016-06-14 13:10 UTC] cmb@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Nov 01 04:00:02 2025 UTC |
Description: ------------ Strings can be dereferenced to get sub-strings of length 1, eg. 'hello'[1] === 'e'. String variables can be dereferenced, eg. ($x = 'hello') && ($x[1] === 'e') String constants can't be dereferenced, eg. define('MY_CONST', 'hello') && MY_CONST[1]. Test script: --------------- <?php define('MY_CONST', 'hello'); var_dump(MY_CONST[1]); Expected result: ---------------- 'string(1) "e"' on stdout Actual result: -------------- Parse error: syntax error, unexpected '[' in /home/chris/test2.php on line 5