Re: [PHP-DEV] unsetting class properties

2003-07-06 Thread Zeev Suraski
At 18:36 05/07/2003, Marcus Börger wrote:
During a nice chat with Andi both of us came to the conclusion that the user
may shoot himself in the knee if he wants to. So we allow unsetting default
properties what makes PHP objects a thing between real objects and pure
instances.
Just for the record, the pain involved in this shot won't be that 
significant.  Because of the way the engine works, the access information 
related to the property (PPP setting, whether it's static or not, etc.) are 
kept separately, and won't be effected by unset().  So, if you unset a 
private property, it still remains private, just without any value 
currently attached to it.  It's really not that bad.

Zeev

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


[PHP-DEV] destructor access to constants

2003-07-06 Thread Ulf Wendel
Hi,

I'm wondering if it's a bug to give automatically called destructors 
access to constants (PHP Version 5.0.0b1). I'd expect to be neither able 
to access global variables nor constants after script termination (die()).

Ulf

$dtor = 'global $dtor variable is visible';
define('DTOR', 'DTOR constant is visible');
class dtor {

  function __destruct() {
global $dtor;
printf('$dtor = %sbr DTOR = %sbr', $dtor, DTOR);
  }
}
$d1 = new dtor();
unset($d1);
$d2 = new dtor();
die();
generated output:

$dtor = global $dtor variable is visible
DTOR = DTOR constant is visible
$dtor = 
DTOR = DTOR constant is visible
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


Re: [PHP-DEV] destructor access to constants

2003-07-06 Thread Marcus Börger
Hello Ulf,

Sunday, July 6, 2003, 12:27:00 PM, you wrote:

UW Hi,

UW I'm wondering if it's a bug to give automatically called destructors 
UW access to constants (PHP Version 5.0.0b1). I'd expect to be neither able 
UW to access global variables nor constants after script termination (die()).

UW Ulf


UW $dtor = 'global $dtor variable is visible';
UW define('DTOR', 'DTOR constant is visible');

UW class dtor {

UWfunction __destruct() {
UW  global $dtor;
UW  printf('$dtor = %sbr DTOR = %sbr', $dtor, DTOR);
UW}
UW }

UW $d1 = new dtor();
UW unset($d1);

UW $d2 = new dtor();
UW die();

UW generated output:

UW $dtor = global $dtor variable is visible
UW DTOR = DTOR constant is visible
UW $dtor = 
UW DTOR = DTOR constant is visible



Global variables are a bit complicated but constants are either bound to the
class so they are obviously available in instance destruction or as in your
case they were registered in the global space and hence destructed after all
script action is finished which includes automatic destructor calls from GC.

-- 
Best regards,
 Marcusmailto:[EMAIL PROTECTED]


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



RE: [PHP-DEV] array_has_more

2003-07-06 Thread James Cox

 
 The problem isn't the ending. The problem is that according 
 to our naming conventions it should be array_foobar() whereas the
other 
 array functions were invented before our conventions and are short
names such 
 as next(). Now on one hand we wouldn't want to pollute the PHP
function 
 space with new non-conforming function names but on the other hand it
is 
 really ugly to have a new function which looks completely different
from the 
 original ones...
 

You could turn around it's output and call it array_complete, so:

if (array_complete($arr)) {
  return no more elements;
} else {
  return more elements available;
}


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



[PHP-DEV] property registration convenience methods

2003-07-06 Thread George Schlossnagle
I added a convenience method and macros (based largely off of 
zend_do_declare_property) to ease extensions registering their own 
default properties.  The patch is available at 
http://www.schlossnagle.org/~george/php/zend_api.patch.  If someone 
(Zeev, Andi?) could look this over and give me the ok to commit it, 
that would be great.

-- George Schlossnagle
-- Principal Consultant
-- OmniTI Computer Consulting, Inc.
-- +1.410.872.4910 x202
-- 1024D/1100A5A0 1370 F70A 9365 96C9 2F5E  56C2 B2B9 262F 1100 A5A0
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


[PHP-DEV] CVS Account Request: pjotrik

2003-07-06 Thread Petr Novak
Translating the documentation into Czech Language

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



Re: [PHP-DEV] property registration convenience methods

2003-07-06 Thread Andi Gutmans
Go ahead and commit it!

Andi

At 03:06 PM 6/7/2003 -0400, George Schlossnagle wrote:
I added a convenience method and macros (based largely off of 
zend_do_declare_property) to ease extensions registering their own default 
properties.  The patch is available at 
http://www.schlossnagle.org/~george/php/zend_api.patch.  If someone (Zeev, 
Andi?) could look this over and give me the ok to commit it, that would be 
great.

-- George Schlossnagle
-- Principal Consultant
-- OmniTI Computer Consulting, Inc.
-- +1.410.872.4910 x202
-- 1024D/1100A5A0 1370 F70A 9365 96C9 2F5E  56C2 B2B9 262F 1100 A5A0
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php


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