Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

closures assigned to V8Js object not callable #117

Closed
stesie opened this issue Oct 19, 2014 · 1 comment
Closed

closures assigned to V8Js object not callable #117

stesie opened this issue Oct 19, 2014 · 1 comment

Comments

@stesie
Copy link
Member

stesie commented Oct 19, 2014

<?php

$a = new V8Js();
$b = new V8Js();

$func = $a->func = function() {
  print("Hallo\n");
};

var_dump($func);
$func(); // callable as usual

var_dump($a->func);
$a->func(); // Call to undefined method V8Js::func()
@stesie stesie added the bug label Oct 19, 2014
@stesie stesie removed the bug label Dec 13, 2014
@stesie
Copy link
Member Author

stesie commented Dec 13, 2014

This isn't really a bug, since the code snippet from above doesn't work with stdClass instances likewise.

However we allow calling V8Function instances stored in V8Object properties like this, to be called as shown above. Hence we could implement that on the V8Js object for consistency with V8Object, but it's inconsistent with other PHP object then.

Since we intend to not have special "object export" code on the V8Js class (as per proposal in issue #72) this wouldn't even be possible in the long run.

Hence just closing this now.

@stesie stesie closed this as completed Dec 13, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant