Secrecy for objects in PHP?

Hi.

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?
Cheers,
Kyon

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

Comments

  • 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.

    Cheers,
    Kyon

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

Sign In or Register to comment.

Howdy, Stranger!

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

Categories

In this Discussion