php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #79490 Replace nbsp; with plain spaces
Submitted: 2020-04-18 17:17 UTC Modified: -
From: kulakov74 at yandex dot ru Assigned:
Status: Open Package: Website problem
PHP Version: 7.4.5 OS: -
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: kulakov74 at yandex dot ru
New email:
PHP Version: OS:

 

 [2020-04-18 17:17 UTC] kulakov74 at yandex dot ru
Description:
------------
Hi.
I'm studying PHP with your online manual 
https://www.php.net/manual/en/language.generators.syntax.php#control-structures.yield
and it has an example "Example #1 A simple example of yielding values"; 
when I copied and pasted it in my test php script I got a lot of parse errors; I found out later that they were caused by the nbsp; character used in the example code instead of plain spaces. 
I recommend you not to use the nbsp character and use plain space instead, in order to ease with trying the examples in the manual. 
nbsp is not required for proper formatting, plain space is enough, provided that a monospace font is used. 

Test script:
---------------
function gen_one_to_three() {

Expected result:
----------------
1 2 3

Actual result:
--------------
Parse error: syntax error, unexpected 'for' (T_FOR)

Patches

Add a Patch

Pull Requests

Add a Pull Request

 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Thu Apr 22 17:01:24 2021 UTC