Answers for "object object php"

PHP
4

make a object php

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

   var_dump($object);
   /*
   outputs:

   object(stdClass)#2 (1) {
      ["property"]=>
      string(10) "Here we go"
    }
   */
Posted by: Guest on May-04-2020
3

object php

//object init
  $object = (object) [
    'propertyOne' => 'foo',
    'propertyTwo' => 42,
  ];
Posted by: Guest on June-16-2020
-1

java php object

$a = array('foo' => 'bar');
$o = (object) $a;
var_dump($o instanceof stdClass); // bool(true)
var_dump($o->foo); // string(3) "bar"
Posted by: Guest on May-08-2020

Browse Popular Code Answers by Language