Electronics & Programming

develissimo

Open Source electronics development and programming

  • You are not logged in.
  • Root
  • » PHP
  • » [PHP-DEV] Help with object creation [RSS Feed]

#1 Nov. 20, 2005 17:56:45

Bob S.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Help with object creation


Looking through the source, there are a few extensions which create objects
internally and when they do this (usually with an instanciate method), they
typically set is_ref == 1. Like so:



object_init_ex(object, class_entry);

object->refcount = 1;

object->is_ref = 1;





Why set the is_ref? Aren't objects treated as is_ref natively throughout the
engine? Or is this just old code from PHP 4 days that is still hanging
around?



Thanks for the understanding.



Bob Silva

Offline

#2 Nov. 20, 2005 20:40:35

Marcus B.
Registered: 2009-11-02
Reputation: +  0  -
Profile   Send e-mail  

[PHP-DEV] Help with object creation


Hello Bob,

in php 4 that prevents a useless copy after new (and dont't ask why).
Since your stuff is php 5 only you should make that is_ref=0.

marcus

Sunday, November 20, 2005, 6:55:49 PM, you wrote:

> Looking through the source, there are a few extensions which create objects
> internally and when they do this (usually with an instanciate method), they
> typically set is_ref == 1. Like so:

>

> object_init_ex(object, class_entry);

> object->refcount = 1;

> object->is_ref = 1;

>

>

> Why set the is_ref? Aren't objects treated as is_ref natively throughout the
> engine? Or is this just old code from PHP 4 days that is still hanging
> around?

>

> Thanks for the understanding.

>

> Bob Silva

>




Best regards,
Marcus

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit:http://www.php.net/unsub.php

Offline

  • Root
  • » PHP
  • » [PHP-DEV] Help with object creation [RSS Feed]

Board footer

Moderator control

Enjoy the 23rd of January
PoweredBy

The Forums are managed by develissimo stuff members, if you find any issues or misplaced content please help us to fix it. Thank you! Tell us via Contact Options
Leave a Message
Welcome to Develissimo Live Support