php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #25256 Parse error: parse error, unexpected $ in ... on line 642
Submitted: 2003-08-26 13:37 UTC Modified: 2003-08-26 22:51 UTC
From: a dot schat at streamedge dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 4.3.1 OS: Linux
Private report: No CVE-ID: None
 [2003-08-26 13:37 UTC] a dot schat at streamedge dot com
Description:
------------
Parse error: parse error, unexpected $ in /useradmin.inc.php on line 642
It gives this error on: linux, php 4.3.1, Apache/1.3.27
But not on Windows NT localhost 5.1 build 2600,  php 4.3.1, Apache/ Apache/1.3.24

Note the comment tags before the line of code. If I put a block comment around it, the error is gone.

Reproduce code:
---------------
//$updateform.= "<tr><td width=10%></td><td><input type=\"radio\" name=\"usertype\" value=\"user\" checked onclick=\"javascript:showLayer('rest2".$counter."');\"></td><td><input type=\"radio\" name=\"usertype\" value=\"administrator\" onclick=\"javascript:hideLayer('rest2".$counter."');\"></td></tr>";


Expected result:
----------------
Php should ignore this line right? 

Actual result:
--------------
Parse error: parse error, unexpected $ in /useradmin.inc.php on line 642

This is the last line of the document

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-08-26 13:50 UTC] iliaa@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 is expected hevaiour, use /* */ to comment out multi-line code blocks.
 [2003-08-26 14:19 UTC] a dot schat at streamedge dot com
No its not expected behaviour, all this code is on a single line
 [2003-08-26 14:31 UTC] helly@php.net
Thank you for taking the time to report a problem with PHP.
Unfortunately you are not using a current version of PHP -- 
the problem might already be fixed. Please download a new
PHP version from http://www.php.net/downloads.php

If you are able to reproduce the bug with one of the latest
versions of PHP, please change the PHP version on this bug report
to the version you tested and change the status back to "Open".
Again, thank you for your continued support of PHP.

We just realease 4.3.3 which we strongly advise to use. Please try that version and report your expirience with your problem.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Dec 19 12:00:02 2025 UTC