PHP code example of smuuf / strict-object

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

    

smuuf / strict-object example snippets




use \Smuuf\StrictObject;

ject;

	public $someProperty;

}

$obj = new Whatever;

$obj->someProperty = 1; // Ok.
echo $obj->someProperty; // Ok.

// But - and hold on to your hats...

$obj->bogusProperty = 1; // Throws \LogicException.
echo $obj->bogusProperty; // Throws \LogicException.