何らかの理由で、change()
関数と停止後のすべてを実行できません。試してみまし$this->change()
たが、効果は同じです。関数をphpファイルで実行すると、機能し、数値が変化します。
class Test extends CI_Controller {
function __construct(){
parent::__construct();
}
public function home(){
$num = 1;
change($num);
function change($num,$rand=false){
echo 'inside function'; // this is not shown
if($num < 4) {
$rand = rand(1,9);
$num = $num.$rand;
change($num,$rand);
} else {
echo $num;
}
}
echo 'done'; // this is not shown
}
}