PHP code example of kenny1911 / typed-properties-helper

1. Go to this page and download the library: Download kenny1911/typed-properties-helper 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/ */

    

kenny1911 / typed-properties-helper example snippets


use function Kenny1911\TypedProperties\is_initialized;

$obj = new class {
    public int $init = 123;
    public int $notInit;
};

is_initialized($obj, 'init');       // True
is_initialized($obj, 'notInit');    // False

use function Kenny1911\TypedProperties\is_typed;

$obj = new class {
    public int $typed;
    public $notTyped;
};

is_typed($obj, 'typed');        // True
is_typed($obj, 'notTyped');     // False