Re: Bug #13505: The word "New" alone causes compilation to abort while "New_" allows compile.
| From: | Steve Meyers | Date: | Tue, 02 Oct 2001 04:28:03 +0000 |
| Subject: | Re: Bug #13505: The word "New" alone causes compilation to abort while "New_" allows compile. | ||
| References: | 1 | Groups: | php.dev |
| Request: | Send a blank email to php-dev+get-66971@lists.php.net to get a copy of this message | ||
You had the words New With Warranty in your code, and it wasn't in quotes.
In fact your sprintf doesn't make much sense at all, since there are no %'s
in it.
The keyword "new" is used for instantiating objects, i.e.
$obj = new class();
If you're going to use strings, put them in quotes:
$str .= sprintf ("<OPTION VALUE=\"New With Warranty\">New With
Warranty\n",
"New_With_Warranty");
Although that still doesn't make much sense, since there are no %'s in the
format string. That statement could be rewritten as simply:
$str = "<OPTION VALUE=\"New With Warranty\">New With Warranty\n";
<carlfox@netdoor.com> wrote in message news:bug-13505@bugs.php.net...
> From: carlfox@netdoor.com
> Operating system:
> PHP version: 4.0.6
> PHP Bug Type: Compile Failure
> Bug description: The word "New" alone causes compilation to abort while
"New_" allows compile.
>
> ###########################################################
> # POP UP MENU SUB ROUTINE (Condition)
>
> function display_column_g ($label, $row, $col_name, $editable)
> {
> print ("<TR>\n");
> printf ("<TD><B><font
> color=\"red\">%s</font></B></TD>\n",
htmlspecialchars
> ($label));
> $value = htmlspecialchars ($row[$col_name]);
>
> if ($editable) # display as edit field
> {
>
> $str = sprintf ("<SELECT NAME=\"row[%s]\">",$col_name);
> $str .= sprintf ("<OPTION
> VALUE=\"$row[Condition]\">$row[Condition]\n",
> $row[Condition]);
> $str .= sprintf ("<OPTION VALUE=\"\">\n");
> $str .= sprintf ("<OPTION VALUE=\"New With Warranty\">New With
Warranty\n",
> New_With_Warranty);
> $str .= sprintf ("<OPTION VALUE=\"New\">New\n", New_);
> $str .= sprintf ("<OPTION VALUE=\"Unused With Warranty\">Unused With
> Warranty\n", Unused_With_Warranty);
> $str .= sprintf ("<OPTION VALUE=\"Unused\">Unused\n", Unused);
> $str .= sprintf ("<OPTION VALUE=\"Rebuilt With Warranty\">Rebuilt With
> Warranty\n", Rebuilt_With_Warranty);
> $str .= sprintf ("<OPTION VALUE=\"Rebuilt\">Rebuilt\n", Rebuilt);
> $str .= sprintf ("<OPTION VALUE=\"Used\">Used\n", Used);
> $str .= sprintf ("<OPTION VALUE=\"Running When Removed\">Running When
> Removed\n", Running_When_Removed);
> $str .= sprintf ("<OPTION VALUE=\"Scrap\">Scrap\n", Scrap);
> $str .= sprintf ("<OPTION VALUE=\"Salvage\">Salvage\n", Salvage);
>
> $str .= sprintf ("<OPTION VALUE=\"%s\"></SELECT>\n", $value);
>
> }
> else # display as read-only text
> $str = $value;
> printf ("<TD>%s</TD>\n", $str);
> print ("</TR>\n");
> }
>
>
>
###########################################################################
> # END POP UP MENU SUBROUTINES
>
###########################################################################
>
>
>
> --
> Edit bug report at: http://bugs.php.net/?id=13505&edit=1
>