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

Access public - Methods in child class #183

Closed
kinimodmeyer opened this issue Dec 4, 2015 · 1 comment
Closed

Access public - Methods in child class #183

kinimodmeyer opened this issue Dec 4, 2015 · 1 comment
Assignees
Labels

Comments

@kinimodmeyer
Copy link

hello guys,
i created a child class to add more functionality to V8Js (dont know if this is right).

class test extends V8Js
{
    public function hello()
    {
        die('hello world');
    }
}

now i want to access this method in my js code with

PHP.hello();

but i just get the following error:

TypeError: undefined is not a function

with properties it works like expected:

class test extends V8Js
{
    public $hello = 'hello world';
}
PHP.hello;

i hope you can help me with this.

@stesie stesie added the bug label Dec 4, 2015
@stesie stesie self-assigned this Dec 4, 2015
@stesie
Copy link
Member

stesie commented Jan 7, 2016

TODOs for PHP 5.x

  • implement method export in V8Js::__construct without any PHP magic functions
  • test private & protected methods must not be exported
  • neither may methods from the base object be available
  • __sleep and __wakeup must not be overridable (PHP side) and never be exported

I consider __get, __set, __call, __invoke et al beyond the scope of this ticket, and actually tend to not implement them. All that stuff already works with normal object export and probably will be pretty easy once #72 lands finally (in V8Js 2.0.0 or so).

stesie pushed a commit to stesie/v8js that referenced this issue Jan 7, 2016
stesie pushed a commit to stesie/v8js that referenced this issue Jan 8, 2016
stesie pushed a commit to stesie/v8js that referenced this issue Jan 8, 2016
@stesie stesie closed this as completed Jan 10, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants