Re: [PHP-DEV] [RFC] UString

2015-07-01 Thread Sara Golemon
On Tue, Jun 30, 2015 at 10:36 PM, Joe Watkins pthre...@pthreads.org wrote: Another possible issue is engine integration: $string = (UString) $someString; $string = (UString) someString; That sounds as a cool idea to discuss as a completely separate, unrelated RFC, and not specific to

Re: [PHP-DEV] Improved zend_string API

2015-07-01 Thread Bob Weinand
Am 30.06.2015 um 20:16 schrieb François Laupretre franc...@php.net: De : morrison.l...@gmail.com [mailto:morrison.l...@gmail.com] De la part Just to time in with my $0.02: I feel that using macros as an abstraction in this case is bad practice. I believe that in *most* cases macros as an

Re: [PHP-DEV] [RFC] UString

2015-07-01 Thread Aaron Piotrowski
On Jul 1, 2015, at 1:06 PM, Sara Golemon poll...@php.net wrote: On Tue, Jun 30, 2015 at 10:36 PM, Joe Watkins pthre...@pthreads.org wrote: Another possible issue is engine integration: $string = (UString) $someString; $string = (UString) someString; That sounds as a cool idea to

RE: [PHP-DEV] [RFC] UString

2015-07-01 Thread Anatol Belski
Hi, -Original Message- From: Aaron Piotrowski [mailto:aa...@icicle.io] Sent: Wednesday, July 1, 2015 9:00 PM To: Sara Golemon Cc: pthre...@pthreads.org; internals@lists.php.net Subject: Re: [PHP-DEV] [RFC] UString On Jul 1, 2015, at 1:06 PM, Sara Golemon poll...@php.net wrote:

RE: [PHP-DEV] Improved zend_string API

2015-07-01 Thread François Laupretre
De : Bob Weinand [mailto:bobw...@hotmail.com] Interesting idea (from the concept). I even could get on board with this; I'm just not that sure about the performance impact. (alignment of refcount to base address etc.) zend_string *s; s = zend_string_alloc(256, 0);

Re: [PHP-DEV] [RFC] UString

2015-07-01 Thread Aaron Piotrowski
On Jul 1, 2015, at 2:25 PM, Anatol Belski anatol@belski.net wrote: Expanding on this idea, a separate RFC could propose a magic __cast($value) static method that would be called for code like below: $obj = (ClassName) $scalarOrObject; // Invokes ClassName::__cast($scalarOrObject);

Re: [PHP-DEV] [RFC] UString

2015-07-01 Thread Andreas Heigl
Hi Joe. Am 01.07.15 um 07:36 schrieb Joe Watkins: [..] Another possible issue is engine integration: $string = (UString) $someString; $string = (UString) someString; These aren't very different to 'new UString', but for an integrated solution, kind of expected to work. Why

Re: [PHP-DEV] [RFC] UString

2015-07-01 Thread Joe Watkins
Morning, Why would that be expected behaviour? I mean I can't do $date = (DateTime) $timestring; No, but you can't do: $string = (string) $datetime; But can do: $string = (string) $ustring; Where $ustring is instanceof UString. Even if you never write $string = (string)

Re: [PHP-DEV] Fix division by zero to throw exception (round 2)

2015-07-01 Thread Andrea Faulds
Hi Bob, On 2 Jul 2015, at 01:26, Bob Weinand bobw...@hotmail.com wrote: Am 29.06.2015 um 19:14 schrieb Andrea Faulds a...@ajf.me: Hmm. Using Error might make some sense given it used to raise E_WARNING. I think DivisionByZeroError sounds like a good idea. Hey, I just committed that