note 111806 added to language.operators.array
| From: | sd6733531 at gmail dot com | Date: | Sat, 30 Mar 2013 07:18:15 +0000 |
| Subject: | note 111806 added to language.operators.array | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-194273@lists.php.net to get a copy of this message | ||
Look out use + with array combine.
$arr = array(1, 2, 3);
$int=345;
$arr=$arr+$int;
Of couse,use + to combine array is easy and readable.
But if one of the variable is not array type(like above code) ,that would make a PHP Fatal Error:
PHP Fatal error: Unsupported operand types
Maybe should do check before.
----
Server IP: 69.147.83.199
Probable Submitter: 122.11.37.120
----
Manual Page -- http://php.net/manual/en/language.operators.array.php
Edit -- https://master.php.net/note/edit/111806
Del: integrated -- https://master.php.net/note/delete/111806/integrated
Del: useless -- https://master.php.net/note/delete/111806/useless
Del: bad code -- https://master.php.net/note/delete/111806/bad+code
Del: spam -- https://master.php.net/note/delete/111806/spam
Del: non-english -- https://master.php.net/note/delete/111806/non-english
Del: in docs -- https://master.php.net/note/delete/111806/in+docs
Del: other reasons-- https://master.php.net/note/delete/111806
Reject -- https://master.php.net/note/reject/111806
Search -- https://master.php.net/manage/user-notes.php