Package home | Report new bug | New search | Development Roadmap Status: Open | Feedback | All | Closed Since Version 1.12.3

Bug #2988 "property of non-object" notice when passing table name to tableInfo()
Submitted: 2004-12-19 01:09 UTC
From: timunderwood at gmail dot com Assigned: danielc
Status: Closed Package: DB
PHP Version: 5.0.3 OS: Linux 2.6.9
Roadmaps: (Not assigned)    
Subscription  
Comments Add Comment Add patch


Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know! Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem : 42 - 7 = ?

 
 [2004-12-19 01:09 UTC] timunderwood at gmail dot com
Description: ------------ The first line of the DB_mysql::tableInfo appears to be incorrect. It reads: if (isset($result->result)) { But when $result is a string, isset($result->result) returns true: bash-2.05b$ cat test.php <? $string = "Hello"; var_dump(isset($string->result)); ?> bash-2.05b$ php test.php bool(true) which means it never hits the "elseif (is_string($result))" case. So perhaps it should be: if (is_object($result) && isset($result->result)) -or- if (is_object($result) && array_key_exists('result', $result)) or something along those lines. bash-2.05b$ php -v PHP 5.0.3 (cli) (built: Dec 16 2004 22:01:30) Copyright (c) 1997-2004 The PHP Group Zend Engine v2.0.3, Copyright (c) 1998-2004 Zend Technologies

Comments

 [2004-12-19 17:25 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-12-20 01:00 UTC] php at com dot jkkn dot dk
Notice that this complements the reported bug in php 5.0.3: http://bugs.php.net/bug.php?id=31098 Which was caused by an attempt to fix this bug: http://bugs.php.net/bug.php?id=29883 In CVS 'dmitry' added a automatic typecasting of the offset, so in the exmaple "result" is casted to an int (0) and therefore making isset($result[0]) true.
 [2004-12-20 01:20 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2004-12-20 01:56 UTC] timunderwood at gmail dot com
Yeah I didn't see a "5.0.3" in the dropdown menu when submitting the bug which is why I included the "php -v" output. Thanks for checking this out.
 [2005-01-17 07:54 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!
 [2005-01-29 05:09 UTC] User who submitted this comment has not confirmed identity
If you submitted this note, check your email.If you do not have a message, click here to re-send
MANUAL CONFIRMATION IS NOT POSSIBLE.  Write a message to pear-dev@lists.php.net
to request the confirmation link.  All bugs/comments/patches associated with this

email address will be deleted within 48 hours if the account request is not confirmed!