php Objects code example
Example 1: php is object
is_object($var)
Example 2: php create object
$x = (object) [
'a' => 'test',
'b' => 'test2',
'c' => 'test3'
];
var_dump($x);
Example 3: php stdclass
$person=new stdClass();
$person->firstName="Chuck";
$person->lastName="Bartowski";
$person->age=27;
print_r($person);
Example 4: make a object php
$object = new stdClass();
$object->property = 'Here we go';
var_dump($object);
Example 5: object php
$object = (object) [
'propertyOne' => 'foo',
'propertyTwo' => 42,
];
Example 6: php define object
$x = new stdClass();