fork download
  1. <?php
  2.  
  3.  
  4. //1
  5. $obj = new stdClass();
  6. $obj->prop = 1;
  7.  
  8.  
  9. //2
  10. class A
  11. {
  12. public function __construct()
  13. {
  14. $this->prop = 2;
  15. }
  16. }
  17.  
  18.  
  19. var_dump($obj, new A);
Success #stdin #stdout 0.02s 24448KB
stdin
Standard input is empty
stdout
object(stdClass)#1 (1) {
  ["prop"]=>
  int(1)
}
object(A)#2 (1) {
  ["prop"]=>
  int(2)
}