3v4l.org

run code in 300+ PHP versions simultaneously
<?php // 投稿先とAPIトークンを指定 $room_id = yyyyyy; // ルームID。URLからも確認できます $api_token = "******************"; // APIトークン // メッセージ本文 $body = <<<EOD テストメッセージでござる。 このメッセージはChatwork APIにより自動で投稿されてるでござるよ。 EOD; // ヘッダ header("Content-type: text/html; charset=utf-8"); // POST送信データ $params = array( 'body' => $body ); // cURLに渡すオプションを設定 $options = array( CURLOPT_URL => "https://api.chatwork.com/v1/rooms/{$room_id}/messages", // URL CURLOPT_HTTPHEADER => array('X-ChatWorkToken: '. $api_token), // APIトークン CURLOPT_RETURNTRANSFER => true, // 結果を文字列で返す CURLOPT_SSL_VERIFYPEER => false, // サーバー証明書の検証を行わない CURLOPT_POST => true, // HTTP POSTを実行 CURLOPT_POSTFIELDS => http_build_query($params, '', '&'), // POST送信データ ); // cURLセッションを初期化 $ch = 1; // cURL転送用の複数のオプションを設定 curl_setopt_array($ch, $options); // cURLセッションを実行 $response = curl_exec($ch); // cURLセッションをクローズ curl_close($ch); // 結果のJSON文字列をデコード $result = json_decode($response); // 結果を出力 (メッセージID返ってきてる) var_dump($result); ?>
Output for git.master, git.master_jit, rfc.property-hooks
Fatal error: Uncaught Error: Undefined constant "yyyyyy" in /in/Re3LH:4 Stack trace: #0 {main} thrown in /in/Re3LH on line 4
Process exited with code 255.

This tab shows result from various feature-branches currently under review by the php developers. Contact me to have additional branches featured.

Active branches

Archived branches

Once feature-branches are merged or declined, they are no longer available. Their functionality (when merged) can be viewed from the main output page


preferences:
45.73 ms | 401 KiB | 8 Q