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
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
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
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
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
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
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
Nuked luballomuyoyo
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
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
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,
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
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
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
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
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 {
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 -
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
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
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
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
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:
> >
> >
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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
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,
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:
>>
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()
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
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
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
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
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
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
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
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
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
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
>>
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
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.
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
> 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
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
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
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
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
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
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
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
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
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
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
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
rasmus approved michaelhood account request \o/
--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php
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
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
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-
> 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
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
发自我的 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
>
> 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
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
> 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
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
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
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
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
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
What about expanding the syntax instead of introducing new reserved words.
use A\B {
Class1,
Class2
}
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
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/
84 matches
Mail list logo