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