All pastes #1035041 Raw Edit

rewbs

public php v1 · immutable
#1035041 ·published 2008-05-31 16:14 UTC
rendered paste body
<?phpclass Mother{  protected function askForMoney()  {    print "May I please have some money?\n";  }}class Daughter extends Mother{  protected function askForMoney()  {    print "Please, please, pretty please!\n";  }}class Son extends Mother{  public function askToAskForMoney(Mother $personToAsk)  {    $personToAsk->askForMoney();  }}$s = new Son;$s->askToAskForMoney(new Mother);$s->askToAskForMoney(new Daughter); //Valid Liskov substitution - should this fail??>