Link to home
Start Free TrialLog in
Avatar of rgb192
rgb192Flag for United States of America

asked on

value, (stream and resource)

<?php
class Animal{
  public function __construct(){
    $this->created=time();
    $this->logfile_handle=fopen('log.txt','w');
  }
  public function __destruct(){
    fclose($this->logfile_handle);
  }
}

$c=new Animal();

Open in new window


Running this code in a debugger,
in the constructor
$this->logfile value=2, type=stream
in the destructor
$this->logfile value=2, type=resource

why value =2
what is the difference between stream and resource
ASKER CERTIFIED SOLUTION
Avatar of Ray Paseur
Ray Paseur
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of rgb192

ASKER

I think I fully understand but your advice is to accept and move on.
Thanks.