php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Request #15602 get_object_vars() does not return empty vars
Submitted: 2002-02-18 15:16 UTC Modified: 2002-03-15 10:36 UTC
From: ludo at sumatrasolutions dot com Assigned:
Status: Closed Package: Feature/Change Request
PHP Version: 4.1.1 OS: any
Private report: No CVE-ID: None
 [2002-02-18 15:16 UTC] ludo at sumatrasolutions dot com
I know it's documented in the manual, but aside from being less useful than it could be (sometimes it's useful to get empty object vars too), it's posing a few problems to the PEAR ibase DB driver.

The PHP interbase module has no way of returning a hash representation of a row, so the two available solutions are:

a) hack something with ibase_num_fields and ibase_field_info to builf a hash (often gets Interbase sync errors if used with a hash ref as target)

b) use ibase_fetch_object and either cast it to array, or use get_object_vars(), in both cases rows from the same result set have a different field number, due to missing NULLs and empty values; clearly this is not acceptable

Two possible solutions:

- modify get_object_vars() to return all object values or
- add an ibase_fetch_array() or whatever function

Patches

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-15 07:26 UTC] ludoo@php.net
- get_object_vars() now works as expected
- a patch was committed against the interbase module to return NULL fields from Interbase, instead of ignoring them
- a patch is going to be committed to CVS to add an ibase_fetch_assoc() function

 [2002-03-15 10:36 UTC] daniela@php.net
I committed the new ibase_fetch_assoc function a few minutes ago.......
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Aug 18 16:01:28 2024 UTC