<?php

$obj = new stdClass();
$obj->p1 = "foo";
$obj->p2 = "bar";


echo $obj['p1'];