HHVM extension, How to return class -


i declare method variant:

variant hhvm_method(myclass1, get) { object ob; ob.o_set(s_propertyname1, value1, s_myclass2 ); ob.o_set(s_propertyname1, value2, s_myclass2 ); return variant(ob); } 

php code:

$c = new myclass1(); var_dump($c->get()); // return stdclass 

how create , return myclass2:

var_dump($c->get()); // must return myclass2 

when creating object, need pass in pointer class object.

variant hhvm_method(myclass1, get) {     object ob{unit::loadclass(s_myclass2.get()};     ob.o_set(s_propertyname1, value1, s_myclass2 );     ob.o_set(s_propertyname1, value2, s_myclass2 );     return ob; } 

you can see being used in datetime::createfromformat


Comments

Popular posts from this blog

c# - Binding a comma separated list to a List<int> in asp.net web api -

how to prompt save As Box in Excel Interlop c# MVC 4 -

xslt 1.0 - How to access or retrieve mets content of an item from another item? -