php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #39098 parser bug: dash after if condition makes script crash without any error
Submitted: 2006-10-09 16:17 UTC Modified: 2006-10-09 19:10 UTC
From: michael dot axt at mindcox dot com Assigned:
Status: Not a bug Package: Scripting Engine problem
PHP Version: 5.1.6 OS: Linux x86-64Bit
Private report: No CVE-ID: None
 [2006-10-09 16:17 UTC] michael dot axt at mindcox dot com
Description:
------------
If there is a dash after the right parenthesis, php crashes without any error or notices. Apache delivers an empty page with http status 200. 

This issue occurs only within the 64-bit version. 

Reproduce code:
---------------
<?php
$test = true;
if ($test)-
{
    echo "true";
}
echo "done";

Expected result:
----------------
Parse error: syntax error, unexpected..... bla bla as it is on most other php versions :-)


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-10-09 16:25 UTC] pajoye@php.net
Please try using this CVS snapshot:

  http://snaps.php.net/php5.2-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5.2-win32-latest.zip


 [2006-10-09 17:21 UTC] tony2001@php.net
Parse error: syntax error, unexpected '{' in /tmp/3.php on line 4

To see the errors you should have display_errors enabled.
 [2006-10-09 19:10 UTC] michael dot axt at mindcox dot com
Error-Reporting is switched on - completely incl. strict's

I tried the code on a 5.1.6 32-Bit php. The error occurs only on the 64-Bit php.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Mon Jul 14 21:01:33 2025 UTC