Re: [PHP-DEV] [VOTE] Exceptions in the engine

2015-05-12 Thread Sebastian Bergmann
Am 13.05.2015 um 08:30 schrieb Pierre Joye: > Why don't you do it? You have access and you are a very good writer. > No big C knowledge required either in this case :) TBH, until know I did not think I would be capable of doing it myself. I'll look into it now. -- PHP Internals - PHP Runtime D

Re: [PHP-DEV] [VOTE] Exceptions in the engine

2015-05-12 Thread Pierre Joye
On May 13, 2015 12:43 PM, "Sebastian Bergmann" wrote: > > Am 13.05.2015 um 07:40 schrieb Stanislav Malyshev: > > I can, except that I'm pretty busy right now. But probably will have > > some time on the weekend, so I've put it on my todo list. > > Thanks! Why don't you do it? You have access and

Re: [PHP-DEV] [VOTE] Exceptions in the engine

2015-05-12 Thread Sebastian Bergmann
Am 13.05.2015 um 07:40 schrieb Stanislav Malyshev: > I can, except that I'm pretty busy right now. But probably will have > some time on the weekend, so I've put it on my todo list. Thanks! -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.p

Re: [PHP-DEV] [VOTE] Exceptions in the engine

2015-05-12 Thread Stanislav Malyshev
Hi! >> OK, if there's consensus we can go forward with this, then let's just do >> that ASAP. > > Can you implement this? Thanks! I can, except that I'm pretty busy right now. But probably will have some time on the weekend, so I've put it on my todo list. -- Stas Malyshev smalys...@gmail.com

Re: [PHP-DEV] is_digits() and digits type

2015-05-12 Thread Lester Caine
On 12/05/15 22:38, Rowan Collins wrote: > On 12 May 2015 22:32:55 BST, Rowan Collins wrote: >> >It is already possible to pass around, and type hint for, any class of >> >object, so you could for instance have a DatabaseID class. PHP's lack >> >of operator overloading makes that less appealing, pe

Re: [PHP-DEV] is_digits() and digits type

2015-05-12 Thread Rowan Collins
On 12 May 2015 22:32:55 BST, Rowan Collins wrote: >It is already possible to pass around, and type hint for, any class of >object, so you could for instance have a DatabaseID class. PHP's lack >of operator overloading makes that less appealing, perhaps, but it >would work. Incidentally, it's stil

Re: [PHP-DEV] is_digits() and digits type

2015-05-12 Thread Rowan Collins
On 12 May 2015 21:32:35 BST, Lester Caine wrote: >On 12/05/15 20:57, Rowan Collins wrote: >> Type hints are not intended for validating data that is entering or >leaving PHP from or to other systems, they are only relevant when >passing data from one part of a PHP system to another. On any given >

Re: [PHP-DEV] is_digits() and digits type

2015-05-12 Thread Lester Caine
On 12/05/15 20:57, Rowan Collins wrote: > Type hints are not intended for validating data that is entering or leaving > PHP from or to other systems, they are only relevant when passing data from > one part of a PHP system to another. On any given install of PHP, two > libraries communicating wi

Re: [PHP-DEV] Static method call with single colon results in fatal error, not a parse error?

2015-05-12 Thread Johannes Schlüter
Hi, On Tue, 2015-05-12 at 14:44 -0400, Bishop Bettini wrote: > 5.3 and later, including 7 and HHVM: > Fatal error: Call to undefined function bar() 5.3 introduced goto and labels. foo:bar(); is equal to foo: bar(); meaning a label foo and then a function call. johannes -- PHP Internals -

Re: [PHP-DEV] is_digits() and digits type

2015-05-12 Thread Walter Parker
On Tue, May 12, 2015 at 12:27 PM, Lester Caine wrote: > On 12/05/15 19:55, Rowan Collins wrote: > > For instance, valid input for a 64-bit signed integer in a database > could include: > > - any PHP native integer (assuming nobody builds with 128-bit ints!) > > - any string consisting of all digi

Re: [PHP-DEV] is_digits() and digits type

2015-05-12 Thread Rowan Collins
On 12 May 2015 20:27:08 BST, Lester Caine wrote: >On 12/05/15 19:55, Rowan Collins wrote: >> For instance, valid input for a 64-bit signed integer in a database >could include: >> - any PHP native integer (assuming nobody builds with 128-bit ints!) >> - any string consisting of all digits, such th

Re: [PHP-DEV] is_digits() and digits type

2015-05-12 Thread Ryan Pallas
On Tue, May 12, 2015 at 1:27 PM, Lester Caine wrote: > On 12/05/15 19:55, Rowan Collins wrote: > > For instance, valid input for a 64-bit signed integer in a database > could include: > > - any PHP native integer (assuming nobody builds with 128-bit ints!) > > - any string consisting of all digit

Re: [PHP-DEV] is_digits() and digits type

2015-05-12 Thread Lester Caine
On 12/05/15 19:55, Rowan Collins wrote: > For instance, valid input for a 64-bit signed integer in a database could > include: > - any PHP native integer (assuming nobody builds with 128-bit ints!) > - any string consisting of all digits, such that when interpreted as an > integer the value won't

[PHP-DEV] Re: Static method call with single colon results in fatal error, not aparse error?

2015-05-12 Thread Bishop Bettini
On Tue, May 12, 2015 at 2:49 PM, Christoph Becker wrote: > Bishop Bettini wrote: > > > class Foo { > > public static function bar() { echo 'bar'; } > > } > > Foo:bar(); > > > > > > Note the single colon. According to 3v4l ... > > Foo:bar(); > > is the same as > > F

Re: [PHP-DEV] is_digits() and digits type

2015-05-12 Thread Rowan Collins
On 12 May 2015 01:56:52 BST, Yasuo Ohgaki wrote: >To resolve this issue, how about to have > >- is_digits() and digits type for digits only inputs(integer like >string) > - is_numeric() and numeric type for float like string Firstly, these functions already exist; the first is called ctype_digit

[PHP-DEV] Re: Static method call with single colon results in fatal error, not aparse error?

2015-05-12 Thread Christoph Becker
Bishop Bettini wrote: > class Foo { > public static function bar() { echo 'bar'; } > } > Foo:bar(); > > > Note the single colon. According to 3v4l ... > > 5.2.17 and earlier: > Parse error: syntax error, unexpected ':' > > 5.3 and later, including 7 and HHVM: > Fata

Re: [PHP-DEV] Static method call with single colon results in fatal error, not a parse error?

2015-05-12 Thread S.A.N
Foo::bar(); Output for 5.0.0 - 5.6.8, php7@20140507 - 20150501, hhvm-3.6.0 - 3.7.0bar http://3v4l.org/F6tXZ 2015-05-12 21:44 GMT+03:00 Bishop Bettini : > class Foo { > public static function bar() { echo 'bar'; } > } > Foo:bar(); > > > Note the single colon. According to 3v4l

[PHP-DEV] Static method call with single colon results in fatal error, not a parse error?

2015-05-12 Thread Bishop Bettini
class Foo { public static function bar() { echo 'bar'; } } Foo:bar(); Note the single colon. According to 3v4l ... 5.2.17 and earlier: Parse error: syntax error, unexpected ':' 5.3 and later, including 7 and HHVM: Fatal error: Call to undefined function bar() Is th

RE: [PHP-DEV] nameof feature

2015-05-12 Thread Rowan Collins
On 12 May 2015 17:08:16 BST, Alexandr Marchenko wrote: >Idea of nameof (at least in my understanding) is to reduce string usage >and replace them with “strongly” typed “pointers” which can give us >feedback while script is processed (like when you misstyped method name >php will give you fatal er

RE: [PHP-DEV] nameof feature

2015-05-12 Thread Alexandr Marchenko
Hello Bishop, For your first example I do not know what will be the best way but assume something like: God::create(God::chicken); In cases when you are giving strings to PHP (like in example with $_REQUEST[‘animal’]) all should work as is Idea of nameof (at least in my understand

Re: [PHP-DEV] Undefined variables undefined order

2015-05-12 Thread Sara Golemon
On Mon, May 11, 2015 at 10:44 PM, Andi Gutmans wrote: > I don't think it is worth the change. I actually prefer to leave code path > optimization up to gcc here vs. trying to tell it what to do. > This isn't about optimizing code paths, it's about changing undefined behavior into defined behavior.

Re: [PHP-DEV] nameof feature

2015-05-12 Thread Bishop Bettini
Hi! On Tue, May 12, 2015 at 9:29 AM, Alexandr Marchenko < marchenko.alexa...@gmail.com> wrote: > > Guys from C# implemented similar but more powerful feature: nameof(Acme), > nameof(Acme.AnyMethod) > > https://msdn.microsoft.com/en-us/magazine/dn802602.aspx > > Imagine how much confidence it will

[PHP-DEV] nameof feature

2015-05-12 Thread Alexandr Marchenko
I do like Acme::class syntax, when you start using it you cannot stop. Guys from C# implemented similar but more powerful feature: nameof(Acme), nameof(Acme.AnyMethod) https://msdn.microsoft.com/en-us/magazine/dn802602.aspx Imagine how much confidence it will give you while renaming you

Re: [PHP-DEV] is_digits() and digits type

2015-05-12 Thread Lauri Kenttä
On 2015-05-12 03:56, Yasuo Ohgaki wrote: - is_numeric() and numeric type for float like string FYI, there's ctype_digit($s) and preg_match('/⁠^[0-⁠9]+$/⁠s', $s); Adding more functions would be only confusing, I think. -- Lauri Kenttä -- PHP Internals - PHP Runtime Development Mailing List To