1
0
mirror of https://github.com/php/php-src.git synced 2026-03-24 00:02:20 +01:00

Merge branch 'PHP-8.5'

* PHP-8.5:
  pdo: Fix scope for PDO mixins in pdo_hash_methods() (#20200)
This commit is contained in:
Tim Düsterhus
2025-10-19 14:14:02 +02:00
2 changed files with 26 additions and 1 deletions

View File

@@ -1394,7 +1394,7 @@ bool pdo_hash_methods(pdo_dbh_object_t *dbh_obj, int kind)
func.type = ZEND_INTERNAL_FUNCTION;
func.handler = funcs->handler;
func.function_name = zend_string_init(funcs->fname, strlen(funcs->fname), dbh->is_persistent);
func.scope = dbh_obj->std.ce;
func.scope = pdo_dbh_ce;
func.prototype = NULL;
ZEND_MAP_PTR(func.run_time_cache) = rt_cache_size ? pecalloc(rt_cache_size, 1, dbh->is_persistent) : NULL;
func.T = ZEND_OBSERVER_ENABLED;

View File

@@ -0,0 +1,25 @@
--TEST--
GH-20095: Incorrect class name in deprecation message for PDO mixins
--EXTENSIONS--
pdo_sqlite
--FILE--
<?php
class Foo extends PDO {
private function test() {
echo "foo";
}
public function register() {
$this->sqliteCreateFunction('my_test', [$this, "test"]);
}
}
$pdo = new Foo('sqlite::memory:');
$pdo->register();
$pdo->query("SELECT my_test()");
?>
--EXPECTF--
Deprecated: Method PDO::sqliteCreateFunction() is deprecated since 8.5, use Pdo\Sqlite::createFunction() instead in %s on line %d
foo