php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #50097 The code on your first page didn't work
Submitted: 2009-11-06 01:49 UTC Modified: 2009-11-07 03:13 UTC
From: farfallabill at isp dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 5.3.1RC3 OS: XP
Private report: No CVE-ID: None
 [2009-11-06 01:49 UTC] farfallabill at isp dot com
Description:
------------
I swept my mouse over your code on the "your first" page, went Ctrl C and Ctrl Ved it into a text file that I changed the txt to php on, sent it to my public html directory at WebHostingPad.com, then typed in "http://www.bliss-fire.com/Experiments.php" into my Firefox 3.5.2 and I got back:

Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/sle97ncr/public_html/Experiments.php on line 6

(I'm damned if I know what version of PHP they have. I selected the first one because you would let me select "I dunno".)



Reproduce code:
---------------
---
From manual page: tutorial.firstpage
---
<html>
 <head>
  <title>PHP Test</title>
 </head>
 <body>
 <?php echo '<p>Hello World</p>'; ?> 
 </body>
</html>

Expected result:
----------------
Hello World

Actual result:
--------------
Parse error: syntax error, unexpected T_STRING, expecting ',' or ';' in /home/sle97ncr/public_html/Experiments.php on line 6


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2009-11-06 01:52 UTC] rasmus@php.net
Your copy-and-paste did something weird then.  That code is fine and copying and pasting it from this bug report works fine.
 [2009-11-06 10:15 UTC] rquadling@php.net
Can you rename the .php file as .txt, so we can see EXACTLY what you've 
got please?
 [2009-11-06 15:19 UTC] danbrown@php.net
Checking the link shows that the reporter's page is (at least now) working as expected, so this bug truly is bogus.

Further, it is noted that this:

    (I'm damned if I know what version of PHP they have. I selected the first one because you would let me select "I dunno".)

.... causes an error in our spell checker:

    Operator error: between chair and keyboard, undefined word "dunno", expecting "don't know" or "am not sure" in paragraph 3.
 [2009-11-07 03:13 UTC] farfallabill at isp dot com
I discovered that, unlike with a .htm file, when you open a .php file that you have created by originally typing out a txt file and saving and closing it and then changing the file extension from txt to php in Windows Explorer, you cannot open it in Notepad and alter it and save it again directly out of Notepad as long as the extension is still php. Instead, you must first change the extension back to txt before opening it, then save it again as a txt file and then change it back again to php in W.E.

I typed out an error in my original file, and I kept thinking I had saved a new one when I actually hadn't, and I kept unknowingly uploading it again and again to my website directory. Copying what you had on your webpage and copying it directly into my php displayed in Notebook was my last desperate act.

When I finally corrected it again by the method I described, the file worked as advertised.

(If you read American comic books, you learn that "I dunno" is an attempt to spell phonetically the way a lot of people say "I don't know".)
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Mar 29 01:01:28 2024 UTC