Req #64880 [Opn->Nab]: Perhaps more detail on how to get the value of 'foo' and 'bar' in 'myClass' ?
| From: | nikic@php.net | Date: | Mon, 20 May 2013 20:43:29 +0000 |
| Subject: | Req #64880 [Opn->Nab]: Perhaps more detail on how to get the value of 'foo' and 'bar' in 'myClass' ? | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-179031@lists.php.net to get a copy of this message | ||
Edit report at https://bugs.php.net/bug.php?id=64880&edit=1
ID: 64880
Updated by: nikic@php.net
Reported by: lifehome at usociety dot info
Summary: Perhaps more detail on how to get the value of 'foo'
and 'bar' in 'myClass' ?
-Status: Open
+Status: Not a bug
Type: Feature/Change Request
Package: *General Issues
Operating System: Debian Squeeze
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions. Due to the volume
of reports we can not explain in detail here why your report is not
a bug. The support channels will be able to provide an explanation
for you.
Thank you for your interest in PHP.
Previous Comments:
------------------------------------------------------------------------
[2013-05-20 20:22:12] mail+php at requinix dot net
That function and page are an explanation of the get_class_vars() function and
as such merely talk about how to use it. What you need is something that
explains objects in PHP as a general subject.
http://php.net/language.oop5
Your specific question of how to access $var1 and $var2 from within the class is
addressed on the "Properties" page.
http://php.net/language.oop5.properties
Meanwhile your test script shows something else entirely and is better answered
elsewhere: bugs.php.net is strictly for bug reports, not for individual help
with problems. You should find yourself an online forum, mailing list, or an
offline community for your questions.
------------------------------------------------------------------------
[2013-05-20 11:02:12] lifehome at usociety dot info
Description:
------------
---
From manual page: http://www.php.net/function.get-class-vars#refsect1-function.get-class-vars-examples
---
I understand the first part, but how do I get the value of 'foo' and 'bar' in
the functino of 'myClass" within the class 'myClass'? It's confusing me
while the get_class_vars() and get_class()... I'm totally a noob on PHP programming so please
point out if I was wrong...
Test script:
---------------
' http://pastebin.com/xGXgnBEd ' -- the class I
use
===================================================
A string returns from the link:
1367502965000:deprecated:abcget:1968194347980167531:ce391600756e455db7a529f11fe6f558
===================================================
<?php
$username = abcget
$password = foobar
$api = new MinecraftAPI();
$apinfo = get_object_vars(get_class($api->login));
$api_array = $apinfo['minecraftValues'];
$ign = $api_array[2];
$uid = $api_array[4];
echo $ign."<br/>;
echo $uid;
Expected result:
----------------
abcget<br/>ce391600756e455db7a529f11fe6f558
------------------------------------------------------------------------
--
Edit this bug report at https://bugs.php.net/bug.php?id=64880&edit=1