Jump to content

[SOLVED] new object return false automatically?


onenonly

Recommended Posts

<?php




// Get Image Height & WIdth
class imagedimension{

     public $imagewidth;
     public $imageheight;

     // contructer
     function imagedimension(){



                    $this->imagewidth = '1000';
                    $this->imageheight = '2000';

     }


     function getwidth(){
     return $this->imagewidth;
     }


     function getheight(){
     return $this->imageheight;
     }

}


$test = new imagedimension();

if($test->imagedimension()){

echo $test->getwidth();
echo $test->getheight();

}else{

echo 'bad';

}





?>

 

 

 

shouldnt it be true????

usually its true but not in this situation???

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.