01/Kuk06.php


  1  <html>
  2  <body>
  3  <?php  
  4  
  5  class CA
  6  {
  7    private $p;
  8    function __construct($x) 
  9    {
 10      $this->p=$x;
 11    }
 12    
 13    function __destruct()
 14    {
 15      echo "V deštruktore: $this->p<br />"; 
 16    }
 17  
 18  }
 19  
 20  function F($A)
 21  {
 22    $A->p=7;
 23    echo "Vo funkcii: $A->p<br />"; 
 24    $B = new CA("B");
 25  }
 26   
 27  
 28  $A = new CA(5);
 29  echo "Pred funkciou: $A->p<br />"; 
 30  F($A);
 31  echo "Za funkciou: $A->p<br />";
 32  
 33  ?>
 34  </body>
 35  </html>

« Späť