Re: Re: feature proposal: string types

From: Date: Fri, 03 May 2002 10:14:42 +0000
Subject: Re: Re: feature proposal: string types
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-83649@lists.php.net to get a copy of this message
On Fri, 3 May 2002 vdhome@idas.cz wrote: [..] > Well, I assumed that the overhead wouldn't be too significant, but I > admit I didn't do any measurements whatsoever. Is there any existing > good benchmark, or should I just loop a million times through a few > random lines of code and measure this? Yup :) > > > Back when Andi moved zval.value.strlen and zval.value.strval into > > the str struct, thus saving 4 bytes in the zval struct, PHP 3 was > > generally speeded up by 25%. > > WHAT??? Well, since this would add them back again... :-( > > > Not sure if the PHP 4 or PHP 5 overhead will be in the same > > ballpark, but it's something to think about. > [..] > method name for objects that would - if it exists - be called when > that object should be converted to a string? > > class Date { > function __to_string($type) { > # return a string with $this formatted as $type string > } > } > $date = new Date(); > echo xml"<date>$date</date>"; > > Hmmmm...?? Please... no operator overloading. This was discussed before, and AFAIK the consensus was a no on this. Derick --------------------------------------------------------------------------- Did I help you? http://www.amazon.co.uk/exec/obidos/registry/SLCB276UZU8B Frequent ranting: http://www.jdimedia.nl/derick/ --------------------------------------------------------------------------- PHP: Scripting the Web - derick@php.net All your branches are belong to me! SRM: Script Running Machine - www.vl-srm.net ---------------------------------------------------------------------------

« previous php.dev (#83649) next »