Skip to content

Instantly share code, notes, and snippets.

@youkidearitai
Last active July 6, 2023 13:23
Show Gist options
  • Save youkidearitai/8f3a8046fbf0e26cc8872b2c0e791086 to your computer and use it in GitHub Desktop.
Save youkidearitai/8f3a8046fbf0e26cc8872b2c0e791086 to your computer and use it in GitHub Desktop.
<?php
$pdo = new PDO("mysql:host=127.0.0.1;dbname=ore", "root", "password");
$pdo->setAttribute(PDO::ATTR_EMULATE_PREPARES, false);
$pdo->setAttribute(PDO::ATTR_STRINGIFY_FETCHES, true);
$results = $pdo->query("SELECT * FROM test");
foreach ($results as $result) {
var_dump($result);
}
@youkidearitai
Copy link
Author

このことから、 PDO::ATTR_EMULATE_PREPARES の影響でPHP 8.0でもPHP 8.1と同じ結果となった
trueもしくはコメントアウトなら 3.60 などとなる。

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment