|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2008-03-07 19:53 UTC] felipe@php.net
[2008-10-27 12:59 UTC] jani@php.net
|
|||||||||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Tue Dec 02 06:00:01 2025 UTC |
Description: ------------ If an argument that is not an array or null is passed as the $params (also called $ctor_params in source code) argument in mysql_fetch_object then the below uncaught exception is returned instead of a normal warning. The reproduced code below is similar to that of a test case from 5.3, although by the time that what I have described above was tested no more rows were in $res so bool(false) was being returned and so this problem may also be in 5.3 Reproduce code: --------------- <?php //select database and table... $res = mysql_query('SELECT col1 FROM test'); class mysql_fetch_object_test { public $a = null; public $b = null; public function __construct($a, $b) { $this->a = $a; $this->b = $b; } public function toString() { var_dump($this); } } var_dump(mysql_fetch_object($res, 'mysql_fetch_object_test', 'not array')); ?> Actual result: -------------- Fatal error: Uncaught exception 'Exception' with message 'Parameter ctor_params must be an array' in ...\mysql_fetch_object.php:25 Stack trace: #0 ...\mysql_fetch_object.php(25): mysql_fetch_object(Resource id #5, 'mysql_fetch_obj...', 'not array') #1 {main} thrown in ...\mysql_fetch_object.php on line 25