Skip to content

Commit

Permalink
Merge branch 'PHP-8.4'
Browse files Browse the repository at this point in the history
* PHP-8.4:
  Fixed the test because libmysql results type is string. (php#16709)
SakiTakamachi committed Nov 6, 2024

Verified

This commit was signed with the committer’s verified signature.
SakiTakamachi Saki Takamachi
2 parents 7421853 + 5faef8e commit 91eda57
Showing 1 changed file with 17 additions and 12 deletions.
29 changes: 17 additions & 12 deletions ext/pdo_mysql/tests/gh16314.phpt
Original file line number Diff line number Diff line change
@@ -11,52 +11,57 @@ MySQLPDOTest::skip();
<?php
require_once __DIR__ . '/inc/mysql_pdo_test.inc';

$pdo = MySQLPDOTest::factory(Pdo\Mysql::class, null, [PDO::ATTR_PERSISTENT => true], false);
$attr = [
PDO::ATTR_PERSISTENT => true,
PDO::ATTR_STRINGIFY_FETCHES => true,
];

$pdo = MySQLPDOTest::factory(Pdo\Mysql::class, null, $attr, false);
var_dump($pdo->query('SELECT 1;')->fetchAll());

$pdo = MySQLPDOTest::factory(Pdo\Mysql::class, null, [PDO::ATTR_PERSISTENT => true], true);
$pdo = MySQLPDOTest::factory(Pdo\Mysql::class, null, $attr, true);
var_dump($pdo->query('SELECT 1;')->fetchAll());

$pdo = MySQLPDOTest::factory(Pdo::class, null, [PDO::ATTR_PERSISTENT => true], false);
$pdo = MySQLPDOTest::factory(Pdo::class, null, $attr, false);
var_dump($pdo->query('SELECT 1;')->fetchAll());

$pdo = MySQLPDOTest::factory(Pdo::class, null, [PDO::ATTR_PERSISTENT => true], true);
$pdo = MySQLPDOTest::factory(Pdo::class, null, $attr, true);
var_dump($pdo->query('SELECT 1;')->fetchAll());
?>
--EXPECT--
array(1) {
[0]=>
array(2) {
[1]=>
int(1)
string(1) "1"
[0]=>
int(1)
string(1) "1"
}
}
array(1) {
[0]=>
array(2) {
[1]=>
int(1)
string(1) "1"
[0]=>
int(1)
string(1) "1"
}
}
array(1) {
[0]=>
array(2) {
[1]=>
int(1)
string(1) "1"
[0]=>
int(1)
string(1) "1"
}
}
array(1) {
[0]=>
array(2) {
[1]=>
int(1)
string(1) "1"
[0]=>
int(1)
string(1) "1"
}
}

0 comments on commit 91eda57

Please sign in to comment.