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!

Categories

Secrecy for objects in PHP?

KyonKyon Posts: 113Member
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

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

    Cheers,
    Kyon

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

Sign In or Register to comment.