-
Notifications
You must be signed in to change notification settings - Fork 7.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added test file for bug #31177 (not fixed yet)
- Loading branch information
Showing
1 changed file
with
44 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
--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 |