PHP code example of withinboredom / null-cast

1. Go to this page and download the library: Download withinboredom/null-cast 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/ */

    

withinboredom / null-cast example snippets


use function Withinboredom\NullCast\boolval;
use function Withinboredom\NullCast\floatval;
use function Withinboredom\NullCast\intval;
use function Withinboredom\NullCast\stringval;

boolval('true') === true;
boolval(null) === null;

floatval('12.34') === 12.34;
floatval(null) === null;

intval(true) === 1;
intval(null) === null;

stringval(123) === '123';
stringval(null) === null;