Doc #81547 [Opn]: print documentation section Documentation is contradictory

From: Date: Wed, 03 Nov 2021 13:08:37 +0000
Subject: Doc #81547 [Opn]: print documentation section Documentation is contradictory
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-19305@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=81547&edit=1

 ID:                 81547
 Updated by:         cmb@php.net
 Reported by:        ddpm at liscovius dot de
 Summary:            print documentation section Documentation is
                     contradictory
 Status:             Open
 Type:               Documentation Problem
 Package:            Documentation problem
 PHP Version:        Irrelevant
 Block user comment: N
 Private report:     N

 New Comment:

To my knowledge, DocBook has no special support for language
constructs (except maybe for EBNF, but that's a different story);
this is why our existing documentation for language constructs[1]
is suboptimal.  For print, and other language constructs which are
somewhat function-like, it makes probably still sense to document
these as functions.  If we want to get rid of the parentheses in
the synopses, this could be accomplished by adding some attribute
and to adapt PhD[2] accordingly.  However, it is not clear what to
do with the return values, and whether it's worth working on this
at all.

[1] <https://www.php.net/manual/en/language.control-structures.php>
[2] <https://github.com/php/phd>


Previous Comments:
------------------------------------------------------------------------
[2021-10-20 19:03:34] ddpm at liscovius dot de

Description:
------------
Synopsis on https://www.php.net/manual/en/function.print.php
shows:

print(string $expression): int

But the description text says: 

"print is not a function but a language construct. Its argument is the expression following the
print keyword, and is not delimited by parentheses."

I see that the problem lies in the way the documentation is built. How should the synopsis be for
such **language construct**?

Expected result:
----------------
I do not know (yet).

Actual result:
--------------
print(string $expression): int


------------------------------------------------------------------------



--
Edit this bug report at https://bugs.php.net/bug.php?id=81547&edit=1


Thread (13 messages)

« previous php.doc.bugs (#19305) next »