[PHP-DEV] Working with floats

2012-07-24 Thread Kingsquare.nl - Robin Speekenbrink
Hi all, First of all, let me state that the following question is probably going to shun me forever due to the 'basic' nature of the question and the probable misunderstanding of floats in general, but still this got me baffled and i'd like to post this here: Why does the last of the followi

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

2012-07-24 Thread Stas Malyshev
Hi! > For finally see https://bugs.php.net/bug.php?id=32100 > > it seems that the core devs don't like the idea, but that feature request > seems to have a lot of supporters, and comes up frequently. I haven't seen it come with a pull req though ;) BTW, look at how finally is implemented in Java

Re: [PHP-DEV] Working with floats

2012-07-24 Thread Ronald Chmara
Your CompSci education (or lack thereof) has failed you. Use the source. Floats behave differently under different conditions. -Ronabop -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

[PHP-DEV] VCS Account Request: luballomuyoyo

2012-07-24 Thread Jacob Luballo Muyoyo
Developing the PHP runtime Maintaining an official, bundled PHP extension Maintaining www.php.net Maintaining the documentation Translating the documentation -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www

Re: [PHP-DEV] Working with floats

2012-07-24 Thread Galen Wright-Watson
On Tue, Jul 24, 2012 at 1:01 AM, Kingsquare.nl - Robin Speekenbrink < ro...@kingsquare.nl> wrote: > Hi all, > [...] > > Why does the last of the following examples lower my key to 18 BUT does > the var dump of the float clearly state 'float(19)' as the actual value: [...] > $i =(fl

Re: [PHP-DEV] Working with floats

2012-07-24 Thread Kingsquare.nl - Robin Speekenbrink
Thanks for the reply. I know of the fact that converting the key to a string would be the 'correct' way of using it, i was more curious as to the difference in the var_dump-s... But the precision setting is new to me, i'll have a look into that... That would indeed make the differences in the

Re: [PHP-DEV] Internal iteration API

2012-07-24 Thread jpauli
On Sat, Jul 14, 2012 at 2:35 AM, Stas Malyshev wrote: > Hi! > >> So, I've not been inside the engine so in practice this may make no >> sense at all, but what about looking at it the other way around? Vis, >> instead of making objects more and more like arrays, make arrays an >> object that happe

[PHP-DEV] VCS Account Rejected: luballomuyoyo rejected by bjori

2012-07-24 Thread PHP Group
Nuked luballomuyoyo -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.php.net/unsub.php

Re: [PHP-DEV] VCS Account Request: luballomuyoyo

2012-07-24 Thread Hannes Magnusson
On Tue, Jul 24, 2012 at 9:35 AM, Jacob Luballo Muyoyo wrote: > Developing the PHP runtime Maintaining an official, bundled > PHP extension Maintaining > www.php.net Maintaining the > documentation Translating the documentation > > Please get in co

Re: [PHP-DEV] RFC Proposal - Attributes read/write visibility

2012-07-24 Thread André Rømcke
On 7/23/12 12:38 PM, "Amaury Bouchard" mailto:ama...@amaury.net>> wrote: 2012/7/23 André Rømcke mailto:andre.rom...@ez.no>> I think these two proposals can be synced up, what if: public readonly $a; Is shorthand for: public $a { get; protected set; } And when no function is defined,

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

2012-07-24 Thread Galen Wright-Watson
On Sun, Jul 22, 2012 at 9:08 PM, Sanford Whiteman < swhitemanlistens-softw...@cypressintegrated.com> wrote: > [...] > You do raise (maybe on purpose, not totally clear what you were > getting at) the question of whether a more complex (expr1) in one of > these theoretical ternarys w/implicit isset

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

2012-07-24 Thread Galen Wright-Watson
On Sun, Jul 22, 2012 at 8:12 PM, Alex Aulbach wrote: > Do we really need that as operator? Why not using new functions for > special cases. > There isn't a need in the sense that such an operator makes things possible that otherwise aren't possible. There is a need in that there are common use ca

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

2012-07-24 Thread Laruence
On Tue, Jul 24, 2012 at 4:32 PM, Stas Malyshev wrote: > Hi! > >> For finally see https://bugs.php.net/bug.php?id=32100 >> >> it seems that the core devs don't like the idea, but that feature request >> seems to have a lot of supporters, and comes up frequently. > > I haven't seen it come with a pu

[PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Laruence
Hi: As the previous threads disscussed, I make a implemention. here is the RFC: https://wiki.php.net/rfc/finally any suggestions? thanks -- Laruence Xinchen Hui http://www.laruence.com/ -- PHP Internals - PHP Runtime Development Mailing List To unsubscribe, visit: http://www.ph

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Alexey Zakhlestin
On 24.07.2012, at 15:20, Laruence wrote: > Hi: >As the previous threads disscussed, I make a implemention. > >here is the RFC: https://wiki.php.net/rfc/finally > >any suggestions? Will it work without "catch" in your implementation? try { doSomethingDangerous(); } finally {

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Paul Dragoonis
On Tue, Jul 24, 2012 at 12:20 PM, Laruence wrote: > Hi: > As the previous threads disscussed, I make a implemention. > > here is the RFC: https://wiki.php.net/rfc/finally > > any suggestions? > > thanks > > -- > Laruence Xinchen Hui > http://www.laruence.com/ > > -- > PHP Internals -

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Laruence
On Tue, Jul 24, 2012 at 7:41 PM, Alexey Zakhlestin wrote: > > On 24.07.2012, at 15:20, Laruence wrote: > >> Hi: >>As the previous threads disscussed, I make a implemention. >> >>here is the RFC: https://wiki.php.net/rfc/finally >> >>any suggestions? > > Will it work without "catch" in

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Rick WIdmer
On 7/24/2012 5:45 AM, Laruence wrote: On Tue, Jul 24, 2012 at 7:41 PM, Alexey Zakhlestin wrote: On 24.07.2012, at 15:20, Laruence wrote: Will it work without "catch" in your implementation? nope for now. but if it is needed, I can implemente it Yes, please. -- PHP Internals - PHP Runtime

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Rafael Kassner
Thanks Laruence. If I perform something like this: function test() { try { return 2; } catch (Exception $e) { } finally { return 3; } } What will be returned? There is no possibility to return something in finally, or finally will overwrite the return? On Tue, Ju

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Sebastian Krebs
Hi, What should a return value in 'finally' mean? Regards, Sebastian 2012/7/24 Rafael Kassner > Thanks Laruence. > > If I perform something like this: > > function test() { > try { > return 2; > } catch (Exception $e) { > } finally { > return 3; > } > } > > What

[PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Sebastian Krebs
Sorry ... to the list instead. -- Forwarded message -- From: Sebastian Krebs Date: 2012/7/24 Subject: Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions To: Laruence Hi, 2012/7/24 Laruence > On Tue, Jul 24, 2012 at 7:41 PM, Alexey Zakhlestin > wrote: > > > >

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Xinchen Hui
Sent from my iPhone 在 2012-7-24,19:51,Rafael Kassner 写道: Thanks Laruence. If I perform something like this: function test() { try { return 2; } catch (Exception $e) { } finally { return 3; } } What will be returned? There is no possibility to return something i

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Nikita Popov
On Tue, Jul 24, 2012 at 1:20 PM, Laruence wrote: > Hi: > As the previous threads disscussed, I make a implemention. > > here is the RFC: https://wiki.php.net/rfc/finally > > any suggestions? The finally clause comes with a very strong promise that the code in the clause will run in a

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Levi Morrison
On Tue, Jul 24, 2012 at 7:35 AM, Nikita Popov wrote: > On Tue, Jul 24, 2012 at 1:20 PM, Laruence wrote: >> Hi: >> As the previous threads disscussed, I make a implemention. >> >> here is the RFC: https://wiki.php.net/rfc/finally >> >> any suggestions? > > The finally clause comes wit

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Andrew Faulds
On 24/07/12 14:40, Levi Morrison wrote: On Tue, Jul 24, 2012 at 7:35 AM, Nikita Popov wrote: On Tue, Jul 24, 2012 at 1:20 PM, Laruence wrote: Hi: As the previous threads disscussed, I make a implemention. here is the RFC: https://wiki.php.net/rfc/finally any suggestions? Th

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Johannes Schlüter
On Tue, 2012-07-24 at 19:20 +0800, Laruence wrote: > Hi: > As the previous threads disscussed, I make a implemention. > > here is the RFC: https://wiki.php.net/rfc/finally > > any suggestions? > > thanks As PHP has destructors there is less need for "finally" compared to other lang

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Andrew Faulds
On 24/07/12 14:48, Johannes Schlüter wrote: On Tue, 2012-07-24 at 19:20 +0800, Laruence wrote: Hi: As the previous threads disscussed, I make a implemention. here is the RFC: https://wiki.php.net/rfc/finally any suggestions? thanks As PHP has destructors there is less need fo

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Johannes Schlüter
On Tue, 2012-07-24 at 14:50 +0100, Andrew Faulds wrote: > > As PHP has destructors there is less need for "finally" compared to > > other languages. What are the cases where an extra language construct is > > needed? (i.e. one can also use C++-like RAII things ...) > > > > The RFC is also missing t

Re: [PHP-DEV] RFC Proposal - Attributes read/write visibility

2012-07-24 Thread Amaury Bouchard
Yes, the two proposals can definitely work together. See my initial message: class A { // $str has public reading and private writing, // and manage french quotes public:private $str { get { return "«" . $this->str . "»"; } set { $this->str = tri

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Anthony Ferrara
Johannes, On Tue, Jul 24, 2012 at 9:48 AM, Johannes Schlüter wrote: > On Tue, 2012-07-24 at 19:20 +0800, Laruence wrote: > > Hi: > > As the previous threads disscussed, I make a implemention. > > > > here is the RFC: https://wiki.php.net/rfc/finally > > > > any suggestions? > > > > t

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Johannes Schlüter
On Tue, 2012-07-24 at 10:37 -0400, Anthony Ferrara wrote: > > If you went by "possible", half the proposals for the language > wouldn't be accepted (password hashing, generators, goto, Class name > to scalar resolution, T_AS for closures, type hints, call-time > dereferencing, traits, classes, etc

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Laruence
On Tue, Jul 24, 2012 at 9:35 PM, Nikita Popov wrote: > On Tue, Jul 24, 2012 at 1:20 PM, Laruence wrote: >> Hi: >> As the previous threads disscussed, I make a implemention. >> >> here is the RFC: https://wiki.php.net/rfc/finally >> >> any suggestions? > > The finally clause comes wit

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Rasmus Lerdorf
On 07/24/2012 06:35 AM, Nikita Popov wrote: > On Tue, Jul 24, 2012 at 1:20 PM, Laruence wrote: >> Hi: >> As the previous threads disscussed, I make a implemention. >> >> here is the RFC: https://wiki.php.net/rfc/finally >> >> any suggestions? > > The finally clause comes with a very

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Andrew Faulds
On 24/07/12 16:16, Rasmus Lerdorf wrote: On 07/24/2012 06:35 AM, Nikita Popov wrote: On Tue, Jul 24, 2012 at 1:20 PM, Laruence wrote: Hi: As the previous threads disscussed, I make a implemention. here is the RFC: https://wiki.php.net/rfc/finally any suggestions? The finally

[PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Reeze
Hi, internals, I'm proposing a improvement to namespace importing. when using 'use' statement to import many classes, we have to duplicate many times even we are importing from the same namespace. I propose a new syntax to import classes\functions\constant in a single statement. here is the e

Re: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Andrew Faulds
On 24/07/12 16:35, Reeze wrote: Hi, internals, I'm proposing a improvement to namespace importing. when using 'use' statement to import many classes, we have to duplicate many times even we are importing from the same namespace. I propose a new syntax to import classes\functions\constant in a

[PHP-DEV] 回复: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Reeze
Hi Andrew, 在 2012年7月24日星期二,下午11:39,Andrew Faulds 写道: > On 24/07/12 16:35, Reeze wrote: > > Hi, internals, > > I'm proposing a improvement to namespace importing. when using 'use' > > statement to import > > many classes, we have to duplicate many times even we are importing from > > the same na

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

2012-07-24 Thread Alex Aulbach
2012/7/24 Galen Wright-Watson : >> Don't see much difference between >> >> $a = $b ?: $c; >> >> and (for example I used "i" for "if") >> >> $a = _i($b, $c); > > > When $b is defined, there isn't much appreciable difference. However, this > behavior already exists, so there isn't much to debate. In

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

2012-07-24 Thread Yahav Gindi Bar
On 24 ביול 2012, at 19:18, Alex Aulbach wrote: > 2012/7/24 Galen Wright-Watson : >>> Don't see much difference between >>> >>> $a = $b ?: $c; >>> >>> and (for example I used "i" for "if") >>> >>> $a = _i($b, $c); >> >> >> When $b is defined, there isn't much appreciable difference. However,

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Laruence
Hi: try{}finally{} implemented, https://github.com/laruence/php-src/commit/90cad0a0001ef48396146c69382a25ebe0a60474 the test scripts in that commit are examples thanks On Tue, Jul 24, 2012 at 7:41 PM, Alexey Zakhlestin wrote: > > On 24.07.2012, at 15:20, Laruence wrote: > >> Hi: >>

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Nikita Popov
On Tue, Jul 24, 2012 at 5:16 PM, Rasmus Lerdorf wrote: >> The finally clause comes with a very strong promise that the code in >> the clause will run in absolutely any case (short of sigkill, maybe). > > No it doesn't, at least not in Java. A fatal Java error or an explicit > call to System.exit()

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

2012-07-24 Thread Alex Aulbach
2012/7/24 Yahav Gindi Bar : > I don't think global operators is good idea since it can make a script very > complex and you'll have to learn many operators in case the one who wrote it > decided to make it "operator driven" On the other hand: If those operators aren't global, then they are local

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Rasmus Lerdorf
On 07/24/2012 10:01 AM, Nikita Popov wrote: > Another, separate point against finally is that in PHP (unlike many > other languages) most (all?) built-in resources clean up after > themselves. So if you open a file you don't have to worry about > closing it again. It'll do that all by itself as so

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Paul Dragoonis
On Tue, Jul 24, 2012 at 6:20 PM, Rasmus Lerdorf wrote: > On 07/24/2012 10:01 AM, Nikita Popov wrote: > >> Another, separate point against finally is that in PHP (unlike many >> other languages) most (all?) built-in resources clean up after >> themselves. So if you open a file you don't have to wor

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Nikita Popov
On Tue, Jul 24, 2012 at 7:25 PM, Paul Dragoonis wrote: > I have had to workaround stuff in my PHP apps because of a lack of > finally{} block, and I hope it makes its way into the next iteration. I think it would add a lot to this discussion if you could show us what real-life use case you have t

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Stas Malyshev
Hi! > In particular this means that... > ... if a die() is execute somewhere in the try clause (or a called > function) the finally clause must still be run. > ... if a parse error or other fatal error occurs in the try clause (or > called function) the finally clause must still be run. > ... if t

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

2012-07-24 Thread Alex Aulbach
2012/7/23 Sara Golemon : > Curious if you could expand on that. Generators are iterators, so not sure > what you're asking for. It's the point which is unlogical for me. Maybe it's a question. If the generator is an object with the implementation of an iterator, why do we need to have it as _func

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Andrew Faulds
On 24/07/12 18:31, Stas Malyshev wrote: Hi! In particular this means that... ... if a die() is execute somewhere in the try clause (or a called function) the finally clause must still be run. ... if a parse error or other fatal error occurs in the try clause (or called function) the finally cla

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

2012-07-24 Thread Andrew Faulds
On 24/07/12 18:34, Alex Aulbach wrote: 2012/7/23 Sara Golemon : Curious if you could expand on that. Generators are iterators, so not sure what you're asking for. It's the point which is unlogical for me. Maybe it's a question. If the generator is an object with the implementation of an iterat

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Stas Malyshev
Hi! > PHP risks losing some of its uniqueness to fixing things, unfortunately. > But losing bad features and moving forward is good, right? I'm not sure what you are talking about here, but I'm sure I can not accept argument "Python does it this way, so we must do it exactly the same way even i

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

2012-07-24 Thread Yahav Gindi Bar
On 24 ביול 2012, at 20:35, Andrew Faulds wrote: > On 24/07/12 18:34, Alex Aulbach wrote: >> 2012/7/23 Sara Golemon : >>> Curious if you could expand on that. Generators are iterators, so not sure >>> what you're asking for. >> It's the point which is unlogical for me. Maybe it's a question. If >>

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Andrew Faulds
On 24/07/12 18:38, Stas Malyshev wrote: Hi! PHP risks losing some of its uniqueness to fixing things, unfortunately. But losing bad features and moving forward is good, right? I'm not sure what you are talking about here, but I'm sure I can not accept argument "Python does it this way, so we

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Stas Malyshev
On 7/24/12 4:20 AM, Laruence wrote: > Hi: > As the previous threads disscussed, I make a implemention. > > here is the RFC: https://wiki.php.net/rfc/finally I'm not seeing tests for the following situations: 1. Return from catch block. 2. Another try/catch block inside finally block. 3.

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

2012-07-24 Thread Yahav Gindi Bar
On 24 ביול 2012, at 20:15, Alex Aulbach wrote: > 2012/7/24 Yahav Gindi Bar : >> I don't think global operators is good idea since it can make a script very >> complex and you'll have to learn many operators in case the one who wrote it >> decided to make it "operator driven" > > On the other h

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

2012-07-24 Thread Sanford Whiteman
> My feeling is that either more complex expressions for operators with an > implicit "isset" or "!empty" shouldn't work, or that they should cause > notices. That's exactly why I think we're going in the wrong direction by speaking of an "alternate ternary" operator. You're saying the basic ter

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

2012-07-24 Thread Alex Aulbach
2012/7/24 Andrew Faulds : > Much easier to make an iterator with a function than as a class. 2012/7/24 Yahav Gindi Bar : > I agree, implementing a class only for iterator may be pain sometimes, and > functions is much better - especially when 5.3 got the anonymous functions, > so we can even use

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

2012-07-24 Thread Andrew Faulds
On 24/07/12 18:56, Alex Aulbach wrote: 2012/7/24 Andrew Faulds : Much easier to make an iterator with a function than as a class. 2012/7/24 Yahav Gindi Bar : I agree, implementing a class only for iterator may be pain sometimes, and functions is much better - especially when 5.3 got the anony

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

2012-07-24 Thread Yahav Gindi Bar
You could introduce new keyword for generator... even call it "generator" but why (its kind of "design" issue...)? if the syntax that one should use in order to implement the generator is just like a function, but using yield keyword in order to return the items to store? As long as I know, mos

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

2012-07-24 Thread Andrew Faulds
On 24/07/12 19:06, Yahav Gindi Bar wrote: You could introduce new keyword for generator... even call it "generator" but why (its kind of "design" issue...)? if the syntax that one should use in order to implement the generator is just like a function, but using yield keyword in order to return

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

2012-07-24 Thread Alex Aulbach
2012/7/24 Yahav Gindi Bar : > Yeah, that's a design decision, but its important because that's one of the > PHP greatest things - the code is very nice and readable, and it's kind of > sad to ruin it... > > I didn't thought about template engines - I agree, it'll be great there, but > does a lan

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

2012-07-24 Thread Alex Aulbach
2012/7/24 Andrew Faulds : > But PHP functions usually have side-effects, they aren't strict mathematical > functions. Ah, you might mean str_tok()? Are there more, do you have a list? But we're in PHP-programming-context. You write a function in PHP, you call it and it will return once called. I

Re: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Stas Malyshev
Hi! > from GlobalNamespace\SubSpace\ThirdSace use Class1, Class2 as Alias2, > ForthSpace\Class3 as Alias3; I'm not sure it's necessary. If you import a real lot of the classes from the same namespace, just import the parent namespace. And this syntax makes less clear what is the true name of Cla

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

2012-07-24 Thread Andrew Faulds
On 24/07/12 19:32, Alex Aulbach wrote: 2012/7/24 Andrew Faulds : But PHP functions usually have side-effects, they aren't strict mathematical functions. Ah, you might mean str_tok()? Are there more, do you have a list? But we're in PHP-programming-context. You write a function in PHP, you call

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

2012-07-24 Thread Gustavo Lopes
Em Tue, 24 Jul 2012 19:56:46 +0200, Alex Aulbach escreveu: 2012/7/24 Andrew Faulds : Much easier to make an iterator with a function than as a class. 2012/7/24 Yahav Gindi Bar : I agree, implementing a class only for iterator may be pain sometimes, and functions is much better - especial

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Stas Malyshev
Hi! > Still my point stands. If fatal errors and die are not handled by > finally the feature does not make sense to me. You simply can't do any > kind of remotely important cleanup in there (like releasing locks > etc). Well, I'm sorry you don't understand it but I think you are too focused on e

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

2012-07-24 Thread Alex Aulbach
2012/7/24 Andrew Faulds : > PHP is not LISP. Hey, I don't want to have LISP. I just want to make complicated things more clear, and it doesn't matter, if something else is right or wrong in the past. It isn't difficult to make a new keyword or something wich disticts it a little bit more for that

[PHP-DEV] Re: VCS Account Request: michaelhood

2012-07-24 Thread PHP Group
rasmus approved michaelhood account request \o/ -- 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
2012/7/24 Gustavo Lopes : > When you have function foo() { ... yield /* ... */; ... } and > you call foo(), you get the same thing every time: a Generator object. It so > happens that the implementation of that object is inside the body of the > function. Hmmm. It's not that I didn't understand it

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

2012-07-24 Thread Andrew Faulds
On 24/07/12 20:13, Alex Aulbach wrote: 2012/7/24 Gustavo Lopes : When you have function foo() { ... yield /* ... */; ... } and you call foo(), you get the same thing every time: a Generator object. It so happens that the implementation of that object is inside the body of the function. Hmmm. It

[PHP-DEV] Re: [PHP-CVS] del php-src: .travis.yml LICENSE Makefile.gcov NEWS README.md UPGRADING UPGRADING.INTERNALS Zend/tests/bug18556.phpt Zend/tests/bug60738.phpt Zend/tests/bug61681.phpt Zend/test

2012-07-24 Thread Johannes Schlüter
Hi, for some reason master was merged into the PHP-5.4 branch. I undid this change in the repo. If you pulled in between your next pull should result in an error. Use git reset --hard origin/PHP-5.4 to reset your local checkout to the current version on the server. johannes On Wed, 2012-07-

Re: [PHP-DEV] Re: [PHP-CVS] del php-src: .travis.yml LICENSE Makefile.gcov NEWS README.md UPGRADING UPGRADING.INTERNALS Zend/tests/bug18556.phpt Zend/tests/bug60738.phpt Zend/tests/bug61681.phpt Zend/

2012-07-24 Thread Sean Coates
> Use > git reset --hard origin/PHP-5.4 > to reset your local checkout to the current version on the server. It should be noted that when you `reset --hard`, you'll lose local changes (including branch commits, except in the reflog). You'll probably want to stash first, reset, then stash pop

Re: [PHP-DEV] Re: [PHP-CVS] del php-src: .travis.yml LICENSE Makefile.gcov NEWS README.md UPGRADING UPGRADING.INTERNALS Zend/tests/bug18556.phpt Zend/tests/bug60738.phpt Zend/tests/bug61681.phpt Zend/

2012-07-24 Thread Johannes Schlüter
On Tue, 2012-07-24 at 20:34 -0400, Sean Coates wrote: > > Use > > git reset --hard origin/PHP-5.4 > > to reset your local checkout to the current version on the server. > > It should be noted that when you `reset --hard`, you'll lose local > changes (including branch commits, except in the refl

Re: [PHP-DEV] [RFC] Supports 'finally' keyword for PHP exceptions

2012-07-24 Thread Xinchen Hui
发自我的 iPad 在 2012-7-25,1:50,Stas Malyshev 写道: > On 7/24/12 4:20 AM, Laruence wrote: >> Hi: >>As the previous threads disscussed, I make a implemention. >> >>here is the RFC: https://wiki.php.net/rfc/finally > > I'm not seeing tests for the following situations: > 1. Return from catch blo

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

2012-07-24 Thread Sara Golemon
> > Or when you have programming errors, when you write > > function blubb() > { > ... yields... > ... > ... return > } > > (you may only see the "return"). > > But that's okay, because PHP *does* see both, and it tells you "yield may not be used with return" in a lovely little parser error. S

[PHP-DEV] 回复: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Reeze Xia
Hi Stas, 在 2012年7月25日星期三,上午2:33,Stas Malyshev 写道: > Hi! > > > from GlobalNamespace\SubSpace\ThirdSace use Class1, Class2 as Alias2, > > ForthSpace\Class3 as Alias3; > > I'm not sure it's necessary. If you import a real lot of the classes > from the same namespace, just import the parent na

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

2012-07-24 Thread Sherif Ramadan
> On 24/07/12 19:32, Alex Aulbach wrote: >> >> 2012/7/24 Andrew Faulds : >>> >>> But PHP functions usually have side-effects, they aren't strict >>> mathematical >>> functions. >> >> Ah, you might mean str_tok()? Are there more, do you have a list? >> >> But we're in PHP-programming-context. You wr

Re: [PHP-DEV] Internal iteration API

2012-07-24 Thread Larry Garfield
On 07/24/2012 03:52 AM, jpauli wrote: On Sat, Jul 14, 2012 at 2:35 AM, Stas Malyshev wrote: Hi! So, I've not been inside the engine so in practice this may make no sense at all, but what about looking at it the other way around? Vis, instead of making objects more and more like arrays, make

Re: [PHP-DEV] Re: [PHP-CVS] del php-src: .travis.yml LICENSE Makefile.gcov NEWS README.md UPGRADING UPGRADING.INTERNALS Zend/tests/bug18556.phpt Zend/tests/bug60738.phpt Zend/tests/bug61681.phpt Zend/

2012-07-24 Thread Stas Malyshev
Hi! > I wonder if anybody can suggest a way to detect such commits > automatically so we can catch them. `git diff` and others show nothing > of relevance. We could get some commit that is only in master (like NEWS edits, for example) and check for it - if it's ever pushed into 5.4 that's trouble

[PHP-DEV] Re: 回复: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Stas Malyshev
Hi! > No, we can not import namespace directly for now : Of course you can. You just missing on what namespace import means in PHP, it's not like Java (though a bit like Python). > namespace A { > class B {} > } > > namespace { > use A; > > var_dump(new B()); > } use A is a no-op, just a

Re: [PHP-DEV] Re: 回复: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Laruence
Hi: is there any really usage? I didn't see before. I don't think every python feature is proper for PHP. PHP is not python. -1 on this RFC +1 for Stas and one more thing, BC break. there are many ORM or DB warpper libraries defines `from` method, like: $db->select()->from(); thanks On We

[PHP-DEV] 回复: [PHP-DEV] Re: 回复: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Reeze Xia
Hi, 在 2012年7月25日星期三,下午1:27,Laruence 写道: > Hi: > > is there any really usage? I didn't see before. I don't think every Yes, eg: https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/EntityRepository.php#L24 it could be: from Doctrine\Common\Collections use ExpressionBuilder, Cri

Re: [PHP-DEV] 回复: [PHP-DEV] Re: 回复: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Leigh
What about expanding the syntax instead of introducing new reserved words. use A\B { Class1, Class2 }

[PHP-DEV] Re: 回复: [PHP-DEV] Re: 回复: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Laruence
On Wed, Jul 25, 2012 at 2:43 PM, Reeze Xia wrote: > Hi, > > 在 2012年7月25日星期三,下午1:27,Laruence 写道: > > Hi: > > is there any really usage? I didn't see before. I don't think every > > Yes, eg: > https://github.com/doctrine/doctrine2/blob/master/lib/Doctrine/ORM/EntityRepository.php#L24 > > it could be

Re: [PHP-DEV] 回复: [PHP-DEV] Re: 回复: [PHP-DEV] [RFC] Proposal namespace importing with from syntax

2012-07-24 Thread Laruence
On Wed, Jul 25, 2012 at 2:54 PM, Leigh wrote: > What about expanding the syntax instead of introducing new reserved words. > > use A\B { > Class1, > Class2 > } better than from :). and a little consistent with use traits in class thanks -- Laruence Xinchen Hui http://www.laruence.com/