Download the PHP package ocramius/optional without Composer
On this page you can find all versions of the php package ocramius/optional. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Table of contents
Download ocramius/optional
More information about ocramius/optional
Files in ocramius/optional
Download ocramius/optional
More information about ocramius/optional
Files in ocramius/optional
Vendor ocramius
Package optional
Short Description A port of java.util.Optional to PHP
License GPL-2.0
Homepage https://github.com/Ocramius/Optional
Package optional
Short Description A port of java.util.Optional to PHP
License GPL-2.0
Homepage https://github.com/Ocramius/Optional
Please rate this library. Is it a good library?
Informations about the package optional
ocramius\util\Optional
This package is a PHP port of the java.util.Optional
class in the
OpenJDK libraries.
Currently maintained by Niklas Schöllhorn, taken over 3rd March, 2019
You can find the API of java.lang.Optional
in the
Java 8 API docs.
Installation
Differences with the Java implementation
Because of PHP's current limitations, I had to rewrite some bits of the Java implementation as follows:
Optional#empty()
is namedOptional#newEmpty()
, becauseempty
is a reserved PHP keyword- type-safety is not ensured at any time: generics have simply been stripped from the
Optional
implementation. This may change in future, but I don't plan to do it right now. Optional#toString()
is namedOptional#__toString()
in accordance to PHP magic methods namingConsumer
,Predicate
,Function
andSupplier
arguments are simplycallable
, for simplicity and flexibility.
License
Since this library is a direct port of the OpenJDK sources, I have to keep the original license in place, which is GPLv2 + ClassPath exceptions.
All versions of optional with dependencies
PHP Build Version
Package Version
Requires
php Version
^7.3
The package ocramius/optional contains the following files
Loading the files please wait ....