Re: [PHP-DEV] Exceptions Vs Errors

2012-09-04 Thread Alex Aulbach
andle it like an exception. Ok, ok, as Rasmus correctly mentioned, uncaught exceptions are by definition fatal. But isn't catching an exception not like "I know how to handle it?" And when I know how to handle it, couldn't I handle it in the exception directly? More question

Re: [PHP-DEV] Re: Are exceptions allowed in php core?

2012-09-04 Thread Alex Aulbach
2012/9/4 Rasmus Lerdorf : > On 09/03/2012 04:31 PM, Alex Aulbach wrote: >> 2012/9/4 Gustavo Lopes : >>>> Following this logic, we'd have to convert all E_NOTICE and E_STRICT to >>>> fatal errors or exceptions - they are usually produced by programming >&g

Re: [PHP-DEV] Re: Are exceptions allowed in php core?

2012-09-03 Thread Alex Aulbach
ing into an error-log and tells PHP not to handle it any more (destroys itself). Could be all done in the construction of the exception. -- Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Error handling brainstorming

2012-08-24 Thread Alex Aulbach
rning) and look if that class exists. And so on. So you can handle file-errors different from all other warnings without try/catch everything. Not perfect for now, and I think a little bit too complicated, but this is a brainstorming. -- Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Generators

2012-08-20 Thread Alex Aulbach
are generators. > > PHP being a dynamic language, it may be able to move the function variables > to a class. But it's not trivial for any parser. > > > > -- > PHP Internals - PHP Runtime Development Mailing List > To unsubscribe, visit: http://www.php.net/unsub.php > -- Freundliche Grüße Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [RFC] Generators

2012-08-14 Thread Alex Aulbach
rces, which can't be shared. For example: the file-read-example doesn't lock. To implement locking new functions or a new class is needed - hiding complexity. Generators are (in my opinion) really nice for things which are already in the memory. Not more or less. -- Alex Aulbach -- PH

Re: [PHP-DEV] [RFC] Generators

2012-08-14 Thread Alex Aulbach
he parent > scope, expecting to continue on later (think of it as a stop light where > you let the other code run for a while until you go to the next one). I think for people, which are - like me - more used with databases, the cursor-concept is a good comparison. Perhaps this could help a

Re: [PHP-DEV] Implicit isset in ternary operator

2012-08-02 Thread Alex Aulbach
with the 'or' operator (or not ||)... Which brings us back to the subject... -- Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [PROPOSED] password_hash RFC - Implementing simplified password hashing functions

2012-08-01 Thread Alex Aulbach
h()..., of course remove it before verify!). Every change (new algorithms etc) will increment the version. This can help to detect the case when in version 79 bcrypt is removed because too insecure/too old. As said, currently not needed, but if someone likes to, here it is. :) -- Alex Aulba

Re: [PHP-DEV] Implicit isset in ternary operator

2012-08-01 Thread Alex Aulbach
ay arround, it's one of the best things, that have been introduced, because before it, a very small write error had big impacts. I see - as you - the need to make simple things more short, but removing warnings from existing code constructs is definitly the wrong way. -- Alex Aulbach

Re: [PHP-DEV] Re: Generators in PHP

2012-07-30 Thread Alex Aulbach
troducing it. And - this is my secret hope :) - this will kill the need for discussion of this *now*. The future will show us, if this is accepted/needed or not. Because who knows? This gives also more options for the future and is in my eyes good design. -- Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: Generators in PHP

2012-07-26 Thread Alex Aulbach
about this new feature before they first will see it. But we can. And maybe we should, because they are the users of what we do. And we don't need to look at all the others. There is just no need to. They didn't even use PHP. :) -- Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Generators in PHP

2012-07-26 Thread Alex Aulbach
- think at first try this isn't implemented with all consequences, so they may not be helpful to see the difference. -- Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Generators in PHP

2012-07-25 Thread Alex Aulbach
ple with the original iterators... But it's just what it does. > BTW: I still don't think that the generators need a unique word and I suggest > using functions, but I didn't read al the mails chain, so I assume that I'll > find there the answer. Of course

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Alex Aulbach
who you're talking > about) routinely have to spend time understanding the purpose of a given > function. To assume that one can pretend to understand a function without You dream. You don't have time. You need to get things done. :) > having seen and questioned an unfamiliar ke

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Alex Aulbach
doing. Experience: Most PHP-programmers are not so experienced like most programmers in other languages. (Can't be proven, but I would bet for it.) -- Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Alex Aulbach
means: If we have the chance to make things easier we must do it. Experience: The current concept dosn't "feel right" for me. I like to listen to my belly in those questions, because he is in most cases right. With the change I suggested he stops grumbling. Please correct me if I use

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Alex Aulbach
not necessarily a good programmer make, nor > an expert in other programmers. It's not sufficient but neccessary. -- Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Alex Aulbach
the "mass" of anonymous PHP-programmers really needs and that, what is written in this internals list. I with you introducing new features like this, but it must be done in a way that is more self-explaining, has a low learning-curve. Yield implemented like this dosn't match this crite

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Alex Aulbach
in the C#-way. -- Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Alex Aulbach
d how to make it a little bit better and I explained why. I'm just wondering... for whom is PHP developed, for the PHP-internals or for PHP-developers? -- Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: Generators in PHP

2012-07-25 Thread Alex Aulbach
o it. I always think of Bob Ross, when I explain PHP. But it's ok, there are no mistakes, there are just happy little accidents. :) [means: I will not complain any more] -- Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: Generators in PHP

2012-07-24 Thread Alex Aulbach
I just want to make such simple mistakes not so easy and the afford is worth the results. You can argue: "Those mistakes will always happen". I say "Yes, of course, but if we have the chance to reduce those mistakes we should do it." -- Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: Generators in PHP

2012-07-24 Thread Alex Aulbach
ittle bit more for that. -- Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: Generators in PHP

2012-07-24 Thread Alex Aulbach
d is not a function. And if other languages do so, my argument will be the same. We need not to make the same mistake again! :) -- Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Implicit isset in ternary operator

2012-07-24 Thread Alex Aulbach
x27;s a different topic from the suggested feature... Which is a much better idea in general. My suggestion was only for a very special context and should be easier to implement. I currently think, this discussion needs more time, because I begin to forget, for what this is really needed. :) I

Re: [PHP-DEV] Re: Generators in PHP

2012-07-24 Thread Alex Aulbach
thing which is, when called once finished once. I don't like mathematics, but that is one of the definition of a function: http://en.wikipedia.org/wiki/Function_%28mathematics%29 "each input is related to exactly one output" Couldn't be so complicated to introduce a new name for that,

Re: [PHP-DEV] Re: Generators in PHP

2012-07-24 Thread Alex Aulbach
we need to have it as _function_? -- Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Implicit isset in ternary operator

2012-07-24 Thread Alex Aulbach
OOP - but that's a different topic. Existing operators shouldn't be changeable. My suggestion is the "PHP-way" of operator driven development for a very special problem, which is making very repeating but complex things very short, nothing else. :) Or in other words: In detail it'

Re: [PHP-DEV] Implicit isset in ternary operator

2012-07-24 Thread Alex Aulbach
ator_handler_once() should be possible, so that a second call isn't executed. Other things: I don't like the first operator (the operator-name). Any goof idea? -- Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Implicit isset in ternary operator

2012-07-22 Thread Alex Aulbach
function _greater($a, $b, $c, $d) { if ($a > $b) { return $c; } return $d; } My suggestion just is: At any point everybody needs one more operator for "his stuff". But that's why functions exists. -- Alex Aulbach -- PHP Internals - PHP Runtime Developmen

Re: [PHP-DEV] Make try/catch brackets optinal

2012-07-22 Thread Alex Aulbach
2012/7/20 Ivan Enderlin @ Hoa : > On 20/07/12 15:32, Alex Aulbach wrote: >> If you use try/catch that much, that you begin to think about the >> syntax, you have an architecture- or design-problem. > > Not sure about that. First, it was an example. Second, it happens more o

Re: [PHP-DEV] Implicit isset in ternary operator

2012-07-22 Thread Alex Aulbach
set, only an empty. > > Does this seem like a possible improvement we can work on? Anyone > interested in championing the change? -- Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Re: Generators in PHP

2012-07-22 Thread Alex Aulbach
ut the implementations in other languages. :) PS: I would like to see that yield goes hand in hand with the iterator-stuff. PPS: Ok, maybe a change isn't really needed, but I think how to use this in a good manner (to avoid the problems mentioned above) should be part of the docs. -- Regards, Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Make try/catch brackets optinal

2012-07-20 Thread Alex Aulbach
Hi Ivan, > try > throw new Exception('foobar'); > catch(Exception $e) > var_dump($e->getMessage()); If you use try/catch that much, that you begin to think about the syntax, you have an architecture- or design-problem. PS: And if without brackets should be forbidden.

Re: [PHP-DEV] Random string generation (á la password_make_salt)

2012-07-17 Thread Alex Aulbach
'), range('A','Z'), range('0','9')) )) So I think, if we don't need charset-encoding, we won't need this special functionality. -- Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Random string generation (á la password_make_salt)

2012-07-17 Thread Alex Aulbach
regex in this case is maybe faster) trim("\rblaa\n", str_charset('/[^[:print:]]/')); // remove invisible chars: when doing this with very big strings it could be much faster than with regex. str_replace(str_split(str_charset('/[^[:print:]]/')), "\rblaa\n"); There are many other more or less useful things you can do with a charset-string. :) -- Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] Random string generation (á la password_make_salt)

2012-07-16 Thread Alex Aulbach
al for some other things (many string functions have it), I suggest that it is not part of random_string(). Make a new function str_from_character_class(), or if you use pcre like above pcre_str_from_character_class()? -- Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [PROPOSED] password_hash RFC - Implementing simplified password hashing functions

2012-07-16 Thread Alex Aulbach
tering, it's extending to a new level. Which is in the beginning always uncomfortable. :) And I think it depends on what architecture-features PHP should follow. E. g. simpleness or security (security means often simpleness) or ... or ...? -- Alex Aulbach -- PHP Internals - PHP Runtime

Re: [PHP-DEV] [PROPOSED] password_hash RFC - Implementing simplified password hashing functions

2012-07-16 Thread Alex Aulbach
2012/7/16 Galen Wright-Watson : > What about an approach like PDO, where the password functions would > generate errors by default, but could be configured to throw exceptions? I think it makes things more complicated instead of less. For security simpleness is important. -- Alex A

Re: [PHP-DEV] [PROPOSED] password_hash RFC - Implementing simplified password hashing functions

2012-07-16 Thread Alex Aulbach
this case it's also concepts of handling errors. And much other stuff. Again: This is off-topic. The RFC is very fine, it's a good work, I like it! Really, I do! :) But for me - as PHP-developer - it's like renewing all doors of a house with newest technique, but forgetting the wind

Re: [PHP-DEV] [PROPOSED] password_hash RFC - Implementing simplified password hashing functions

2012-07-15 Thread Alex Aulbach
fault exception-handling which can be overridden (like the error-handlers). Could be an interesting concept. :) And of course its something which needs time. -- Sevus Alex Aulbach -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] [PROPOSED] password_hash RFC - Implementing simplified password hashing functions

2012-07-15 Thread Alex Aulbach
2012/7/14 Andrew Faulds : > Well... if people have poorly configured servers spitting out debug > info in production mode, I don't think it is our problem. It is > theirs. Do you want to make it secure or do you want to discuss? -- Greetings Alex Aulbach -- PHP Internals

Re: [PHP-DEV] [PROPOSED] password_hash RFC - Implementing simplified password hashing functions

2012-07-13 Thread Alex Aulbach
2012/7/13 Ángel González : > The codebase does no global exception handling (because it doesn't throw > exceptions itself), > and also nobody configured the server not to show errors/exceptions > (some say it was > purposely setup to show them). > password_verify() "errors" if the parameters are no

Re: [PHP-DEV] [PROPOSED] password_hash RFC - Implementing simplified password hashing functions

2012-07-12 Thread Alex Aulbach
2012/7/12 Anthony Ferrara : > That's what $2y$ is for. It's a standard crypt() prefix algorithm > identifier. For example you can use $1$ for md5, $5$ for sha256 and $6$ for > sha512 algorithms. In the future, if new algorithms are added, it would be > added as a new prefix for crypt()... Ya, didn

Re: [PHP-DEV] [PROPOSED] password_hash RFC - Implementing simplified password hashing functions

2012-07-12 Thread Alex Aulbach
2012/7/12 Nikita Popov : > On Thu, Jul 12, 2012 at 7:24 PM, Alex Aulbach wrote: >> 1. The resulting string should have a version information. For example >> the first char. the example hash will look like >> "1$2y$07$usesomesillystringfore2uDLvp1Ii2e./U9C8sBjqp8I90dH6

Re: [PHP-DEV] [PROPOSED] password_hash RFC - Implementing simplified password hashing functions

2012-07-12 Thread Alex Aulbach
2012/7/12 Anthony Ferrara : > Hello all, > > Since the discussion has died down around the concept, I have updated the > RFC and moved it into Proposed (under discussion) status. > > I have updated the RFC to include a section on discussion points containing > points that I know were raised but I f