note 125780 added to language.types.type-juggling
| From: | Anonymous@php.net | Date: | Fri, 05 Feb 2021 13:07:02 +0000 |
| Subject: | note 125780 added to language.types.type-juggling | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-219233@lists.php.net to get a copy of this message | ||
Cast operators have a very high precedence, for example (int)$a/$b is evaluated as ((int)$a)/$b, not
as (int)($a/$b) [which would be like intdiv($a,$b) if both $a and $b are integers].
The only exceptions (as of PHP 8.0) are the exponentiation operator ** [i.e. (int)$a**$b is
evaluated as (int)($a**$b) rather than ((int)$a)**$b] and the special access/invocation operators
->, ::, [] and () [i.e. in each of (int)$a->$b, (int)$a::$b, (int)$a[$b] and (int)$a($b), the
cast is performed last on the result of the variable expression].
----
Server IP: 45.112.84.4
Probable Submitter: 45.91.159.166 (proxied: 82.123.12.229)
----
Manual Page -- http://php.net/manual/en/language.types.type-juggling.php
Edit -- https://master.php.net/note/edit/125780
Del: integrated -- https://master.php.net/note/delete/125780/integrated
Del: useless -- https://master.php.net/note/delete/125780/useless
Del: bad code -- https://master.php.net/note/delete/125780/bad+code
Del: spam -- https://master.php.net/note/delete/125780/spam
Del: non-english -- https://master.php.net/note/delete/125780/non-english
Del: in docs -- https://master.php.net/note/delete/125780/in+docs
Del: other reasons-- https://master.php.net/note/delete/125780
Reject -- https://master.php.net/note/reject/125780
Search -- https://master.php.net/manage/user-notes.php