Bug #66279 [Com]: parse error problem starting with 5.5.0
| From: | felixl at densi dot com | Date: | Thu, 12 Dec 2013 20:11:52 +0000 |
| Subject: | Bug #66279 [Com]: parse error problem starting with 5.5.0 | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-183280@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=66279&edit=1
ID: 66279
Comment by: felixl at densi dot com
Reported by: felixl at densi dot com
Summary: parse error problem starting with 5.5.0
Status: Not a bug
Type: Bug
Package: *General Issues
Operating System: x86 Windows and linux
PHP Version: 5.5.7
Block user comment: N
Private report: N
New Comment:
https://github.com/propelorm/Propel/issues/803
Previous Comments:
------------------------------------------------------------------------
[2013-12-12 20:08:26] felixl at densi dot com
so a class variable can be called $yield, but a class constant cannot ?
for all propel 1.x user, the problem is here:
https://github.com/propelorm/Propel/blob/master/generator/lib/builder/om/ClassTools.php
in getPhpReservedWords()
must add the word 'yield' to the list.
------------------------------------------------------------------------
[2013-12-12 19:52:59] requinix@php.net
Ah, the link includes the ]. Oops.
http://www.php.net/manual/en/language.generators.overview.php
------------------------------------------------------------------------
[2013-12-12 19:52:02] requinix@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to
report
a bug at http://bugs.php.net/how-to-report.php
--
$this->modifiedColumns[] = CrossRefStockCodePeer::YIELD;
"yield" is a keyword as of PHP 5.5
[http://www.php.net/manual/en/language.generators.overview.php]. If you want to use PHP 5.5+ then
you need to edit your code to not use that as a name.
------------------------------------------------------------------------
[2013-12-12 19:45:47] felixl at densi dot com
tested on windows 7 x64 (fully patch)
tested on ubuntu 13.10 x86
------------------------------------------------------------------------
[2013-12-12 19:43:42] felixl at densi dot com
Description:
------------
Problem does not exist in 5.4.9 (windows tested)
Problem exist in 5.5.0 (windows tested)
Problem exist in 5.5.6 & 5.5.7 (ubuntu linux x86 tested)
@see link with code
The code is part of my symfony project (using propel db)
code is generated with propel model generator
(php app/console propel:model:build)
using latest propel 1.x
But symfony and propel are not the problem here.
Valid php should not give a parse error.
to test
- rename file to .php
php <path-to-file>
Test script:
---------------
http://www.densi.com/phpError/BaseCrossRefStockCode.php.txt
Expected result:
----------------
Result on php 5.4.9 and below :
Fatal error: Class 'BaseObject' not found in <path-to-file> on line 37
Actual result:
--------------
result on php >= 5.5.0:
Parse error: syntax error, unexpected 'YIELD' (T_YIELD) in <path-to-file> on line
889
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=66279&edit=1