Answers for "defining object in php"

PHP
4

php define object

$x = new stdClass();
Posted by: Guest on February-19-2020
1

php object

$o= new \stdClass();
$o->a = 'new object';

OR

$o = (object) ['a' => 'new object'];
Posted by: Guest on November-20-2020

Browse Popular Code Answers by Language