php-PhpOption - Option type for PHP

Distribution: CentOS 5
Repository: Les RPM de Remi i386
Package name: php-PhpOption
Package version: 1.4.0
Package release: 1.el5.remi
Package architecture: noarch
Package type: rpm
Installed size: 33.37 KB
Download size: 13.39 KB
Official Mirror:
This package adds an Option type for PHP. The Option type is intended for cases where you sometimes might return a value (typically an object), and sometimes you might return no value (typically null) depending on arguments, or other runtime factors. Often times, you forget to handle the case where no value is returned. Not intentionally of course, but maybe you did not account for all possible states of the system; or maybe you indeed covered all cases, then time goes on, code is refactored, some of these your checks might become invalid, or incomplete. Suddenly, without noticing, the no value case is not handled anymore. As a result, you might sometimes get fatal PHP errors telling you that you called a method on a non-object; users might see blank pages, or worse. On one hand, the Option type forces a developer to consciously think about both cases (returning a value, or returning no value). That in itself will already make your code more robust. On the other hand, the Option type also allows the API developer to provide more concise API methods, and empowers the API user in how he consumes these methods.


  • php-PhpOption = 1.4.0-1.el5.remi


    Source package: php-PhpOption-1.4.0-1.el5.remi.src.rpm

    Install Howto

    1. Download the latest remi-release rpm from
    2. Install remi-release rpm:
      # rpm -Uvh remi-release*rpm
    3. Install php-PhpOption rpm package:
      # yum --enablerepo=remi install php-PhpOption


    • /usr/share/doc/php-PhpOption-1.4.0/LICENSE
    • /usr/share/doc/php-PhpOption-1.4.0/
    • /usr/share/doc/php-PhpOption-1.4.0/composer.json
    • /usr/share/php/PhpOption/LazyOption.php
    • /usr/share/php/PhpOption/None.php
    • /usr/share/php/PhpOption/Option.php
    • /usr/share/php/PhpOption/Some.php


    2014-02-17 - Remi Collet <> 1.4.0-1 - backport 1.4.0 for remi repo

    2014-02-12 - Shawn Iwinski <> 1.4.0-1 - Updated to 1.4.0 (BZ #1055299)

    2013-09-29 - Remi Collet <> 1.3.0-1 - backport 1.3.0 for remi repo

    2013-09-28 - Shawn Iwinski <> 1.3.0-1 - Updated to 1.3.0 - Other minor updates

    2013-04-02 - Remi Collet <> 1.2.0-1 - backport 1.2.0 for remi repo

    2013-03-30 - Shawn Iwinski <> 1.2.0-1 - Updated to version 1.2.0 - Removed tests sub-package

    2013-01-25 - Remi Collet <> 1.1.0-1 - backport 1.1.0 for remi repo

    2013-01-22 - Shawn Iwinski <> 1.1.0-1 - Initial package