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 -

Delphi 7 and decode UTF-8 base64 -

html - Is there any way to exclude a single element from the style? (Bootstrap) -