note 126042 added to language.types.declarations
| From: | anisgazig at example dot com | Date: | Mon, 26 Apr 2021 18:20:37 +0000 |
| Subject: | note 126042 added to language.types.declarations | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-216328@lists.php.net to get a copy of this message | ||
same data type and same value but first function declare as a argument type declaration and return
int(7)
and second fucntion declare as a return type declaration but return int(8).
function argument_type_declaration(int $a, int $b){
return $a+$b;
}
var_dump(argument_type_declaration(3.5,4.7));
//output:int(7)
function return_type_declaration($a,$b) :int{
return $a+$b;
}
var_dump(return_type_declaration(3.5,4.7));
//output:int(8)
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 103.120.33.26)
----
Manual Page -- https://php.net/manual/en/language.types.declarations.php
Edit -- https://main.php.net/note/edit/126042
Del: integrated -- https://main.php.net/note/delete/126042/integrated
Del: useless -- https://main.php.net/note/delete/126042/useless
Del: bad code -- https://main.php.net/note/delete/126042/bad+code
Del: spam -- https://main.php.net/note/delete/126042/spam
Del: non-english -- https://main.php.net/note/delete/126042/non-english
Del: in docs -- https://main.php.net/note/delete/126042/in+docs
Del: other reasons-- https://main.php.net/note/delete/126042
Reject -- https://main.php.net/note/reject/126042
Search -- https://main.php.net/manage/user-notes.php