php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4443 inconsistant parsing
Submitted: 2000-05-14 14:50 UTC Modified: 2000-05-21 17:16 UTC
From: xdesign at hotmal dot com Assigned:
Status: Closed Package: Parser error
PHP Version: 3.0.16 OS: rh linux 6.2
Private report: No CVE-ID: None
 [2000-05-14 14:50 UTC] xdesign at hotmal dot com
for($i=0; $i<3; $i++) {                         
  if(($row[$i+11] != "") || ($row[$i+19] != "")) {
    print("<tr><td>");
    if($row[$i+11] != "") {
      $tmp = $i + 11;
      print("<table width=100%><tr><td>$row[$tmp]</td>");
      $tmp = $i + 15;
      print("<td align=right>($row[$i+11])</td></tr></table>\n");

---

In the sample above, the reference to $row[$tmp] works fine but the more direct $row[$i+11] doesn't and returns a parsing error saying:

Parse error: parse error, expecting `']'' in /home/httpd/html/xxx.html on line 47

As you can see, I have devised a work-around to the problem but I cannot easily see that I have made a mistake in it.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-05-21 17:16 UTC] jimw at cvs dot php dot net
you can't place arbitrary expressions inside a double-quoted string.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Apr 20 00:01:27 2024 UTC