Howdy, Stranger!

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


Secrecy for objects in PHP?

KyonKyon Member Posts: 113

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

  • Andre YoungAndre Young USAMember Posts: 0

    ___ ( ) free video tutorials and ebooks about ( JavaScript, PHP, R, C#, Assembly, Visual Basic, MATLAB, Delphi, C++, Ruby, C, Go, Python, Visual Basic .NET, Swift, Scratch, Java, Objective-C, PL/SQL, Perl SAS, Hack, Alice, Clojure, LabVIEW, FoxPro, Bash, Awk, Scala, Fortran, D, Julia, Apex, VBScript, Dart, Logo, F#, COBOL, Erlang, ML, Kotlin, Rust, Crystal, ABAP, Prolog, Lua, Transact-SQL, Lisp, Scheme, Ada ) ____________

Sign In or Register to comment.