Zum Inhalt springen

Schlagwort: public

Die Modifiers in PHP – Teil 1

Damals – als wir noch mit PHP4 unterwegs waren – gab es keine Modifier. Alle Attribute und Methoden einer Klasse waren grundsätzlich public und man behalf sich mit Konstruktionen wie „Methoden, die mit Unterstrich anfangen, sind private“. Dies muss aber nicht sein und mit PHP 5 gibt es mehrer Modifier, die das Entwicklerherz höher schlagen lassen. Diese sind public, private, protected und abstract, final. Hier gibt es nun eine kleine Beitragsreihe, die die Modifier vorstellt und an Beispielen erklärt. Beginnen wir mit dem aus PHP4 übernommenen, dem public-Modifier.

By continuing to use the site, you agree to the use of cookies. more information

The cookie settings on this website are set to "allow cookies" to give you the best browsing experience possible. If you continue to use this website without changing your cookie settings or you click "Accept" below then you are consenting to this.

Close