Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online

language.oop5.paamayim nekudotayim function syntax tag tutorial 2013 Donate at flattr Flattr this





Alert! Connect with 10,000 Chating Online. Join Now

Php language.oop5.paamayim nekudotayim () function

Write your php code

 
<?php ?>

Php Result


Your code below



Scope Resolution Operator (::)

The Scope Resolution Operator (also called Paamayim Nekudotayim) or in simpler terms, the double colon, is a token that allows access to static, constant, and overridden members or methods of a class.

When referencing these items from outside the class definition, use the name of the class.

Paamayim Nekudotayim would, at first, seem like a strange choice for naming a double-colon. However, while writing the Zend Engine 0.5 (which powers PHP 3), that's what the Zend team decided to call it. It actually does mean double-colon - in Hebrew!

Example 19-10. :: from outside the class definition

<?php
class MyClass {
    const
CONST_VALUE = 'A constant value';
}

echo
MyClass::CONST_VALUE;
?>

Two special keywords self and parent are used to access members or methods from inside the class definition.

Example 19-11. :: from inside the class definition

<?php
class OtherClass extends MyClass
{
    
public static $my_static = 'static var';

    
public static function doubleColon() {
        echo
parent::CONST_VALUE . "\n";
        echo
self::$my_static . "\n";
    }
}

OtherClass::doubleColon();
?>

When an extending class overrides the parents definition of a method, PHP will not call the parent's method. It's up to the extended class on whether or not the parent's method is called. This also applies to Constructors and Destructors, Overloading, and Magic method definitions.

Example 19-12. Calling a parent's method

<?php
class MyClass
{
    
protected function myFunc() {
        echo
"MyClass::myFunc()\n";
    }
}

class
OtherClass extends MyClass
{
    
// Override parent's definition
    
public function myFunc()
    {
        
// But still call the parent function
        
parent::myFunc();
        echo
"OtherClass::myFunc()\n";
    }
}

$class = new OtherClass();
$class->myFunc();
?>

Php language.oop5.paamayim nekudotayim Function syntax tag

language.oop5.paamayim nekudotayim php code on this is provided for your study purpose, it will guide you to know how create and design a website using php. use it to practice and train your self online



Php language.oop5.paamayim nekudotayim syntax tutorial

php tutorial guide and code design are for easy learning and programming. The code practice section provided at the top is for practising of this syntax. Use the code section up to practice your php programming online. Learning php is very easy, all you need is to use the examples on this site and practice them to perfect your skills.


Function index

Variables

Expressions

Operators

Control-Structures

Cookies

Array

Date & Time

Directory function

File

Image

Operators

Form data handling

Mathematics operators

Mail

Php Mysql

Network Functions

Strings

php tutorial guides,functions, classes, code examples and tags for creating simple dynamic site to mysql database driven sites
 
 
Htaccess    html   Php    javascript   Asp   css    maths  Past Questions  Practice Tests Online