Wrapping primitive types into objects automatically

v1.0.0-BETA2 2014-02-14 15:05 UTC


An implementation of the experimental PHP extension SPL Types.


PHP 5.3.3 or above (at least 5.3.4 recommended to avoid potential bugs)


Using Composer, just add the following configuration to your composer.json:

    "require": {
        "instinct/types-autoboxing": "1.0.*"

If you don't have Composer yet, download it following the instructions on or just run the following command:

curl -sS | php

Now tell composer to download it by running the command:

php composer.phar update instinct/types-autoboxing


Bool::create($var); // Defined a new boolean type
$var = true;       // Assign it a new value
if ($var instanceof Bool) {
    // $var is always a Bool object


Fork the project, create a feature branch, and send us a pull request.

To ensure a consistent code base, you should make sure the code follows the Coding Standards which we borrowed from Symfony.

If you would like to help take a look at the list of issues.


See the list of contributors who participated in this project.


This library is licensed under the MIT License - see the LICENSE file for details

Running Tests

You can run the unit tests with the following command:

php composer.phar install --dev