PHP Velho Oeste 2024

PHP 5.5.x から PHP 5.6.x への移行

目次

PHP 5.5.x で改良された点のほどんどは、既存のコードに影響を及ぼしません。ただ、 互換性がない変更 や 考慮すべき 新機能 があります。よって、 実運用環境の PHP をこのバージョンにあげる前に、あらゆるコードをテストすべきです。

add a note add a note

User Contributed Notes 1 note

up
0
offlinewan at gmail dot com
6 years ago
Plese notice that default POST data parsing has changed.
php 5.5 with "foo=bar&baz" received
[
  "foo" => "bar"
]
and php 5.6 with same input receives:
[
  "foo" => "bar",
  "baz" => ""
]

Tested via curl --data 'foo=bar&baz' http://localhost

It can create a problem when earlier json came without correct content-type header.
e.g. {"foo":"bar"} in php 5.5 $_POST was
[
]
and in php 5.6 will be
[
  "{\"foo\":\"\bar\"}" => ""
]

Tested via curl --data '{"foo":"bar"}' http://localhost
To Top