note 77215 rejected from function.fopen by nlopess
| From: | nlopess@php.net | Date: | Sat, 01 Sep 2007 12:02:12 +0000 |
| Subject: | note 77215 rejected from function.fopen by nlopess | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-130005@lists.php.net to get a copy of this message | ||
Note Submitter: ericw at w3consultant dot net
----
Interesting:
Does anyone have any idea why var_dump and var_export would treat a file object differently, or why
it is not treated as an object?
$myfp = fopen("somevalidfile.txt","w");
echo "A var_dump: ";
var_dump($myfp);
echo "\nA var_export: " . var_export($myfp,true) . "\n";
if(is_object($myfp)) {
echo " IS OBJECT\n";
} else {
echo "NOT OBJECT\n";
}
This prints:
A var_dump: resource(17) of type (stream)
A var_export: NULL
NOT OBJECT