ID: 44880 Updated by: [EMAIL PROTECTED] Reported By: kentfredric at gmail dot com -Status: Open +Status: Bogus Bug Type: MySQLi related Operating System: Gentoo GNU/Linux PHP Version: 5.2.6RC5 New Comment:
This is an experimental feature. Experimental features are not supposed to behave in a sane way. Previous Comments: ------------------------------------------------------------------------ [2008-05-01 13:35:58] kentfredric at gmail dot com Description: ------------ the object returned by mysqli->get_warnings() seems to be completely undocumented, as well as nonfunctional. It should produce at least a text string from the server, but it just returns an invalid object/resource. ( un-able to see alternative ways to pull warnings programatically, ie: for use in combination with "explain extended" to display internal representations of optimized queries as part of our testing/development phases ) have tested this on 2 different locations with 2 different versions of php : PHP 5.2.6RC4-pl0-gentoo with Suhosin-Patch 0.9.6.2 (cli) (built: Apr 10 2008 08:50:06) (DEBUG) PHP 5.2.0 (cli) (built: Apr 11 2007 16:34:30) Reproduce code: --------------- $y = new mysqli( ...... ); $m = $y->query( "explain extended select * from footable"); while( $row = $m->fetch_assoc() ) { print serialize($row) . "\n" ; } $n = $y->get_warnings(); var_dump( $n ); print_r( ReflectionObject::export($n)); var_dump( $n->next() ); Expected result: ---------------- Array Of Warning Records? Array of warning strings? Some Warning? ( I can't say accurately what expected output would be, as the function is totally undocumented. But it should produce something instead of nothing in the above case ) Actual result: -------------- -- serialized data rows -- object(mysqli_warning)#3 (0) { } Object of class [ <internal:mysqli> final class mysqli_warning ] { - Constants [0] { } - Static properties [0] { } - Static methods [0] { } - Properties [0] { } - Dynamic properties [0] { } - Methods [2] { Method [ <internal:mysqli, ctor> protected method __construct ] { } Method [ <internal:mysqli> public method next ] { } } } Warning: mysqli_warning::next(): invalid object or resource mysqli_warning in php shell code on line 1 NULL ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=44880&edit=1