|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2002-06-28 10:28 UTC] webmaster at phpindex dot com
This simple script crash with
Parse error: parse error, unexpected ':', expecting '}' in /usr/local/apache/htdocs/armel/crash.php on line 5
<?php
$foo = "php";
print "{$foo}";
print "{:$foo}";
print "{$foo:}";
?>
Note that if you comment the last print, it just return
php{:php}
and not
{php}{:php}
May be a small problem in the Zend Engine (see T_CURLY_OPEN) :
line 695 -> Zend/zend_language_parser.y
line 1348 -> Zend/zend_language_scanner.l
This bug is reproducible and have been tested with php 4.2.1 (apxs) and 4.2.0 (CGI).
Regards,
Armel.
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2026 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 07 23:00:01 2026 UTC |
This is not a bug but expected behaviour. ${ and {$ begin a variable name, and : is not allowed in a variable name. Not a bug -> bogus.