Hi all,
There is a problem.intermediate function calling in a class is not working.
The print is only
Hello ()
The test.php is
<?php
require_once('class.Demo.php');
$objDemo = new Demo();
$objDemo->set('Steve');
$objDemo->sa();
?>
the class.Demo.php is
<?php
class Demo {
private $_name;
public function set($name) {
//if ( !is_string($name) || strlen($name) == 0) {
//throw New Exception("Invalid name value");
//}
$this->_name = $name;
}
public function getname() {
return $this->_name;
}
public function sa() {
print "Hello $this->getname() ";
}
}
?>
why the intermediate function(getname() which is calling through sa() ) not printing the name steve
Plz help me




But it is excusable since the lad is only starting out



Bookmarks