php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52174 About Predefined Variables ($_POST, $_GET...)
Submitted: 2010-06-24 17:03 UTC Modified: 2010-06-24 17:07 UTC
Votes:2
Avg. Score:2.0 ± 1.0
Reproduced:1 of 1 (100.0%)
Same Version:1 (100.0%)
Same OS:1 (100.0%)
From: vinicius dot costa dot pires at gmail dot com Assigned:
Status: Not a bug Package: *General Issues
PHP Version: 5.3.2 OS: Windows
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: vinicius dot costa dot pires at gmail dot com
New email:
PHP Version: OS:

 

 [2010-06-24 17:03 UTC] vinicius dot costa dot pires at gmail dot com
Description:
------------
Hey guys...

I didn't find another place in the website to say that... It's not exatly a bug, it's more for a suggestion for upgrading PHP.

We have the predefined variables and the ways to access it...
I think that a better way to access these variables would be as an object.
Or better, it could be both ways.

We usually access these variables with $_POST['data'], or session values like $_SESSION['user'], or $_REQUEST['birthday']...
We could make these variables objects, like $_POST->data, $_SESSION->user, or $_REQUEST->birthday...

For specific variables like $_FILES, it would be even better to access data, like $_FILES->image->size.

That's something you could change in the next version of PHP.

Sorry to write it here, I didn't find another place to post this.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-06-24 17:07 UTC] rasmus@php.net
-Status: Open +Status: Bogus
 [2010-06-24 17:07 UTC] rasmus@php.net
Because you prefer to type -> over []'s?  You don't make something an object just 
because you prefer the syntax.  You make something an object if it carries methods 
that uniquely manipulate the data and in this case there are no such methods.  
_GET, _POST are simply arrays of strings and should be represented as such.
 [2010-06-29 21:44 UTC] vinicius dot costa dot pires at gmail dot com
If you put it that way :D

No, really...
Sorry. I forgot about the methods.

Just forget it... Stupid thing I said.
 [2010-06-29 22:07 UTC] vinicius dot costa dot pires at gmail dot com
Anyway, in function mysql_fetch_object() documentation, it doesn't mention any method returned by the database query.

I've been using it and replacing all my coding to fit OO to get used to the new features of lastest PHP, then I just thought it would fit as a good idea.

So it wasn't so clear that you can only make an object if it carries a method.
In that you have to agree that there's no use for you to answer me like you did.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Jun 01 08:01:32 2024 UTC