Doc #77779 [Opn->Nab]: incorrect syntax

From: Date: Thu, 21 Mar 2019 19:09:05 +0000
Subject: Doc #77779 [Opn->Nab]: incorrect syntax
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-16501@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=77779&edit=1 ID: 77779 Updated by: salathe@php.net Reported by: ulrich dot geiss at arcor dot de Summary: incorrect syntax -Status: Open +Status: Not a bug Type: Documentation Problem Package: Documentation problem PHP Version: Irrelevant Block user comment: N Private report: N New Comment: The prototypes shown in the descriptions are not supposed to be valid PHP code. How to interpret them is detailed in "How to read a function definition" [1] section of the manual. [1] http://php.net/manual/en/about.prototypes.php P.S. That page was slightly up to date, with regards to how we show return types. The update page should be available online soon. Previous Comments: ------------------------------------------------------------------------ [2019-03-21 18:55:52] ulrich dot geiss at arcor dot de Description: ------------ Hello, on page http://php.net/manual/en/function.echo.php the syntax line "echo ( string $arg1 [, string $... ] ) : void" is incorrect. As stated later echo is NOT a function. If used with "(", a comma-separated argument list and ")", echo will fail (error message: [Thu Mar 21 18:41:34.397179 2019] [php7:emerg] [pid 5218] [client 192.168.0.33:62292] PHP Parse error: syntax error, unexpected ',' in /var/www/html/album/now.php on line 9). Please change the syntax-line to "echo string $arg1 [, string $... ]". It took me some hours to find out the reason for the errors and to correct my php-scripts. Thanks in advance with kind regards U. Geiß Test script: --------------- <!DOCTYPE html> <html> <head> <title>Server clock</title> </head> <body> <?php echo 'The server says: My clock shows "' , date( 'c' ) , '"' ; // correct syntax echo( 'The server says: My clock shows "' , date( 'c' ) , '"' ) ; // syntax as shown on http://php.net/manual/en/function.echo.php ?> </body> </html> Expected result: ---------------- The server says: My clock shows "2019-03-21T18:46:25+00:00" Actual result: --------------  HTTP 500 error That’s odd... the website can’t display this page The site may be under maintenance or could have a programming error. Try this Go back to the last page Try contacting the website’s owner Report this issue Privacy statement ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=77779&edit=1

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