Skip to content

Instantly share code, notes, and snippets.

@ukstudio
Created February 17, 2010 02:05
Show Gist options
  • Select an option

  • Save ukstudio/306206 to your computer and use it in GitHub Desktop.

Select an option

Save ukstudio/306206 to your computer and use it in GitHub Desktop.
<?php
class Entry {
private $title;
private $body;
private $posted_at;
private $author;
public function __set($key, $value) {
$this->$key = $value;
}
public function __get($key) {
return $this->$key;
}
}
$entry = new Entry();
$entry->title = 'title';
echo $entry->title;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment