Edit report at https://bugs.php.net/bug.php?id=64880&edit=1
ID: 64880
Comment by: mail+php at requinix dot 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
Type: Feature/Change Request
Package: *General Issues
Operating System: Debian Squeeze
PHP Version: Irrelevant
Block user comment: N
Private report: N
New Comment:
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.
Previous Comments:
------------------------------------------------------------------------
[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