Secrecy for objects in PHP? - Programmers Heaven

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!


Welcome to the new platform of Programmer's Heaven! We apologize for the inconvenience caused, if you visited us from a broken link of the previous version. The main reason to move to a new platform is to provide more effective and collaborative experience to you all. Please feel free to experience the new platform and use its exciting features. Contact us for any issue that you need to get clarified. We are more than happy to help you.

Secrecy for objects in PHP?

KyonKyon Posts: 113Member

Is there any secrecy concerning the attributes of objects in PHP? Coming from Java, I'm missing this principle for protecting the object-internal data against access from outside. Usually you should only be able to change the object's state by the methods it defines to change them. Otherwise this'd be no 'clean' OO-programming.

Any suggestions or comments?

-- planning is the substitution of hazard by error --


  • KyonKyon Posts: 113Member
    Hi again.

    I found out by myself by now. From the coming version PHP5 on there'll be such a thing as public, protected and private for methods & variables.


    -- planning is the substitution of hazard by error --

Sign In or Register to comment.