[PHP-DEV] Re: php-src /ext/unicode unicode_iterators.c /ext/unicode/tests .cvsignore iterator_001.phpt

2006-02-16 Thread l0t3k
""Marcus Boerger"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > helly Wed Feb 15 21:34:21 2006 UTC > +static inline text_iter_obj* text_iter_to_obj(zend_object_iterator *iter) > +{ > + static text_iter_obj adr; > + static int ofs = (char*)&adr.iter - (char*)&adr; > + > + return (t

[PHP-DEV] Re: php-src /ext/unicode unicode_iterators.c /ext/unicode/tests .cvsignore iterator_001.phpt

2006-02-16 Thread l0t3k
""Marcus Boerger"" <[EMAIL PROTECTED]> wrote in message news:[EMAIL PROTECTED] > helly Wed Feb 15 21:34:21 2006 UTC > +static inline text_iter_obj* text_iter_to_obj(zend_object_iterator *iter) > +{ > + static text_iter_obj adr; > + static int ofs = (char*)&adr.iter - (char*)&adr; > + > + return (

[PHP-DEV] Re: Minor engine patch to facilitate PECL/operator

2006-02-16 Thread Zeev Suraski
At 00:39 17/02/2006, Sara Golemon wrote: I gave this some thought as I was designing the overloading approach. I didn't go there because I actually wanted to allow asymmetry between the operands as sometimes communative properties don't apply cleanly. Most obviously in the case of sub/div ops, b

[PHP-DEV] Re: Minor engine patch to facilitate PECL/operator

2006-02-16 Thread Andi Gutmans
At 02:39 PM 2/16/2006, Sara Golemon wrote: I gave this some thought as I was designing the overloading approach. I didn't go there because I actually wanted to allow asymmetry between the operands as sometimes communative properties don't apply cleanly. Most obviously in the case of sub/div ops,

[PHP-DEV] Unrolling Classes

2006-02-16 Thread steve
I've been in a discussion about class derivation depth and its effects on the speed of method calls (i.e.: slower). I was wondering if anyone had come across work (not necessarily for PHP) about class unrolling. Thanks. -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit:

[PHP-DEV] Re: Minor engine patch to facilitate PECL/operator

2006-02-16 Thread Benj Carson
Just thought I'd chime in here with an example that seemed relevant: cout << "foo" << "bar" << endl; cin >> input; Here, << and >> have nothing to do with bit-shifting and have different meanings. So, maybe one can't assume that '<' and '>' always have to apply to the typical mathematical ope

Re: [PHP-DEV] C Level Iterators and Userland Classes

2006-02-16 Thread l0t3k
Marcus, one last question ... > You should never touch the data member of that iterator does this mean that i should make a copy of whatever i get from the get_current_data() handler ? There seems to be a bit of inconsistency in dealing with the current element in the iterators For example, the

[PHP-DEV] Re: Minor engine patch to facilitate PECL/operator

2006-02-16 Thread Sara Golemon
> Here, << and >> have nothing to do with bit-shifting and have different > meanings. So, maybe one can't assume that '<' and '>' always have to apply > to the typical mathematical operations (e.g. $pacman < $ghost). > That's one reason (one which lends credibility to the overloading kills readabi

[PHP-DEV] Re: Minor engine patch to facilitate PECL/operator

2006-02-16 Thread Zeev Suraski
I understand. Aren't you slightly worried about the implications of making it possible for x>y to have a different meaning than y In languages where operator overloading is supported, it comes hand in hand with strict typing, which wouldn't allow for different values for x>y and y Zeev At 19

[PHP-DEV] Re: Minor engine patch to facilitate PECL/operator

2006-02-16 Thread Sara Golemon
> > I am not a big fan of operator overloading because after years of C++ > development I came to the conclusion that the syntactic sugar it > provided was not worth the debugging hours lost due to hidden magic > happening. It actually makes it hard to understand certain code when > you're just re

[PHP-DEV] Re: Minor engine patch to facilitate PECL/operator

2006-02-16 Thread Andi Gutmans
I am not a big fan of operator overloading because after years of C++ development I came to the conclusion that the syntactic sugar it provided was not worth the debugging hours lost due to hidden magic happening. It actually makes it hard to understand certain code when you're just reading i

[PHP-DEV] Re: Minor engine patch to facilitate PECL/operator

2006-02-16 Thread Sara Golemon
> >Enter PECL/operator, which tries to implement operator overloading > >for objects (and does a decent job at that). In the interrest of > >ease of use and consistency, every overloaded binary operator is > >[meant to be] left associative. This is, in the expression expr1 > >op expr2 expr1 g

[PHP-DEV] Re: Minor engine patch to facilitate PECL/operator

2006-02-16 Thread Zeev Suraski
At 19:23 16/02/2006, Sara Golemon wrote: Hi, purely selfish request here, I'd like to make a minor change to the parser... Just a bitty one... You won't even feel it... Currently, when the parser encounters: expr1 > expr2 it quietly (and reasonably) switches it around to expr2 < expr1 so th

[PHP-DEV] Minor engine patch to facilitate PECL/operator

2006-02-16 Thread Sara Golemon
Hi, purely selfish request here, I'd like to make a minor change to the parser... Just a bitty one... You won't even feel it... Currently, when the parser encounters: expr1 > expr2 it quietly (and reasonably) switches it around to expr2 < expr1 so that is can reuse the ZEND_IS_SMALLER op.

Re: [PHP-DEV] Unexpected "silent" type-cast with initialized but un-set members

2006-02-16 Thread Morten Fangel
On Thursday 16 February 2006 13:45, Jochem Maas wrote: > if that is the logic being applied in the engine then one might to wonder > why a function such as array_merge() was changed to emit a warning when any > of it's arguments are not arrays (whereas sometime in the past it used to > swallow [and

Re: [PHP-DEV] Unexpected "silent" type-cast with initialized but un-set members

2006-02-16 Thread Jochem Maas
Morten Fangel wrote: On Thursday 16 February 2006 12:39, Antony Dovgal wrote: bar = 1; var_dump($a); ?> This code is much simpler, huh? Yeah, I must have been blinded by the lights. It merely resembles $foo['bar'] = 'baz'; Where $foo is cast as an array without the need to do $foo = array();

Re: [PHP-DEV] [PATCH] Custom Streams, fclose & stream_close

2006-02-16 Thread Wez Furlong
Looks good. On 2/15/06, Jared Williams <[EMAIL PROTECTED]> wrote: > > > > > stream_close can return any value it likes... however, it > > is ignored > > > > and php_userstreamop_close always returns success to the streams > > > > layer. > > > > This is a bug, but should be simple to fix. (voluntee

Re: [PHP-DEV] Unexpected "silent" type-cast with initialized but un-set members

2006-02-16 Thread Morten Fangel
On Thursday 16 February 2006 12:39, Antony Dovgal wrote: > $a->bar = 1; > var_dump($a); > ?> > This code is much simpler, huh? Yeah, I must have been blinded by the lights. It merely resembles $foo['bar'] = 'baz'; Where $foo is cast as an array without the need to do $foo = array(); first. So I g

Re: [PHP-DEV] Unexpected "silent" type-cast with initialized but un-set members

2006-02-16 Thread Antony Dovgal
On 16.02.2006 14:32, Morten Fangel wrote: Hi, Look at the following example: --- bar->baz = 'blah'; } } $foo = new Foo(); print_r($foo); ?> -- It results in: --- Foo Object ( [bar] => stdClass Object ( [baz] => blah ) ) --- $a->bar = 1; var_dump($a); ?> Thi

[PHP-DEV] Unexpected "silent" type-cast with initialized but un-set members

2006-02-16 Thread Morten Fangel
Hi, Look at the following example: --- bar->baz = 'blah'; } } $foo = new Foo(); print_r($foo); ?> -- It results in: --- Foo Object ( [bar] => stdClass Object ( [baz] => blah ) ) --- Foo->bar is never declared as anything but "public" and is therefor "type-less"