AMFPHPでboolean型を使用する場合

phpflash 変換しないとうまくいかない。

class Test{
  function Test() {
    $this->methodTable = array(
      "isBool" => array(
        "access" => "remote",
        "arguments"=>array('id'),
        "description"=>"IDを指定して可否を取得",
        "returns"=>"boolean",
      )
    );
  }

  function isBool($id)
  {
    // 可否を取得する処理 
    ;

    // 戻り値を変換
    return $ret?"true":"false";
  }
}


Datatypes Flash remoting for PHP: A responsive Client-Server Architecture for the Web

Seasoned Flash developers should note that PHP booleans are converted to strings as follows: true -> "1", false -> "". This can cause some confusion when inserting Flash booleans into a database; a simple workaround is $bool ? "true" : "false".