PHP: parent - Manual in Deutsh
PHP: parent - Manual in French
PHP: parent - Manual in Polish

You Are At PHP: parent - Manual Area


recent searches:
include functions , variable functions , post functions...




If you are new to PHP or just need to refresh your skills, this is the place to start. This series of tutorials will give you the basic knowledge you will need to create a simple PHP website.

PHP is a reflective programming language originally designed for producing dynamic web pages.[1] PHP is used mainly in server-side scripting, but can be used from a command line interface or in standalone graphical applications. Textual User Interfaces can also be created using ncurses.

PHP Manual
PrevChapter 18. Classes and Objects (PHP 4)Next

parent

You may find yourself writing code that refers to variables and functions in base classes. This is particularly true if your derived class is a refinement or specialisation of code in your base class.

Instead of using the literal name of the base class in your code, you should be using the special name parent, which refers to the name of your base class as given in the extends declaration of your class. By doing this, you avoid using the name of your base class in more than one place. Should your inheritance tree change during implementation, the change is easily made by simply changing the extends declaration of your class.

<?php
class A {
    function
example() {
        echo
"I am A::example() and provide basic functionality.<br />\n";
    }
}

class
B extends A {
    function
example() {
        echo
"I am B::example() and provide additional functionality.<br />\n";
        
parent::example();
    }
}

$b = new B;

// This will call B::example(), which will in turn call A::example().
$b->example();
?>

Grzejniki
Wycieraczki
kredyt hipoteczny doradca finansowy wrocław
kredyt banki
Koszulki

Another Useful functions:


runkit.sandbox-parent | keyword.parent | function.tidynode-getparent | function.parentiterator-rewind | function.parentiterator-next | function.parentiterator-haschildren | function.parentiterator-getchildren | function.imagick-transparent | function.imagecolortransparent | function.hwapi-parents | function.hw-getparentsobj | function.hw-getparents | function.httpmessage-getparentmessage | function.get-parent-class | function.domnode-parent-node | function.class-parents |


PHP is a widely-used general-purpose scripting language that is especially suited for Web development and can be embedded into HTML. If you are new to PHP and want to get some idea of how it works, try the introductory tutorial. After that, check out the online manual, and the example archive sites and some of the other resources available in the links section.