01/Kuk03.php


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

« Späť