Req #71058 [NEW]: Function prototypes reflecting parameter/return type declarations

From: Date: Tue, 08 Dec 2015 11:48:07 +0000
Subject: Req #71058 [NEW]: Function prototypes reflecting parameter/return type declarations
Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-12913@lists.php.net to get a copy of this message
From: salathe@php.net Operating system: PHP version: 7.0.0 Package: Documentation problem Bug Type: Feature/Change Request Bug description:Function prototypes reflecting parameter/return type declarations Description: ------------ Given that PHP 7 introduced return type declarations and scalar parameter declarations, there is a conflict between the function prototypes used in the manual and the prototypes used in code. This has already caused some confusion (e.g. bug #71051 where someone tried to override a method using the "type suggestion" from the documentation). This request is in two parts (which may become separate requests at some point): 1. Discuss and decide how to approach the issue of the manual stating that an argument should be of a certain type, but is not really part of the function signature. The suggestion here is to have clearly marked prototypes stating whether the type declarations are "suggestions" as they have historically been, or actual declarations. 2. Consider altering the function prototype to move the return type declaration to the end, in order to match PHP syntax. This does not come without issues; such as our "mixed" pseudo-type. -- Edit bug report at https://bugs.php.net/bug.php?id=71058&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=71058&r=trysnapshot54 Try a snapshot (PHP 5.5): https://bugs.php.net/fix.php?id=71058&r=trysnapshot55 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=71058&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=71058&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=71058&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=71058&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=71058&r=needscript Try newer version: https://bugs.php.net/fix.php?id=71058&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=71058&r=support Expected behavior: https://bugs.php.net/fix.php?id=71058&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=71058&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=71058&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=71058&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=71058&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=71058&r=dst IIS Stability: https://bugs.php.net/fix.php?id=71058&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=71058&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=71058&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=71058&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=71058&r=mysqlcfg

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