php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #68550 calling a field using an object type.
Submitted: 2014-12-05 09:47 UTC Modified: 2014-12-05 11:12 UTC
From: rahulagr12345 at yahoo dot com Assigned:
Status: Not a bug Package: PHP Language Specification
PHP Version: 5.4.35 OS: Any
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: rahulagr12345 at yahoo dot com
New email:
PHP Version: OS:

 

 [2014-12-05 09:47 UTC] rahulagr12345 at yahoo dot com
Description:
------------
Hi Sir,

I want to know that if i am calling a field using object having a dot[.] in it. leads to problem for me.

Test script:
---------------
field name in database is "pa.ab".

If we fetch data from database using mysql_fetch_object like 

"$database->pa.ab" It will read it as "$database->pa". 

First of all i want to know is this an bug, error or my mistake on it.

and if it an issue to be handle differently then how to handle such cases.

Expected result:
----------------
$database->pa.ab will be read and return the same value as in database

Actual result:
--------------
$database->pa will read by programm and nothing is returned.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2014-12-05 11:12 UTC] ajf@php.net
-Status: Open +Status: Not a bug
 [2014-12-05 11:12 UTC] ajf@php.net
Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

This isn't a bug. PHP identifiers can't have dots in them, since that's the concatenation operator.

You probably want to do $database->{"pa.ab"}
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 26 16:01:29 2024 UTC