php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #72097 Documentation example is incorrect
Submitted: 2016-04-24 19:45 UTC Modified: 2016-04-24 20:21 UTC
From: toni dot pejic98 at gmail dot com Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: Irrelevant OS:
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: toni dot pejic98 at gmail dot com
New email:
PHP Version: OS:

 

 [2016-04-24 19:45 UTC] toni dot pejic98 at gmail dot com
Description:
------------
---
From manual page: http://si1.php.net/manual/en/tutorial.firstpage.php
---

You used ' instead of " for echo command.

Test script:
---------------
<html>
 <head>
  <title>PHP Test</title>
 </head>
 <body>
 <?php echo '<p>Hello World</p>'; ?> 
 </body>
</html>

Expected result:
----------------
<br />
<b>Parse error</b>:  syntax error, unexpected 'm' (T_STRING), expecting ',' or ';' in <b>/home/u114930943/public_html/index.php</b> on line <b>9</b><br />


Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-04-24 20:14 UTC] requinix@php.net
-Status: Open +Status: Feedback
 [2016-04-24 20:14 UTC] requinix@php.net
Single quotes for strings are fine.
http://php.net/manual/en/language.types.string.php

Are you looking at the English version of the page? Which language?
 [2016-04-24 20:20 UTC] toni dot pejic98 at gmail dot com
-Status: Feedback +Status: Closed
 [2016-04-24 20:20 UTC] toni dot pejic98 at gmail dot com
Nvm , I made a mistake.
 [2016-04-24 20:21 UTC] requinix@php.net
-Status: Closed +Status: Not a bug
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Thu Jul 03 10:01:33 2025 UTC