mirror of
https://github.com/php/php-src.git
synced 2025-08-18 06:58:55 +02:00

Add a get_gc method that can be implemented by drivers, which can be used to add additional zvals to the GC buffer. Implement GC support for PDO SQLite callbacks in particular. Closes GH-6262.
24 lines
521 B
PHP
24 lines
521 B
PHP
--TEST--
|
|
GC support for PDO Sqlite driver data
|
|
--SKIPIF--
|
|
<?php
|
|
if (!extension_loaded('pdo_sqlite')) print 'skip not loaded';
|
|
?>
|
|
--FILE--
|
|
<?php
|
|
|
|
class Obj {
|
|
public $a;
|
|
public function callback() { }
|
|
}
|
|
|
|
$obj = new Obj;
|
|
$obj->a = new PDO('sqlite::memory:');
|
|
$obj->a->sqliteCreateFunction('func1', function() use ($obj) {}, 1);
|
|
$obj->a->sqliteCreateAggregate('func2', function() use ($obj) {}, function() use($obj) {});
|
|
$obj->a->sqliteCreateCollation('col', function() use ($obj) {});
|
|
|
|
?>
|
|
===DONE===
|
|
--EXPECT--
|
|
===DONE===
|