php object code example
Example 1: php empty object
$x = new stdClass();
Example 2: make a object php
$object = new stdClass();
$object->property = 'Here we go';
var_dump($object);
Example 3: php object
$person=new stdClass();
$person->firstName="Chuck";
$person->lastName="Bartowski";
$person->age=27;
print_r($person);
Example 4: object php
$object = (object) [
'propertyOne' => 'foo',
'propertyTwo' => 42,
];
Example 5: php object
$o= new \stdClass();
$o->a = 'new object';
OR
$o = (object) ['a' => 'new object'];
Example 6: php object
$obj = [
"example1" => 1,
"example2" => "two",
"example3" => [
"example4": true
]
]