PHP code example of conceptbyte / null-object

1. Go to this page and download the library: Download conceptbyte/null-object library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

conceptbyte / null-object example snippets


(string) NullObject::create()->xyz; // ""
(bool) NullObject::create()->abc(); // false
(int) no()->xyz; // 0
(float) no()->abc(); // 0.0