Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7081111
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T06:52:46+00:00 2026-05-28T06:52:46+00:00

EDIT: Thanks everyone. I didn’t even notice it was private lol, so I changed

  • 0

EDIT: Thanks everyone. I didn’t even notice it was private lol, so I changed them from private to public, now it should be accessible… question now is how can I access the value of say ‘backpackPosition’? thanks again!

TF2Inventory Object
(
[fetchDate] => 123456123
[items] => Array
    (
        [60] => TF2Item Object
            (
                [equipped] => Array
                    (
                        [scout] => 1
                        [sniper] => 1
                        [soldier] => 1
                        [demoman] => 1
                        [medic] => 1
                        [heavy] => 1
                        [pyro] => 1
                        [spy] => 1
                    )

                [attributes] => Array
                    (
                        [0] => stdClass Object
                            (
                                [name] => custom employee number
                                [class] => set_employee_number
                                [value] => 0
                            )

                        [1] => stdClass Object
                            (
                                [name] => cannot trade
                                [class] => cannot_trade
                                [value] => 1
                            )

                    )

                [backpackPosition] => 61
                [className] => tf_wearable
                [count] => 1
                [defindex] => 170
                [id] => 535518002
                [level] => 20
                [name] => Primeval Warrior
                [quality] => unique
                [slot] => misc
                [tradeable] => 
                [type] => Badge
            )

        [43] => TF2Item Object
            (
                [equipped] => Array
                    (
                        [scout] => 0
                        [sniper] => 0
                        [soldier] => 0
                        [demoman] => 0
                        [medic] => 0
                        [heavy] => 0
                        [pyro] => 0
                        [spy] => 0
                    )

                [attributes] => Array
                    (
                        [0] => stdClass Object
                            (
                                [name] => cannot trade
                                [class] => cannot_trade
                                [value] => 1
                            )

                    )

                [backpackPosition] => 44
                [className] => tf_wearable
                [count] => 1
                [defindex] => 471
                [id] => 535518003
                [level] => 50
                [name] => Proof of Purchase
                [quality] => unique
                [slot] => head
                [tradeable] => 
                [type] => Hat
            )

        [42] => TF2Item Object
            (
                [equipped] => Array
                    (
                        [scout] => 1
                        [sniper] => 1
                        [soldier] => 1
                        [demoman] => 1
                        [medic] => 1
                        [heavy] => 1
                        [pyro] => 1
                        [spy] => 1
                    )

                [attributes] => 
                [backpackPosition] => 43
                [className] => tf_wearable
                [count] => 1
                [defindex] => 278
                [id] => 541628464
                [level] => 31
                [name] => Horseless Headless Horsemann's Head
                [quality] => unique
                [slot] => head
                [tradeable] => 
                [type] => Hat
            )

        [59] => TF2Item Object
            (
                [equipped] => Array
                    (
                        [scout] => 0
                        [sniper] => 0
                        [soldier] => 0
                        [demoman] => 0
                        [medic] => 0
                        [heavy] => 0
                        [pyro] => 0
                        [spy] => 0
                    )

                [attributes] => Array
                    (
                        [0] => stdClass Object
                            (
                                [name] => cannot trade
                                [class] => cannot_trade
                                [value] => 1
                            )

                    )

                [backpackPosition] => 60
                [className] => tf_wearable
                [count] => 1
                [defindex] => 115
                [id] => 548155039
                [level] => 10
                [name] => Mildly Disturbing Halloween Mask
                [quality] => unique
                [slot] => head
                [tradeable] => 
                [type] => Holiday Hat
            )
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T06:52:46+00:00Added an answer on May 28, 2026 at 6:52 am

    Private members are just that – private. Only the class they belong to can access them. If you want to be able to retrieve their values, you need to either make them protected (and thus available to parent and children classes) or public (available to all classes). Another option is to write some getters, functions that look like

    public function get_slot() {
        return $this->slot;
    }
    

    or use the __get() magic function to make a general getter that looks like

    public function __get($name) {
        return $this->$name;
    }
    

    More info can be found in the documentation at http://php.net/manual/en/language.oop5.visibility.php

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

EDIT: I figured it out from Bergi's answer in the end. Thanks Bergi. pubPrivExample
UPDATE: Solved. Thanks BusyMark! EDIT: This is revised based on the answer below from
Why new()/delete() is slower than malloc()/free()? EDIT: Thanks for the answers so far. Please
EDIT: SOLVED Thanks Brooks. Your question led me to keep digging into if the
Please let me know if you have any idea about it. Thanks EDIT What
EDIT: I have fixed all but two warnings now, so thank you all for
Hey everyone, this seems like it should be a simple one; I really hope
In conclusion: Thanks so much everyone! All the responses posted below were correct. The
Edit: Warning - I now realize that the following technique is generally regarded as
Code as reference: http://jsbin.com/aboca3/2/edit In this example above (thank you SLaks) I am truncating

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.