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

Inaccessible accessors go through __call #9

Closed
nikic opened this issue Dec 29, 2012 · 1 comment
Closed

Inaccessible accessors go through __call #9

nikic opened this issue Dec 29, 2012 · 1 comment

Comments

@nikic
Copy link
Collaborator

nikic commented Dec 29, 2012

When an accessor is not accessible from the current scope (due to visibility constraints) currently __call('__get[Name], [])` is called:

<?php

class A {
    protected $foo {
        get { return 'protected::$foo'; }
    }

    public function __call($name, $args) {
        return 'public::' . $name;
    }
}

$a = new A;
var_dump($a->foo);

This produces the output:

 string(16) "public::__getfoo"

This happens because the accessors are fetched from the function table using the normal std_get_method handler.

@cpriest
Copy link
Owner

cpriest commented Jan 3, 2013

Current fork now produces this error (since accessor_info inclusion into property_info):
Fatal error: Cannot access protected property A::$foo in ... on line 15

Safe to close?

@cpriest cpriest closed this as completed Jan 5, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants