mirror of
https://github.com/php/php-src.git
synced 2024-11-25 19:05:31 +08:00
45 lines
514 B
PHP
Executable File
45 lines
514 B
PHP
Executable File
--TEST--
|
|
Bug #31177 (Memory leak)
|
|
--FILE--
|
|
<?php
|
|
class DbGow {
|
|
|
|
public function query() {
|
|
throw new Exception;
|
|
}
|
|
|
|
public function select() {
|
|
return new DbGowRecordSet($this->query());
|
|
}
|
|
|
|
public function select2() {
|
|
new DbGowRecordSet($this->query());
|
|
}
|
|
|
|
}
|
|
|
|
class DbGowRecordSet {
|
|
|
|
public function __construct($resource) {
|
|
}
|
|
|
|
}
|
|
|
|
$db = new DbGow;
|
|
|
|
try {
|
|
$rs = $db->select();
|
|
} catch(Exception $e) {
|
|
echo "ok\n";
|
|
}
|
|
|
|
try {
|
|
$db->select2();
|
|
} catch(Exception $e) {
|
|
echo "ok\n";
|
|
}
|
|
?>
|
|
--EXPECT--
|
|
ok
|
|
ok
|