php define object
snippet in php

make a object php

user7346

   $object = new stdClass();
   $object->property = 'Here we go';

   var_dump($object);
   /*
   outputs:

   object(stdClass)#2 (1) {
      ["property"]=>
      string(10) "Here we go"
    }
   */

object php

user9680

//object init
  $object = (object) [
    'propertyOne' => 'foo',
    'propertyTwo' => 42,
  ];

php define object

user816

$x = new stdClass();