Created
November 22, 2012 21:27
-
-
Save adililhan/4132990 to your computer and use it in GitHub Desktop.
Late Static Binding Örneği
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class X { | |
public static function Z(){ | |
return "X çağırıldı\n"; | |
} | |
public function getSelfZ(){ | |
echo self::Z(); // X sinifindaki deger doner | |
} | |
public function getStaticZ(){ | |
echo static::Z();//turetilen (extend edilen yani Y sinifi) siniftaki deger doner | |
} | |
} | |
class Y extends X { | |
public static function Z(){ | |
return "Y çağırıldı\n"; | |
} | |
} | |
$a = new Y(); | |
$a->getSelfZ(); | |
$a->getStaticZ(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment