object class in php code example
Example 1: php stdclass
//create a person object in PHP
$person=new stdClass();
$person->firstName="Chuck";
$person->lastName="Bartowski";
$person->age=27;
print_r($person);
Example 2: object php
//object init
$object = (object) [
'propertyOne' => 'foo',
'propertyTwo' => 42,
];
Example 3: php define object
$x = new stdClass();
Example 4: php object
$obj = [
"example1" => 1,
"example2" => "two",
"example3" => [
"example4": true
]
]