static function factory($x) { if (test::$test) { return test::$test; } else { test::$test = new test($x); return test::$test; } }
<?php class test { public function test() { return ArrayIterator::current(); } } $test = new test(); $test->test(); echo "Done\n";
static function destroy() { test::$test = NULL; }
* Created by PhpStorm. * User: chengt * Date: 14-4-9 * Time: 下午5:45 */ define('UUZU_AUTH', 2); require_once '../../global.php'; TenYear::getInstance(); header("Content-type: text/html; charset=UTF-8"); //error_reporting (E_ALL); //$out = TenYear::getInstance(TenYear::game_name('KFArena'))->init_kf_arena(); //var_dump($out); class test extends TenYear { public function __construct() { parent::__construct(); TenYear::setInstance('TenYear', $this); } public function test() { $data = array("appid" => '24885', "billno" => '4BE1D6AE-5324-11E3-BC76-00163EB7F40B', "cmd" => 'check_award', "contractid" => '24885T320131118114134', "openid" => '000000000000000000000000025900A0', "payitem" => 'pkg', "pf" => 'qzone', "providetype" => '2', "step" => 2, "ts" => '1385089780', "version" => 'V3', "sig" => 'E+S6dC+hooDCtwvhnGTFIFGrfng='); $url = "http://192.168.1.73:9001/tencentTaskMarketApi.php"; $res = Com_TencentDataUpload::send_data($data, $url, "GET"); echo $res; // var_dump(urldecode('E%2BS6dC%2BhooDCtwvhnGTFIFGrfng%3D')); } } $objTest = new test(); $objTest->test();