2016/12/15 @ PHPカンファレンス2016再演 https://saien.connpass.com/event/45318/
* NaN でなく PHP_INT_MIN から PHP_INT_MAX までの範囲内の値に限る ** 数値形の文字列のみ。数値形の文字列に他の文字が続く場合も使えるが、 Notice が出る *** __toString メソッドを持つもののみ 弱い型検査モードで行われる暗黙の型変換は、PHP が従来他の構文(算術演算子や条件式、組み込み関数の呼び出しなど)で行ってきたのと同等のものです。 厳密モード 一方、厳密な型検査のモードを使う場合は、関数は宣言されたのと正確に一致する型のみを受け付けるようになります(int → float の拡大変換をのぞく)。 ファイルの先頭に declare(strict_types=1); と書くことで、そのファイル内での関数呼び出しの際に厳密モードでの型検査が行われるようになります*1。 以下のように使います。 <?php declare(strict_
ようこそ 時代遅れの情報がウェブ上にあふれている。そんな情報を見たPHP初心者は戸惑ってしまうだろう。そして、まずい手法やまずいコードが広まってしまう。 そんなのはもうやめよう。PHP: The Right Way は気軽に読めるクイックリファレンスだ。PHPの一般的なコーディング規約、 ウェブ上のよくできたチュートリアルへのリンク、そして現時点でのベストプラクティスだと執筆者が考えていることをまとめた。 大事なのは、 PHPを使うための正式なお作法など存在しない ってこと。 このサイトの狙いは、はじめて PHP を使うことになった開発者に、いろんなトピックを紹介すること。 経験豊富なプロの人にとっても、これまで深く考えることなく使ってきた内容について、新鮮な見方を伝えられるだろう。 このサイトは、決して「どのツールを使えばいいのか」を教えるものじゃない。 いくつかの選択肢を示して、それぞ
16. 豪華なメンバー陣 Nate Abele: Lithium Robert Lemke: FLOW3 Nils Adermann: phpBB Larry Masters: CakePHP, CakePHP 2 Brett Bieber: PEAR, PEAR2 Ryan Parman: Amazon Web Services Guilherme Blanco: Doctrine, Doctrine2, SDK et al. Evert Pot: SabreDAV Jordi Boggiano: Composer, Packagist Fabien Potencier: Symfony, Symfony2 Karma Dordrak: Zikula Andre Romcke: eZ Publish Paul Dragoonis: PPI, PPI2 Paul Scott: Chisim
ちょっと大げさなタイトルですが、あくまで私個人の環境構築手順をまとめたものです。WindowsからMacに乗り換えたばかりで、どうやってPHPの開発環境を整えるか分からないPHPerに向けの「開発環境を整えるためのガイド」と考えてください。 既にMacでAMP環境を構築したことがあるPHPerにとっても有用な情報を含めたつもりです。その例としては、php-buildとphp-versionで複数PHPバージョン環境の構築の手順、複数PHPバージョンとApacheの連携方法などがあります。 MacをUnix的に使えるようにするため、CUIで設定する手順を含んでいますが、怖がらずにやってみてください。ターミナルはあなたに噛み付いたりしません :) CUIに慣れてない方は、「難しい」と感じるかもしれませんが、きっとのちのちの財産になるはずです! 2012年版では「PHPerがMacbookAir
平素より「PHPプロ!」をご愛顧いただき、誠にありがとうございます。 2006年より運営してまいりました「PHPプロ!」ですが、サービスの利用状況を鑑みまして、2018年9月25日(火曜日)をもちましてサービスを終了させていただくことになりました。 サービス終了に伴いまして、2018年8月28日(火曜日)を持ちまして、新規会員登録ならびにQ&A掲示板への新たな質問、回答の投稿を停止させていただきます。 なお、ご登録いただいた皆様の個人情報につきましては、サービス終了後、弊社が責任をもって消去いたします。 これまで多くの皆様にご利用をいただきまして、誠にありがとうございました。 サービス終了に伴い、皆様にはご不便をおかけいたしますこと、心よりお詫び申し上げます。 本件に関するお問い合わせはこちらよりお願いいたします。
効率的なWebアプリケーションの作り方 ~PHPによるモダン開発入門 小川雄大(著) 技術評論社 2012年5月 ISBN-10:4774150827 ISBN-13: 978-4774150826 2919円(税込) ■中身が素晴らしいので、外見をdisる 最初に言っておこう。本書は、PHPでWebアプリケーションを開発する人間にとって、とても大きな価値を持つ本である。 今はただの「PHPer(ぺちぱー)」であっても、この本を読んで「Programmer」にステップアップする可能性は十分にある。だからこそ思う、もっと適切なタイトルがあったのではと。 ■大事なのは「効率」ではなく「モダン」 本書は、PHPによるWeb開発を仕事にしていて、なおかつ MVCに沿ったクリーンなコード フレームワークを活用した開発スタイル オブジェクト指向の基本と応用 Gitによるバージョン管理 といったトピック
9. class CalculatorTest extends PHPUnit_Framework_TestCase { public function setUp() { $this->calc = new Calculator; } public function test_add_引数の和を返す() { $result = $this->calc->add(1, 2); $this->assertSame(3, $result); } } 10. class CalculatorTest extends PHPUnit_Framework_TestCase { public function setUp() { 1 $this->calc = new Calculator; } public function test_add_引数の和を返す() { $result = $this-
7. ウェブアプリの入力、処理、出力入出力ウェブサーバウェブアプリ(PHP など)外部 API サーバ(Facebook API 、決済会社など)入出力処理入出力データベースサーバ(MySQL など)ウェブブラウザ 10. ウェブサーバーを通したウェブブラウザからの入力の仕様を考えようPHP に入ってくる値は何かを知る可変長のバイト列 (文字列ではない!!)GET パラメータPOST パラメータアップロードファイルリクエストヘッダ (Cookie など)実際の処理に渡すべき値は何かを考える文字列か、バイト列か?文字コードは何か?(ウェブサーバーでバイト列を処理することってあまりないので、 PHP では基本的に文字コードのバリデーションは必要だと思って良い)長さはどうか?どういう文法や構造を持つデータ?入力された値を実際の処理に渡すべき値かどうかを確認することを「バリデーション」という 11
たにぐちまことさんの書かれた『よくわかるPHPの教科書(以下、「よくわかる」)』を購入してパラパラと見ていたら、セキュリティ上の問題がかなりあることに気がつきました。そこで、拙著「体系的に学ぶ 安全なWebアプリケーションの作り方(以下、徳丸本)」の章・節毎に照らし合わせて、「よくわかる」の脆弱性について報告します。主に、徳丸本の4章と5章を参照します。 4.2 入力処理とセキュリティ 「よくわかる」のサンプルや解説では、入力値検証はほとんどしていません。しかし、入力値検証をしていないからといって即脆弱かというとそうではありません。徳丸本でも強調しているように、入力値検証はアプリケーション要件(仕様)に沿っていることを確認するもので、セキュリティ対策が目的ではないからです。 「よくわかる」の中で、私が見た範囲で唯一の入力値検証は、郵便番号のチェックをするものです。以下に引用します(「よくわ
PHP で遊んでいます。 練習がてら、以前に作った List::RubyLike (http://github.com/naoya/list-rubylike) という Perl モジュール *1 の PHP での実装を作ってみました。 <?php require_once 'List/RubyLike.php'; echo LR(array("foo", "bar")) ->push("baz", "piyo") ->map(function ($v) { return strtoupper($v); }) ->join(", ") . "\n"; echo LR(range(1, 5)) ->grep(function ($n) { return $n % 2 == 0; }) ->map(function ($n) { return $n * $n; }) ->sum() . "\n
via. はてなブログ 誰か書くんじゃないかと思いつつ、まあ、お決まりのパターンとしてPHP版も書いてみよう。 PHPのこと見てると、書き方とか取り巻く環境ってあんま変わってないなーとか思いつつ、そして何がモダンなんだっけ?新しければいいのか?って話だけど。 一般的な OSX 環境および Linux 環境における、モダンな PHP 開発環境の構築方法についてまとめてみた。最新のPHPとxdebugがあれば十分。 PHP 5.3.2 のインストール ソースから入れてた時期もあるけどやっぱパッケージが楽だな。。オフィシャルじゃないリポジトリを使えばパッケージで入れられる。 pearとpeclは、パッケージ入れるときに一緒に入れちゃう。 pear や pecl そのものは、PHPよりも頻繁にバージョンアップされるし、パッケージになってたりなってなかったりの管理が面倒だから基本的にpear/pec
サキとは彼女の自宅近く、湘南台駅前のスーパーマーケットで待ち合わせをした。彼女は自転車で後から追いつくと言い、僕は大きなコインパーキングへ車を停めた。煙草を一本吸ってからスーパーマーケットへ向かうと、ひっきりなしに主婦的な女性かおばあちゃんが入り口を出たり入ったりしていた。時刻は午後5時になる。時計から目を上げると、待たせちゃったわねと大して悪びれてない様子でサキが手ぶらでやってきた。 お礼に料理を作るとはいえ、サキの家には食材が十分足りていないらしく、こうしてスーパーマーケットに寄ることになった。サキは野菜コーナーから精肉コーナーまで、まるで優秀なカーナビに導かれるように無駄なく点検していった。欲しい食材があると、2秒間程度それらを凝視し、一度手に取ったじゃがいもやら豚肉やらを迷うことなく僕が持っているカゴに放り込んだ。最後にアルコール飲料が冷やされている棚の前へ行くと、私が飲むからとチ
CWE is a Software Assurance strategic initiative sponsored by the National Cyber Security Division of the U.S. Department of Homeland Security. CWE - 2010 CWE/SANS Top 25 Most Dangerous Programming Errorsにおいて脆弱性の原因となる危険なプログラミングエラー25が発表された。開発者にセキュリティ問題の原因となるプログラミングに関する注意を促し、実際にソフトウェアが動作する前の段階で問題を発見し対処できるようにすることを目指したもの。2009年に発表されたリストの更新版にあたり、内容の多くが更新されている。2009年版を使っていた場合には、今回発表された2010年版を再度検討する価値がある。
第1回 Google App Engine上でLL+RDBアプリを作ろう 萩原 巧 リトルソフト株式会社 中越 智哉 株式会社ナレッジエックス 2010/2/3 Web アプリケーション開発者にとって、魅力的な環境に映るGoogle App Engineだが、データの永続化などで落とし穴が存在する。これまでの開発手法を変えずに使えないだろうか(編集部) この連載では、Google App Engine(GAE)上でPHP/Rubyという2つのLL言語(Lightweight Language)によって書かれたWebアプリケーションを、できる限りいままでと同じスタイル(データの永続化にリレーショナルデータベースを用いる)で動作させる方法について解説していきます。 GAEについて少しご存じの方は、「おっ?」と思われるかもしれません。GAEになじみのない方は、「それが何か?」と感じられるかもしれ
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く