Skip to content

Instantly share code, notes, and snippets.

@jawngee
Created July 15, 2009 06:45
Show Gist options
  • Select an option

  • Save jawngee/147528 to your computer and use it in GitHub Desktop.

Select an option

Save jawngee/147528 to your computer and use it in GitHub Desktop.
<?
uses('system.app.dynamic_object');
$obj=new DynamicObject();
// dynamic properties
$obj->foo='bar';
$obj->boo='far';
// array access
echo $obj['foo']; // bar
echo $obj[1]; //boo
// iterate its properties
foreach($obj as $name => $value)
echo "$name = $value";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment