How to set new attribute in stdClass in laravel

I am creating a new stdClass Object and want to asign a array in a key. I am tying

    <?php
namespace App\Http\Controllers;

class TestController extends Controller{
    function test(){
        $dataObj = new \stdClass();
        $dataObj->setAttribute("open",[]);
        $dataObj->open=['name','age'];
        return $dataObj;
    }
}
?>

I want a object like

{
      'open':[
               'name',
               'age'
      ]
}