From:             signe at cothlamadh dot net
Operating system: All
PHP version:      5.2.6
PHP Bug Type:     Scripting Engine problem
Bug description:  Comma should be a valid HEREDOC keyword suffix

Description:
------------
Comma should be added to the allowable line suffixes for HEREDOC keywords.
 The use of HEREDOC in an array becomes very ungainly because the keyword
can not be terminated followed by a comma.

Currently the addition of a comma renders the scripting engine unable to
recognize the keyword as being the terminator for the HEREDOC string and
the rest of the script is absorbed resulting in an "syntax error,
unexpected $end" E_PARSE_ERROR.



Reproduce code:
---------------
<?php
$foo = array(
    'blah' => <<<SQL
        SELECT
            *
        FROM
            test
        WHERE
            RAND()
SQL,
    'foo' => 'bar',
    'baz' => 'blat'
);  
print_r($foo);
?>

Expected result:
----------------
The comma should not prevent the HEREDOC string from being terminated, and
should be a valid suffix, just like semi-colon is.

Actual result:
--------------
Parse error: syntax error, unexpected $end in test.php on line 16

-- 
Edit bug report at http://bugs.php.net/?id=45204&edit=1
-- 
Try a CVS snapshot (PHP 5.2): 
http://bugs.php.net/fix.php?id=45204&r=trysnapshot52
Try a CVS snapshot (PHP 5.3): 
http://bugs.php.net/fix.php?id=45204&r=trysnapshot53
Try a CVS snapshot (PHP 6.0): 
http://bugs.php.net/fix.php?id=45204&r=trysnapshot60
Fixed in CVS:                 http://bugs.php.net/fix.php?id=45204&r=fixedcvs
Fixed in release:             
http://bugs.php.net/fix.php?id=45204&r=alreadyfixed
Need backtrace:               http://bugs.php.net/fix.php?id=45204&r=needtrace
Need Reproduce Script:        http://bugs.php.net/fix.php?id=45204&r=needscript
Try newer version:            http://bugs.php.net/fix.php?id=45204&r=oldversion
Not developer issue:          http://bugs.php.net/fix.php?id=45204&r=support
Expected behavior:            http://bugs.php.net/fix.php?id=45204&r=notwrong
Not enough info:              
http://bugs.php.net/fix.php?id=45204&r=notenoughinfo
Submitted twice:              
http://bugs.php.net/fix.php?id=45204&r=submittedtwice
register_globals:             http://bugs.php.net/fix.php?id=45204&r=globals
PHP 4 support discontinued:   http://bugs.php.net/fix.php?id=45204&r=php4
Daylight Savings:             http://bugs.php.net/fix.php?id=45204&r=dst
IIS Stability:                http://bugs.php.net/fix.php?id=45204&r=isapi
Install GNU Sed:              http://bugs.php.net/fix.php?id=45204&r=gnused
Floating point limitations:   http://bugs.php.net/fix.php?id=45204&r=float
No Zend Extensions:           http://bugs.php.net/fix.php?id=45204&r=nozend
MySQL Configuration Error:    http://bugs.php.net/fix.php?id=45204&r=mysqlcfg

Reply via email to