Skip to content

Instantly share code, notes, and snippets.

@adililhan
Created November 22, 2012 21:27
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save adililhan/4132990 to your computer and use it in GitHub Desktop.
Save adililhan/4132990 to your computer and use it in GitHub Desktop.
Late Static Binding Örneği
<?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