PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!
<?php
class test
{
protected $boolean = true;
public function setBoolean($bool)
{
$this->boolean = (bool) $bool;
}
public function getBoolean()
{
//show this class boolean
var_dump($this->boolean);
//show class foo boolean
$foo = new foo();
$foo->getTestBoolean();
}
}
class foo extends test
{
protected function getTestBoolean()
{
var_dump($this->boolean);
}
}
$test = new test();
$test->setBoolean(false);
$test->getBoolean();
How can I access $this->_boolean from within class foo (and maintain the set value)?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
So how do I make the class $foo recognize that $test has had it's member set to false?
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
public function getBoolean()
{
//show this class boolean
var_dump($this->boolean);
//show class foo boolean
$foo = new foo();
$foo->setBoolean($this->boolean);
$foo->getTestBoolean();
}
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
public function getStats($input, $recurse=false)
{
if (is_file($input))
{
$ret = new phpsloc_file($input);
} elseif (is_dir($input) && !$recurse)
{
$ret = new phpsloc_directory($input);
} elseif (is_dir($input) && $recurse)
{
$ret = new phpsloc_directoryTree($input);
} else
{
trigger_error('PHPsloc: Could not evaluate input file or directory', E_USER_ERROR);
}
$ret->_returnHTML = $this->_returnHTML;
$ret->_PHPOnly = $this->_PHPOnly;
$ret->_allowPHPTags = $this->_allowPHPTags;
$ret->_allowSingleSpace = $this->_allowSingleSpace;
$ret->_lineLength = $this->_lineLength;
$ret->_lineCountPrecision = $this->_lineCountPrecision;
return $ret->_getStat();
}
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.