All pastes #898260 Raw Edit

jm

public text v1 · immutable
·published 2008-02-10 05:12 UTC
rendered paste body
<?php
$foo = new Person(array(
	'name' => 'Joe',
	'age' => 03,
));
class Person
{
	public $name, $age;

	public function __construct($info)
	{
		foreach ($info as $key => $value) {
			$this->$key = $value;
		}
		$this->display();
	}
	public function display()
	{
		echo '<pre>';
			echo $this->name."\n";
			echo $this->age."\n";
		echo '</pre>';
	}
}
?>