php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #67123 Missing Concatenation Operator
Submitted: 2014-04-24 02:41 UTC Modified: 2014-04-27 03:20 UTC
From: floriparob at yahoo dot com dot br Assigned:
Status: Not a bug Package: Strings related
PHP Version: 5.5.11 OS: Debian 64 bit
Private report: No CVE-ID: None
 [2014-04-24 02:41 UTC] floriparob at yahoo dot com dot br
Description:
------------
The parser is not picking up a missing concatenation (full stop) in a string being echoed out. No error or warning is issued. Output stops and only the html created prior to calling the script is displayed, resulting in a page with just the banners and headers. The following is part of an include php script.

echo '<tr><td>' . $field_a . '</td><td>' . $field_b '</td></tr>' . PHP_EOL;

FAILS without any notice being displayed by the parser, whereas

echo '<tr><td>' . $field_a . '</td><td>' . $field_b . '</td></tr>' . PHP_EOL;

works correctly.


Test script:
---------------
See above.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-04-24 02:47 UTC] requinix@php.net
-Status: Open +Status: Feedback
 [2014-04-24 02:47 UTC] requinix@php.net
http://3v4l.org/AP1Fc

Check your php.ini settings. Such as display_errors.
 [2014-04-25 01:23 UTC] floriparob at yahoo dot com dot br
php.ini settings are:-

error_reporting = E_ALL

display_errors = On

display_startup_errors = On

log_errors = On

log_errors_max_len = 1024

ignore_repeated_source = Off

report_memleaks = On

track_errors = On

html_errors = On


They have been set like this for ages.
Other parser errors have been reported, such as a missing right parenthesis.
There was an upgrade to bluefish some months ago and it ceased to append parentheses correctly and if I missed this then the parser would pull an error.

If you do not concatenate the string correctly by missing out a full stop character, execution of the script ceases, NO error is displayed, NO error is reported in the log, and you are left in the dark.

PHP could support alternate concatenation characters, such as the plus sign as used by JS. Then, people who have to wear spectacles, like myself, might be able to pick up missing characters in a string more easily.
 [2014-04-25 02:16 UTC] requinix@php.net
Not sure what I can tell you besides that PHP isn't trying to hide that error. Experiment to see if you can nail down exactly what kind of code does it - different operators, different places in code, different strings...
And when all else fails, delete the entire line, type it again, and see if the problem still occurs.
 [2014-04-27 02:31 UTC] floriparob at yahoo dot com dot br
-Status: Feedback +Status: Open
 [2014-04-27 02:31 UTC] floriparob at yahoo dot com dot br
I obviously fixed the string by entering the missing full stop and now the script works properly.
I have reported this bug in the parser. You can try it yourself using this version of PHP. Write a five line PHP script yourself that echo's out a string with a missing full stop concatenation operator and see what happens.
I do not need suggestions. Fix the parser.
 [2014-04-27 03:20 UTC] requinix@php.net
-Status: Open +Status: Not a bug
 [2014-04-27 03:20 UTC] requinix@php.net
In case you missed it earlier, I already did write a test script. It works just fine.
http://3v4l.org/AP1Fc

Feel free to reopen this if you can get 3v4l to reproduce your problem.
 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Fri Jan 24 16:01:24 2020 UTC