php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Doc Bug #73227 Doccumentation unclarity.
Submitted: 2016-10-02 11:04 UTC Modified: 2016-11-28 18:27 UTC
From: mev5me at yandex dot ru Assigned:
Status: Not a bug Package: Documentation problem
PHP Version: 7.1.0RC3 OS: Ubuntu
Private report: No CVE-ID: None
 [2016-10-02 11:04 UTC] mev5me at yandex dot ru
Description:
------------
May be my English is not perfect, but `http://php.net/manual/en/functions.user-defined.php` says: "Functions need not be defined before they are referenced". And than *Example #2* example shows how function being used BEFORE define (`bar()`). Isn't in weird or unclear? 


`function myF () {...}` - is it defining?

`myF();` - is it reference?


Nowhere says it is possible, because interpreter reads .php files first and than execute.

PHP 7 documentation is missing too.  



Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2016-11-02 13:35 UTC] carteeg at gmail dot com
The documentation is correct.

The phrase "need not" means "do not need to".

So "Functions need not be defined before they are referenced." means "Functions do not need to be defined before they are referenced."

Example 2 is showing this explicitly by having the reference occur before the definition.
 [2016-11-28 18:27 UTC] peehaa@php.net
-Status: Open +Status: Not a bug
 [2016-11-28 18:27 UTC] peehaa@php.net
Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.


 
PHP Copyright © 2001-2020 The PHP Group
All rights reserved.
Last updated: Mon Sep 28 13:01:23 2020 UTC