File::__isset()
Checks if a method returns non-null value.
Table of Contents
Description
File::__isset(string $key): bool;You won’t use this method directly, it will be executed automatically when you try to check the existence of a method or property using empty() or isset() language construct. In normal situations, this method doesn’t really need to exist because empty() and isset() can directly check the existence of a property in an object. But as this class also has a feature to invoke methods via property call syntax, then this method becomes useful when what is being checked is not a property value but is the return value of an invoked method.
Example
In the example below, isset() doesn’t check for the existence of name property because this property doesn’t exist in the File class instance. Instead, isset() checks if method File::name() returns a non-null value. That’s why this method returns true even though name property doesn’t actually exist.
$file = new File('.\path\to\file.txt');
test(isset($file->name)); // Returns `true`File::URL()
Converts private file path to public URL.
File::_()
The dynamic method initiator.
File::__call()
Proxy for missing methods.
File::__callStatic()
Proxy for missing static methods.
File::__construct()
The constructor.
File::__get()
Proxy for missing properties.
File::__isset()
Checks if a method returns non-null value.
File::__serialize()
Provides data to be serialized.
File::__toString()
Proxy for the current object, casted as a string.
File::__unserialize()
Converts the serialized data back to its object.
File::_seal()
Gets the file permissions as numeric mode.
File::_size()
Gets the file sizes in bytes.
File::content()
Gets the file content.
File::count()
Counts number of lines in the file content.
File::exist()
Checks if the file exists.
File::from()
Object instantiator.
File::getIterator()
The external iterator receiver.
File::jsonSerialize()
Returns the data to be serialized as JSON.
File::name()
Gets the file name.
File::offsetExists()
Checks if a line at a specified index exists in the file.
File::offsetGet()
Gets a line at a specified index in the file.
File::parent()
Gets the file’s parent folder.
File::route()
Returns the file’s relative path.
File::seal()
Gets the file permissions as an octal value.
File::size()
Gets the file sizes in human readable string format.
File::stream()
Streams the file content chunk by chunk.
File::time()
Gets the file creation time.
File::type()
Gets the file MIME type.
File::x()
Gets the file extension.