RE: [PHP-DEV] Gauging Interest:RFC to add map() function

2013-06-27 Thread Richard Bradley
> need to make comparisons. > > That said, would you have guessed (without looking at the manual) that PHP > exposes a > "hypot($x, $y)" where you could otherwise have written "sqrt($x * $x, $y * > $y)"? > > Okay, it's a translation from of cours

RE: [PHP-DEV] Gauging Interest:RFC to add map() function

2013-06-26 Thread Richard Bradley
ge cases which justify the C lib's existence) * come up with a name which is self-explanatory and discoverable to users of PHP (i.e. if a PHP programmer needs to map floats from one range to another range in a linear fashion, what will they search for? "1-d affine transform PHP&qu

RE: [PHP-DEV] Object Type Casting

2013-04-25 Thread Richard Bradley
n, you can use something like the following pattern: class MyClass { public static function cast(MyClass $obj) { return $obj; } } Then you have a MyClass "cast" or type assertion via: $x = MyClass::cast($x); // this will throw if $x is not an instanceof MyClass HTH Rich

RE: [PHP-DEV] vsprintf()

2013-04-24 Thread Richard Bradley
? Did you hope for some action to arise, or are you just letting off steam? Best, Rich Richard Bradley Tel : 020 7485 7500 ext 3230 | Fax : 020 7485 7575 softwire Sunday Times Best Small Companies 2012 - 6th in the UK Web : www.softwire.com | Addr : 325 Highgate Studios, 53-79 Highgate Road,

RE: [PHP-DEV] a couple of thoughts on the DateTime type debate

2013-04-05 Thread Richard Bradley
in favour of the idea if there were an implementation." I'm not going to implement it. Will you be implementing it? I suspect not, as you said "I don't know C very well". I think it does look like a nice syntax extension, but I don't think it'll end up in PHP.

RE: [PHP-DEV] a couple of thoughts on the DateTime type debate

2013-04-05 Thread Richard Bradley
he "Structs Tutorial" at msdn for a brief summary of structs in C# - http://msdn.microsoft.com/en-us/library/aa288471(v=vs.71).aspx Richard Bradley Tel : 020 7485 7500 ext 3230 | Fax : 020 7485 7575 softwire Sunday Times Best Small Companies 2012 - 6th in the UK Web : www.softwire.com

RE: [PHP-DEV] E_RECOVERABLE_ERROR for "Call to a member function on a non-object"

2013-03-20 Thread Richard Bradley
ainstorming > thread I have emailed Derick Rethans about this comment: http://grokbase.com/t/php/php-internals/128335vjrj/error-handling-brainstorming#201208272kxvjtb16cvqpd4n8aeweqtwk8 where he suggested there was a specific reason that the remaining E_ERRORs could not be converted to E_RECOVERA

RE: [PHP-DEV] E_RECOVERABLE_ERROR for "Call to a member function on a non-object"

2013-03-20 Thread Richard Bradley
> > On Wed, Mar 20, 2013 at 3:37 PM, Richard Bradley > > wrote: > > > > I'd like to patch PHP to make "Call to a member function on a non-object" > > an E_RECOVERABLE_ERROR > > instead of an E_ERROR. > > > 1. Do I need to creat

[PHP-DEV] E_RECOVERABLE_ERROR for "Call to a member function on a non-object"

2013-03-20 Thread Richard Bradley
ocation problem". In fact, the interpreter should be in a very predictable state, and quite capable of continuing if the user's script requests it. This error is a much better match for the description of E_RECOVERABLE_ERROR from the same page: "a probably dangerous error occurr