Download the PHP package ehough/speedreader without Composer
On this page you can find all versions of the php package ehough/speedreader. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download ehough/speedreader
More information about ehough/speedreader
Files in ehough/speedreader
Package speedreader
Short Description Nested-property accessor with an emphasis on performance
License MPL-2.0
Homepage https://github.com/ehough/speedreader
Informations about the package speedreader
SpeedReader 
Nested-property selector for PHP 5.3+ with a focus on performance.
SpeedReader allows you to use dot notation (a subset of JMESPath expressions and subexpressions) to quickly read values from arrays, \ArrayAccess instances, objects, or any combination thereof. You can provide a fallback value to use if the property does not exist or cannot be casted to the desired type.
Installation
Install the latest version with
Basic Usage
SpeedReader can read from any mix of arrays, \ArrayAccess instances, and objects.
SpeedReader::getAsInteger()
Gets the value, casted to integer, at the given path. If no fallback is supplied, 0
will be returned.
SpeedReader::getAsString()
Gets the value, casted to string, at the given path. If no fallback is supplied, an empty string will be returned.
SpeedReader::getAsFloat()
Gets the value, casted to float, at the given path. If no fallback is supplied, 0.0
will be returned.
SpeedReader::getAsBoolean()
Gets the value, casted to boolean, at the given path. If no fallback is supplied, false
will be returned.
SpeedReader::getAsArray()
Gets the value, casted to array, at the given path. If no fallback is supplied, an empty array will be returned.
SpeedReader::get()
Gets the value at the given path. If no fallback is supplied, null
will be returned.
SpeedReader::has()
Determines if the subject contains a value (including null
) at the given path.
About
Requirements
SpeedReader works with PHP 5.3 and above.
License
SpeedReader is licensed under the Mozilla Public License 2.0. See the LICENSE
file for details.