php-class-options.phps

<?php

class Test
{
	public $option1;
	public $option2;
	public $option3;

	public function __construct($options = array())
	{
		$this->option1 = (array_key_exists('option1', $options)) ? $options['option1'] : null;
		$this->option2 = (array_key_exists('option2', $options)) ? $options['option2'] : null;
		$this->option3 = (array_key_exists('option3', $options)) ? $options['option3'] : null;
	}
}