lunes, 9 de noviembre de 2009

Ejemplo de extends en PHP


    <?php
    class a{
     var $str;
     function fone($strIn){
      $this->str = $strIn;
     }
    }
    class b extends a{
     function ftwo($strIn){
      $this->fone($strIn);
     }
     function output(){
      echo $this->str;
     }
    }
    $b = new b;
    $b->ftwo('testing');
    $b->output();
    ?>

No hay comentarios.: