PHP-to-Javascript icon indicating copy to clipboard operation
PHP-to-Javascript copied to clipboard

multiple implementing not working

Open tito10047 opened this issue 7 years ago • 1 comments

interface Int1{}
interface Int2{}
class Foo implements Int1,Int2{}
$foo = new Foo();
$foo instanceof Int1;//this is false

tito10047 avatar Jul 08 '17 09:07 tito10047

This is not possible to do in javascript. So I need convert to like this

function Int1(){}
function Int2(){}
function Foo(){}
var __IMPLEMENTED_INTERFACES__={};
__IMPLEMENTED_INTERFACES__["<md5 from php file path>"+Foo.class]=[Int1,Int2];
var foo = new Foo();
__instanceof(foo,Int1)

tito10047 avatar Jul 09 '17 11:07 tito10047