php oops programs code example Example: php object $o= new \stdClass(); $o->a = 'new object'; OR $o = (object) ['a' => 'new object'];