Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
46 lines (44 sloc) 1.09 KB
<?php
/**
* Test class used in other examples
* Constructors and private methods marked with _ are never exported in proxies to JavaScript
*
* @category HTML
* @package AJAX
* @author Joshua Eichorn <josh@bluga.net>
* @copyright 2005 Joshua Eichorn
* @license http://www.opensource.org/licenses/lgpl-license.php LGPL
* @version Release: @package_version@
* @link http://pear.php.net/package/HTML_AJAX
*/
class test {
function test() {
}
function _private() {
}
function echo_string($string) {
return "From PHP: ".$string;
}
function slow_echo_string($string) {
sleep(2);
return "From PHP: ".$string;
}
function error_test($string) {
trigger_error($string);
}
function multiarg() {
$args = func_get_args();
return "passed in ".count($args)." args ".implode('|',$args);
}
function cookies() {
return $_COOKIE;
}
}
if (isset($_GET['TEST_CLASS'])) {
$t = new test();
var_dump($t->echo_string('test string'));
var_dump($t->slow_echo_string('test string'));
var_dump($t->error_test('test string'));
var_dump($t->multiarg('arg1','arg2','arg3'));
}
?>
Something went wrong with that request. Please try again.