This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function quickSort(&$numArr,$left = 0,$right) | |
{ | |
if($left >= $right) { | |
return; | |
} | |
swap($numArr,$left,ceil(($left+$right)/2)); | |
$last = $left; | |
for($i = $left+1;$i<=$right;$i++) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* | |
* QuickSort | |
* &$a:リファレンス渡し | |
* */ | |
function quickSort(&$numArr,$left = 0,$right) | |
{ | |
//(1) | |
if($left >= $right) { | |
return; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function qs($seq){ | |
if(count($seq) == false)return $seq; | |
$pivot = $seq[0]; | |
$low = $high = array(); | |
$length = count($seq); | |
for($i = 1;$i < $length;$i++){ | |
if($seq[$i] < $pivot){ | |
$low[] = $seq[$i]; | |
} else { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class SingletonSample { | |
/** | |
* member variable; | |
* */ | |
private $id; | |
/** | |
* constructor | |
* |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/* class SingletonSample {...} */ | |
?> | |
<?php | |
/** | |
* get instance | |
*/ | |
$instance1 = SingletonSample::getInstance(); | |
sleep(3); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
git clone --recursive git://github.com/zendframework/ZendSkeletonApplication.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Zend Framework (http://framework.zend.com/) | |
* | |
* @link http://github.com/zendframework/ZendSkeletonApplication for the canonical source repository | |
* @copyright Copyright (c) 2005-2013 Zend Technologies USA Inc. (http://www.zend.com) | |
* @license http://framework.zend.com/license/new-bsd New BSD License | |
*/ | |
namespace Application; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Test/test.php | |
namespace Test; | |
function var_dump($input) { | |
$input = empty($input) ? 'empty' : $input; | |
echo('It is private var_dump!! your input is '.$input); | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//private var_dump(); | |
function var_dump($input) { | |
$input = empty($input) ? 'empty' : $input; | |
echo('It is private var_dump!! your input is '.$input); | |
} | |
var_dump('test'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace lib\dummy1; | |
class Dummy { | |
public function execute() { | |
echo "lib/dummy1"; | |
} | |
} |
OlderNewer