|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
[2015-12-08 11:48 UTC] salathe@php.net
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. PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Sat Oct 25 09:00:02 2025 UTC |
This requested was addressed, right? We are now using the syntax `{modifiers} {method_visibility} {(function/method)_name} ({list_arguments_with_type}) : {return_type}` Example: https://www.php.net/reflectionmethod.invokeargs