note 74433 added to language.operators.logical
| From: | phpatfernandobittencourtdotcom at osu1 dot php dot net | Date: | Wed, 11 Apr 2007 13:44:28 +0000 |
| Subject: | note 74433 added to language.operators.logical | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-125292@lists.php.net to get a copy of this message | ||
This another example can clarify the difference between the operators:
<?php
$contents = @file_get_contents($file) || implode("", file($file));
var_dump($contents); // returns a boolean
$contents = @file_get_contents($file) or implode("", file($file));
var_dump($contents); // returns the file contents
?>
----
Server IP: 200.185.126.110
Probable Submitter: 200.213.46.39 (proxied: 192.168.1.97)
----
Manual Page -- http://www.php.net/manual/en/language.operators.logical.php
Edit -- https://master.php.net/note/edit/74433
Del: integrated -- https://master.php.net/note/delete/74433/integrated
Del: useless -- https://master.php.net/note/delete/74433/useless
Del: bad code -- https://master.php.net/note/delete/74433/bad+code
Del: spam -- https://master.php.net/note/delete/74433/spam
Del: non-english -- https://master.php.net/note/delete/74433/non-english
Del: in docs -- https://master.php.net/note/delete/74433/in+docs
Del: other reasons-- https://master.php.net/note/delete/74433
Reject -- https://master.php.net/note/reject/74433
Search -- https://master.php.net/manage/user-notes.php