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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2020 The PHP Group
All rights reserved.
Last updated: Mon Oct 26 05:01:24 2020 UTC