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 7035165
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:16:20+00:00 2026-05-28T01:16:20+00:00

This is the code & its output I used to draw the inference below:

  • 0

This is the code & its output I used to draw the inference below:

 class a {
    public $var1;
    public $var2;
    }

 $obj0 = new a;
 var_dump($obj0);

 class b {
    public $var1;
    public $var2;
    public $var3;
    }

 $obj1 = new b;
 var_dump($obj1);

 $obj2 = new stdClass;
 var_dump($obj2);

 $obj3 = new stdClass;
 var_dump($obj3); 

 $obj4 = new stdClass;
 var_dump($obj4);

 $obj5 = new stdClass;
 var_dump($obj5);

 var_dump(new stdClass); 

 $obj6 = new stdClass;
 var_dump($obj6);  

The output:

object(a)#1 (2) {
  ["var1"]=> NULL
  ["var2"]=> NULL
}
object(b)#2 (3) {
  ["var1"]=> NULL
  ["var2"]=> NULL
  ["var3"]=> NULL
}
object(stdClass)#3 (0) {

}
object(stdClass)#4 (0) {

}
object(stdClass)#5 (0) {

}
object(stdClass)#6 (0) {

}
object(stdClass)#7 (0) {

}
object(stdClass)#7 (0) {

}

The #<some-number> next to the line object(someClass) in var_dump of an object is actually #<count>. Where,

count is the number of objects / zval’s for objects irrespective of which class it belongs to that has been created till now. Which keeps getting incrementing for every object created & gets decremented by 1 when a refcount of a zval reaches zero i.e. Garbage Collection.

Am I right?

  • 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-28T01:16:20+00:00Added an answer on May 28, 2026 at 1:16 am

    That number is Z_OBJ_HANDLE_PP(struc) where struc is a zval which leads to Z_OBJVAL(zval).handle which leads to (zval).value.obj.

    See as well http://php.net/manual/en/internals2.variables.intro.php

    In short I would say it’s the object identifier written in decimal form (ref):

    php_printf("%sobject(%s)#%d (%d) {\n", COMMON, class_name, Z_OBJ_HANDLE_PP(struc), myht ? zend_hash_num_elements(myht) : 0);
    

    And not the count of objects ever created.

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

Sidebar

Related Questions

When I run this code url = ('http://maps.google.com/maps/nav?'+ 'q=from%3A'+from_address+ '+to%3A'+to_address+ '&output=json&oe=utf8&key='+api_key) request = urllib2.Request(url)
I need help to use jConfirm with this existing code (php & Jquery &
This code function LoadContent(Id) { alert('Controls/Network/NetworkDetail.aspx?' + rnd() + '&CtlId=' + Id); $.get('Controls/Network/NetworkDetail.aspx?' +
Take this code: <?php if (isset($_POST['action']) && !empty($_POST['action'])) { $action = $_POST['action']; } if
I have this code: Dim birthdaystring As String = MonthBirth.SelectedValue.ToString & / & DayBirth.SelectedValue.ToString
From this code: int x = 5; int other = 10; vector<int*> v_ptr; v_ptr.push_back(&x);
I have this code: for(var i in this.units) { if(this.units[i].x==att.x && this.units[i].y==att.y){} //... some
Please consider this code: template<typename T> char (&f(T[1]))[1]; template<typename T> char (&f(...))[2]; int main()
i made a windows service & add project installer.in which only contain this code.
This is the code: sub function($&) { my $param1 = shift; my $code =

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.