From 14aa44933d79b6baa0f8c3b0a837614903b4a201 Mon Sep 17 00:00:00 2001 From: Jenny Tam Date: Thu, 18 Nov 2021 16:38:19 -0800 Subject: [PATCH] Changed return value for PDO::lastInsertId for 8.1+ (#1332) --- source/pdo_sqlsrv/pdo_dbh.cpp | 2 +- test/functional/pdo_sqlsrv/pdo_lastInsertId.phpt | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/source/pdo_sqlsrv/pdo_dbh.cpp b/source/pdo_sqlsrv/pdo_dbh.cpp index ddd5ca5ea..a69127c1a 100644 --- a/source/pdo_sqlsrv/pdo_dbh.cpp +++ b/source/pdo_sqlsrv/pdo_dbh.cpp @@ -1616,7 +1616,7 @@ zend_string * pdo_sqlsrv_dbh_last_id(_Inout_ pdo_dbh_t *dbh, _In_ const zend_str str[0] = '\0'; return str; #else - return NULL; + return ZSTR_EMPTY_ALLOC(); #endif } diff --git a/test/functional/pdo_sqlsrv/pdo_lastInsertId.phpt b/test/functional/pdo_sqlsrv/pdo_lastInsertId.phpt index 99ea03a5c..7dfe4bbbf 100644 --- a/test/functional/pdo_sqlsrv/pdo_lastInsertId.phpt +++ b/test/functional/pdo_sqlsrv/pdo_lastInsertId.phpt @@ -40,7 +40,7 @@ try { ?> ---EXPECTREGEX-- -string\(3\) "200" -string\(3\) "102" -(string\(0\) ""|bool\(false\)) +--EXPECT-- +string(3) "200" +string(3) "102" +string(0) ""