Code: Select all
<?php
class intSquare {
private $squareValue;
private function calculateSquare($val) {
return $val*$val;
}
public function getSquare($value) {
$this->squareValue = calculateSquare($value);
return $this->squareValue;
}
}
$object = new intSquare();
echo $object->getSquare(4);
?>What have I done wrong here?