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

Checks for odd class declarations #19

Closed
cpriest opened this issue Dec 30, 2012 · 3 comments
Closed

Checks for odd class declarations #19

cpriest opened this issue Dec 30, 2012 · 3 comments
Labels

Comments

@cpriest
Copy link
Owner

cpriest commented Dec 30, 2012

There are some cases which are not presently checked for which could lead to some odd class declarations, I'm opening this issue as a point of discussion to decide what to do:

class TimePeriod {
    private $Hours = 5;

    public $Hours {
        get { return 1; }
    }   
}

$o = new TimePeriod();
echo $o->Hours;    // Prints 1

Here we have defined a property and a property accessor of the same name, in v1.2 the accessor will shadow the property so this isn't a problem per say, but should we allow it or should it throw a compile error?

Also see Issue #10

@nikic
Copy link
Collaborator

nikic commented Dec 30, 2012

I think this one should be a compile error. (This will probably be automatically solved when propery_info and accessor_info are merged.)

@cpriest
Copy link
Owner Author

cpriest commented Dec 30, 2012

I would agree

@cpriest
Copy link
Owner Author

cpriest commented Jan 2, 2013

This has been fixed by b04e5b0

@cpriest cpriest closed this as completed Jan 2, 2013
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