Member Function in BOX
The behavior of an object is defined by the member functions. The behavior or the member functions is normally affects the state or member variables. The box objects can have a member function to initialize the member variables width and height.
For example PHP Code:
function pmWidth)
{
$this->width = pmWidth;
}
function setHeight(pmHeight)
{
$this->height = pmHeight;
}
Class PHP Code:
class Box
{
var width;
var height;
function setWidth(pmWidth)
{
$this->width = pmWidth;
}
function setHeight(pmHeight)
{
$this->height = pmHeight;
}
}