01/Kuk04.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: $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  $A = new CA(3);
 28  echo "Pred funkciou: $A->p<br />";
 29  F($A);
 30  echo "Za funkciou: $A->p<br />";
 31  
 32  ?>
 33  </body>
 34  </html>

« Späť