dev-master
9999999-dev https://github.com/Ocramius/OptionalA port of java.util.Optional to PHP
GPL-2.0
The Requires
- php ~5.5
The Development Requires
optional java
Wallogit.com
2017 © Pedro PelĂĄez
A port of java.util.Optional to PHP
ocramius\util\OptionalThis package is a PHP port of the java.util.Optional class in the
OpenJDK libraries., (*2)
Currently maintained by Niklas Schöllhorn, taken over 3rd March, 2019, (*3)
You can find the API of java.lang.Optional in the
Java 8 API docs., (*4)
composer require ocramius/optional
Because of PHP's current limitations, I had to rewrite some bits of the Java implementation as follows:, (*5)
Optional#empty() is named Optional#newEmpty(), because empty is a reserved PHP keywordOptional implementation.
This may change in future, but I don't plan to do it right now.Optional#toString() is named Optional#__toString() in accordance to
PHP magic methods naming
Consumer, Predicate, Function and Supplier arguments are simply callable, for simplicity and flexibility.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., (*6)
A port of java.util.Optional to PHP
GPL-2.0
optional java