« first day (1599 days earlier)      last day (3352 days later) » 

4:00 PM
I'm confused 😕
anyway, I guess you stopped using up2date after that :D
 
mornfternoon
 
@ircmaxell :P
@DaveRandom yo
 
Morndom
 
@FlorianMargaine yup
WTF is Zeev saying here? news.php.net/php.internals/84245
 
@ircmaxell I'm afraid I don't understand...
 
4:20 PM
imo, optimisation and caching should be two separate modules, to allow them to be pluggable
 
Morning
 
is the mandelbrot benchmark even important? zeev and dimitry said it had absolutely zero effect on the real world, which is the important part or not?
 
@ircmaxell couldn't you profile the code and write the result in a file to avoid dead code elimination?
 
"real world applications" suffers a bit from selection bias when everything else runs like shit
 
@FlorianMargaine you'd need to cache it
 
4:23 PM
@rdlowrey How simple is downloading a certain amount of a file with artax, then pausing the download until I finish some operation then either cancel or restarting it based on that operation?
 
I mean write in the file outside of the profiling
 
of course a vendors chosen synthetic benchmark is important when posturing
 
@beberlei it's important soley for the fact that they are claiming to beat GCC -O2, which isn't true
 
well, we can write other benchmarks, how about some prime sieves?
 
user895378
@Fabor $request->setHeader('Range', '0-1024'); // only send me back bytes 0-1024 of the file
 
user895378
@Fabor That only works if the server supports byte range requests.
 
@rdlowrey Can I continue if I want without redownloading?
Or perhaps throttle speeds...
 
user3949359
Hi everyone
 
user895378
@Fabor There is no concept of "continuation" in HTTP. It's your job to ask for the specific range of bytes you want.
 
user895378
So yes, you can continue, but it's your responsibility to know where you need to continue and ask specifically for that location in the file.
 
4:26 PM
@JoshWatzman you're going to be in NYC in 2 weeks?
 
Fair enough
 
user895378
There is currently no way to throttle download speed though.
 
Fair enough. Well range will have to do.
 
TIL that neither Java nor Python have an analogy to stream_copy_to_stream (memory mapped stream copies)
 
@ircmaxell It's been a while - but I thought you could do that with a stream wrapping a ByteBuffer, which does try to avoid unnecessary copies.
34
A: Wrapping a ByteBuffer with an InputStream

Mike HoustonThere seem to be some bugs with the implementation referred to by Thilo, and also copy and pasted on other sites verbatim: ByteBufferBackedInputStream.read() returns a sign extended int representation of the byte it reads, which is wrong (value should be in range [-1..255]) ByteBufferBackedInpu...

 
4:34 PM
@ircmaxell cant you compare the results without output?
i mean the results are irrelevant
 
@beberlei sure you can, just not with this test
@Danack it still requires copying the stream into local memory
 
user895378
openssl has been punching me in the face for the last ~24 hours.
 
user895378
Starting to get frustrated ...
 
4:50 PM
wow, digging through PHP's output layer... wow
such indirection. Such couping
 
@ircmaxell If you worked on HHVM, you'd see a lot more of PHP's warts as you try to mimic them. :(
 
yeah
I can imagine
I counted at least 10 layers of indirection between sprintf and the actual syscall
 
@Sara your tests seem to be wrong?
string(10) "100 apples"
string(10) "100 apples"
string(10) "100 apples"
string(10) "100 apples"
shouldn't there be some "100 applet" somewhere?
 
Isn't that what they should be?
Why?
 
@ircmaxell the fun thing is this also overwrites snprintf, so you expect some fast glibc function however it goes through that stack. i removed that code from xhprof extension to get some impressive performance boosts
 
4:54 PM
oh ffs
yeah
 
:-)
 
++$x treat non-well formed like non-numeric. $x++ ignore non-well formed
 
@Sara also, --$x seems to be ignored on php engine...
 
yay for HHVM being Somewhat sane
 
4:56 PM
@FlorianMargaine Yeah, as decrement should be
So okay, I misunderstood the problem (and should have used TDD) :p
That actually simplifies this, fortunately
 
@FlorianMargaine haha amazing
 
@Sara sorry, you'll have to recompile hhvm (see you tomorrow)
 
A build only takes me like 5 minutes
An tiny incremental like this, more like 30 seconds
 
after changing 3 lines?
ok
 
The linking step for a non-optimized debug build is redonkulous
In my defense, I wrote this diff on the plane :p
In ECONOMY
 
5:01 PM
let me think about accepting the defense or not
 
New diff up internally, should filter out in a few minutes
 
:-)
 
posted on March 03, 2015 by kbironneau

/* by dom//seb */

 
what is the blue gunk?
 
a magnetic fluid
 
5:07 PM
@floor silly putty with (probably) iron particles in it - thinkgeek.com/product/5ac8
 
isn't it a fluid containing iron splints and the block is magnetic? nvm
 
thats pretty cool regardless
 
That smart mass putty is actually pretty awesome if you suffer from RSI.
 
s/magnetic/ferro/ for my reply earlier
 
@Danack how so please explain
 
5:11 PM
RSI (for me at least) was caused by some of the tendons being too taut on the top-side of my arm, from holding my hand up over the mouse all day.. Having that stuff to squeeze allowed the tendons to on the bottom side to get a bit of a work out, which made them strong enough to balance out the top side tendons.
 
Votes cast: 53
Yes: 40 (75%)
No: 13 (25%)
 
19 people who voted no last time still to vote.....not that I'm counting.
 
user895378
I haven't voted yet.
 
@ircmaxell have you reached out to mwop to understand what the heck he was talking about in his email of his experience testing?
 
no, I let it go
because frankly we've talked it to death
 
5:14 PM
No shit.
 
and I'm tired of dealing with the misinformation and FUD
 
user895378
@Danack mwop?
 
@rdlowrey weir O'phinney - zend project guy.
 
user895378
oh sorry. I checked people.php.net and was like, "who is mwop?"
 
aka the guy who made my team lose a PHP trivia contest because he changed his twitter handle the week before the contest...
 
5:22 PM
that gif site successfully wasted about 15min of my time
 
>> So, let's put that to the test, shall we. I compiled and ran the "JIT" compiler (can we please stop calling it that, it's not).

> This is JIT!
lol
 
Huh, Brian Moon voted no on v5, but yes on v3. I wonder why.
 
5:45 PM
Zeev is keynoting at Tek this year "The PHP7 Story"
 
That'll be interesting.
 
6:05 PM
@ircmaxell yeah… hundreds of LOC executed for printing a single byte… It's insane and no wonder that it's slow.
 
@Sara can you send a mail explaining what a jit is, and why "zend jit" is not one? Anthony has just too much involvement with Zeev to be heard...
An external third party has to get involved there...
 
6:35 PM
@ircmaxell "My PHP7 Story", surely
 
hey, I got a question that pertains to php and any mv* js framework...
if I have a set of roles and permissions for a user
how can I give access to those permissions via something like angular
 
@Leigh yes, which still is an interesting keynote… It's his POV resumed…
 
I want to use angular for rendering the views
but lets say there is a button I only what shown to users that have permission
without using php to do a check like if(userHasPermission)
how can I securely give access to the button without php code controlling the view?
 
@floor FYI this room is called "PHP", not "without PHP" =P
 
I understand that
but php will be involved
just not in the view
and...
the javascript chat room is filled with garbage
6
 
6:52 PM
@floor You can't. If the validation is done client-side, and the client can not be trusted (clients can never be trusted), then you're boned. You need validation on both the client and the server.
 
@Charles alright thanks, do you have any experience with node?
@Charles I ask because how would node address the same problem?
 
@floor The problem is that the client and server need to have the same validation. Switching which technologies is used by either will not change this.
 
@Charles thanks
 
@floor you got a perfectly workable answer.
create a REST api and call into it from the client.
 
^^ That is the correct answer, just you have to have validation of permissions in both places.
The last thing you want is someone coming along with their JS debugger open and switching the local permissions flags on and suddenly seeing that you do unvalidated requests to the API....
 
7:03 PM
@marcio Sadly. I really think it is not the RFC we need.
 
@LeviMorrison I changed my mind. You still hate it because of the ''declare'' or is it something else?
 
Assuming I'm up-to-date in my head, declare is livable. It's top of file, no block declare right?
 
correct
 
It's the general strategy I am concerned with.
I sincerely think PHP should have unified scalar type behavior.
The real answer lies somewhere between our current weak mode and the proposed strict.
 
@LeviMorrison so, you want what Zeev proposed or some variation of it?
 
7:08 PM
I'll be honest; there has been so much email I am not current at all on Zeev's proposal.
 
I don't believe that's possible without breaking everything, which is why I don't propose it. I think that those types and scale of breaks are really problematic
 
@LeviMorrison Just read the RFC.
 
I think our general type juggling and conversions are problematic, with explicit scalar types or without them.
And you are right, the BC breaks might be too big.
I think some of them at least are doable.
 
how do you clean those without breaking everything?
 
@ircmaxell evolution only has a limited reach… Sometimes revolutions are necessary. But I'm still not sure if this is a candidate for a revolution…
 
7:11 PM
@ircmaxell Probably cannot be done.
 
@bwoebi def agree. However are we willing to put up with a potential fork (after all, that's the risk when you try a revolution)
 
If my choices are 1) do strict and weak typing and 2) no explicit scalar types I'm honestly leaning towards the latter.
 
that's 100% acceptable IMO
 
@ircmaxell Or you just get stuck (like Py 2/3)
 
@bwoebi which is effectively a fork
 
7:13 PM
Sometimes I think we are all playing with fire with this design by RFC process. The community is also too BC break allergic and we keep piling things up without a lot of planning (even though we try to, politics interfere too much). In part I agree with @LeviMorrison.
 
I also don't want to have to test and define behavior for future features if there are both weak and strict semantics.
 
So, I had an interview with a company, who relatively recently migrated their codebase from 5.2 to 5.3 (and no plans to go further right now) ... do I suggest I can help them get back onto supported versions, or just come straight out and say it's a deal breaker?
 
@Leigh How much do you know about their migration?
Do they have unit tests? Integration tests? System tests?
 
nothing apart from the version numbers, and it took "significant time and effort"
 
@ircmaxell depends on your definition of fork, but yes.
 
7:15 PM
if it's a deal breaker for you then come straight out and tell them that, if it isn't don't
 
@Leigh say it's a deal breaker if they aren't willing to keep going as a priority to a supported version
 
and I don't know their test coverage, but they run CI
I'm just imagining how much it's going to suck, spending free time working on stuff with 7.0 features, then not being able to use any of them at work :p
which was also the case at the job I just quit
I think a lot of people fall back to the fact that LTS distros commit to supporting certain versions :/
 
@ircmaxell Also… I wonder… if it's possible to just slowly deprecate and then drop support one feature after the other. Like dropping strings which aren't purely numeric for int/float now … until we achieved our wished zpp rules. (e.g. over a period of a whole major). And soft deprecate now.
 
@Leigh When we started migrating from 5.0.x off to a modern version, we ended up targeting 5.3. By the time we were done, 5.6 was out, and we were running on it instead. Honestly though, just the migration to 5.3 was enough modernization to make the migration to 5.6 almost painless in comparison...
 
all this conversion rule stuff should just be E_STRICT
 
7:22 PM
@Charles indeed, 5.2 to 5.3 is the big one
 
@bwoebi possibly...
 
@Leigh Yeah, with the addition of all the deprecated stuff to clean up. You're also probably right about the whole LTS distro thing.
 
@ircmaxell in a way that projects which only are slowly modernized (e.g. an update every 3 years) still don't have to update all the things when they update.
 
@LeviMorrison according to my experience with the proposed patch, you won't need to do that.
 
@bwoebi I'm not worried about those classes of projects
 
7:24 PM
@NikiC traits are our darkest corner in terms of poor design choices, the conflict resolution syntax has too much ambiguities to my taste and it seems to unfold everyday :/
 
product companies dont have the problem, all those agencies with hundrets or thousands of wordpress, drupal, typo3, magento installations
 
@ircmaxell A lot of projects update e.g. when LTS support of their distro slowly ends and then bump two or three minors forward.
 
@marcio well, those and namespaces :)
 
That we need to care about too I think.
 
@bwoebi those still aren't the ones I worry about. The ones I worry about are those who don't upgrade at all. Which is like 75% of projects...
 
7:26 PM
On the subject of versioning. Was the name PHP 6 skipped due to a failed attempt back in 2010 and potentially cause confusion? Or are we attempting a Microsoft, and just plan skipping major releases?
 
Microsoft copied PHP
 
@ircmaxell well. yeah. But there we can't change anything.
 
because they want to be in the cool club
 
@Leigh I'm okay with namespaces now that we piled sugar on top of it :D
 
@bwoebi we can not make it any harder than it is to get them to upgrade
 
7:28 PM
@marcio I just really dislike the implementation detail: How do you put a function in a namespace? Well you just put "some\string\" in front of the function name, done.
 
Can anyone help me with this problem: stackoverflow.com/questions/28840200/…
 
@Leigh haha fair enough.
 
@WilliamGeorge It was to make sure there was no confusion with the previous 6 attempt
 
@ircmaxell Sure. I just wonder how many of these projects really tried to upgrade at all and then aborted because it was too hard.
 
There's countless articles and even books relating to PHP 6, and all of that information is just plain incorrect if you apply it to what is now PHP 7
 
7:31 PM
@Leigh yea, it's just automated copy & paste with no chance of fixing.
 
Traits? yea :)
 
@ircmaxell I doubt it's any significant number… but feel free to show me the opposite :-)
 
@WilliamGeorge Microsofts version skip isn't without logical reason - there's a lot of software that detects Windows 95/98 versions by just looking for the 9
 
@bwoebi personal experience says it is significant, but I have nothing but anicdotal evidence. So I'll drop it
 
That makes sense then. I saw the votes were quite unanimous.
 
7:33 PM
 
@AllenJB oh, so they didn't skip it so the consumer wouldn't have to.
 
Hi guys!
 
@ircmaxell Did they try at all or just don't want to invest any effort in or just don't care?
 
@Leigh no, namespaces, but it applies to traits :)
 
Could somebody helpme with this: stackoverflow.com/questions/28840318/…
 
7:34 PM
@taco thats neat.
 
i'm trying to send an attach by email with phpmailer
 
@marcio Not sure about "no chance of fixing", no chance for 7.0, sure
 
@bwoebi tried, failed, and simply reverted
 
    if (osName.startsWith("Windows 9")) {
        process = runtime.exec("command.com /c echo %windir%");
    } else {
        process = runtime.exec("cmd.exe /c echo %windir%");
    }
That's just one example from that link....
 
@user4220812 The error message is a pretty huge clue. I suggest you start with that.
 
7:35 PM
@user4220812 You have a typo > != ->
 
Can Cronjobs be setup to run(call) only a specific PHP Function within a php file?
 
@Leigh you think there is fixing for it without BC breaking the world, that's good to hear. I'm not passionate enough to try, hope somebody is.
 
@Danack a typo > != ->?
 
@marcio I don't have the willpower to see how other languages do it :/
 
@Leigh most languages do it on scope level, so namespaces are like real packages.
 
7:39 PM
@ircmaxell For projects >= 5.3? Or crossing the border of 5.3?
 
@user4220812 try $mail­->addAttachment
 
@bwoebi both
also 4->5.0, 5.0->5.2, etc
 
@ircmaxell well… if they fail upgrading from 5.3 up… Not sure what they do wrong…
 
@WilliamGeorge i have it but it doesn't work $mail - ­>addAttachment('consultInfo/pro/pro107.pdf);
 
@user4220812 you are missing a - in between $mail and >add
 
7:44 PM
Good mornings
 
@JoeWatkins reading this Zend JIT LLVM implementation makes me glad we went with libjit...
 
@user4220812 try to play around with this example: github.com/PHPMailer/PHPMailer/blob/…
 
What's the difference?
ReflectionClass::newInstance() - Creates a new class instance from given arguments.
ReflectionClass::newInstanceArgs() - Creates a new class instance from given arguments.
 
@WilliamGeorge Thanks Will I'll try!
 
@VeeeneX Ones got the word args in it if nothing else.
 
7:51 PM
xD
Useful one
 
@VeeeneX same difference as call_user_func and call_user_func_array
 
newInstance - Accepts a variable number of arguments which are passed to the class constructor, much like <b>call_user_func</b>.
public function newInstance ($args = null, ...$args = null) {}

newInstanceArgs - The parameters to be passed to the class constructor as an array.
newInstanceArgs (array $args = null) {}
/dat formatting, and I don't even care.
 
Ou Now I understand
 
@VeeeneX Yep, same difference as call_user_func vs call_user_func_array.
 
oh no Yasuo Ohgaki really thinks that deprecating func_get_args would be a good move even if we only got variadics on 5.6.
 
7:56 PM
I'm trying to create IoC :D
 
@marcio it's IMO a good move. Just if it isn't hard depreciation.
 
@marcio Ha, he seems to like your RFC. Now do you see? ;-)
 
lol, that's mean
@bwoebi I assume he wants the hard deprecation because overlooking func_get_args and emitting E_DEPRECATE/E_STRICT is basically doing it, indirectly.
 
Whereas both Stas and Lester hate my RFC \o/
 
@marcio Yeah…
 
7:59 PM
/also mean
 
@Danack Lester disagrees? That's a great sign!
 
@Danack ^^ that's a good sign, undoubtedly. But I don't envy you at all, dealing with both at same time on the same ML thread.
 
@marcio They have no points that need to be addressed.....which makes it easier.
Bob was the only person who pointed out a valid concern (whether the exception when attempting to creating a PDORow object is correct).
 
@bwoebi I think Yasuo has a point with the E_DEPRECATE or E_STRICT, but I really prefer a warning for this case because consistency with what we already have.
(bug ignoring func_get_arg, no dice! maybe on PHP 7.1 or later)
 
@Danack Did you change it to private ctor now in RFC?
 
8:05 PM
@marcio presumably if frameworks wanted to support two versions of PHP that would require two methods?
 
@bwoebi Nope. I still think just throwing an exception is the sanest thing to do, and is also easiest.
 
If func_get_args was dropped.
public function myMethod(...$args);
public function myMethodArgs();
 
@Danack just fyi… instantiating a private ctor automatically throws an exception
with EngineExceptions now.
Then we have consistency with userland … plus it is an Exception.
 
Totally basic ioC xD pastie.org/9996867
 
@WilliamGeorge that's why we can't start dropping func_get_args, PHP 5.5 is too recent and the the dedicated variadic syntax is not part of it. We can't BC break this. That would be too much for now.
 
8:09 PM
@marcio Indeed, please vote no on the culling of func_get_args
 
@WilliamGeorge don't worry, this is not negotiable. I won't propose that ;)
 
@bwoebi There is possibly code out of there that hooks into the PDO code in an extension, that instantiates it with the internal data that it needs. As there's no real benefit to changing the constructor to be private rather than just throwing an exception, and a huge potential downside it's not worth it. Plus having it private would still have some magic, as internally the rest of the pdo code can skirt around that restriction.
 
@Danack I think a private ctor is much cleaner than the code sample I saw.
 
@kelunik But that code is what it's actually doing now.
 
It's slightly offtop, but does anyone of you know if I need to set constraint not null on the primary keys? or they are not null automatically
 
8:14 PM
@Danack Just assume we internally use reflection magic to instantiate it…
 
The RFC is trying to remove magic.....
 
Arh!, I have been away for too long. phpdbg I just installed xdebug :S
 
Is it difference ?
    $ReflectionClass = new \ReflectionClass($class);
    $constructor = $ReflectionClass->getConstructor();
    $parms = $this->getParameters($constructor);
    var_dump($parms);

    $refMethod = new \ReflectionMethod($class,  '__construct');
    $params = $refMethod->getParameters();
    var_dump($parms);
 
@VeeeneX I think the difference is that PHP4 style constructors still exist....so it could be called something other than __construct
 
@redCodeAlert afaik mysql and postgresql will treat them as not null implicitly, but there's no reason to not be explicit about it
 
8:17 PM
@Danack Also, where is the downside there!?
 
@Danack So I can use shorter version right?
 
@PaulCrovella thank you
 
@bwoebi Do you mean apart from introducing magic in an RFC trying to get rid of magic, or do you mean doing something that is riskier than doing something that is safe?
@VeeeneX Depends if you have PHP4 style constructors in the code you want to reflect on.
 
@Danack This… is not magic but expected behavior.
 
s/bug/but
 
8:20 PM
yeah… thanks
 
> There is possibly code out of there that hooks into the PDO code in an extension, that instantiates it with the internal data that it needs. As there's no real benefit to changing the constructor to be private rather than just throwing an exception, and a huge potential downside it's not worth it.
Just throwing an exception achieves the aim of the RFC. I'm not going to risk fucking up people's code just to make code be purer.
 
@Danack If you'd instantiate it in an extension, you'd still get an exception.
In an extension you'd do a constructor-less instantiation, which doesn't conflict here.
 
7 mins ago, by Danack
The RFC is trying to remove magic.....
 
3 mins ago, by bwoebi
@Danack This… is not magic but expected behavior.
But I see, we're talking in circles.
 
@Danack I did read wiki.php.net/rfc/remove_php4_constructors so know I know what You mean, sure my code uses PHP 6? - I don't understand that versions :D
Thanks a lot!
 
8:24 PM
@Danack Please ask others for their opinion on it.
 
What's the point? Doing that is a change just to make the code be purer. It doesn't actually have a real benefit other than to make people with OCD be happier. The exception achieves the goal of the RFC of not having constructors do weird shit. As I said, I really don't want to risk breaking any code just to have a 'purer' design.
@kelunik I keep forgetting what your real name is - this is you isn't it?
 
@Danack Yes.
 
@Danack So… we should summon Daniel here? :-)
 
@kelunik Thanks for that example - can you do another one for the other RFC, as currently it's far too abstract.
@bwoebi I hoping he's off fixing a bug....
 
So for the one the thread is actually about? (yield * or yield from)?
 
8:32 PM
@Danack no, he's playing with openssl 1.0.2
 
s/playing/fighting
 
user895378
Fighting is more accurate at this point.
 
user895378
It's making me crazy.
 
user895378
There's either (1) a bug or (2) an undocumented BC break in 1.0.2 that's breaking my code ... either one sucks :(
 
@rdlowrey okay … then … do some pause and fight with @Danack instead about making PDORow having a private ctor…
 
user895378
8:35 PM
In all honestly I haven't paid any attention to that discussion yet.
 
Or do you daily gym. ;-)
 
But also @kelunik is that syntax right for that example? Or is that an example of what the syntax would be in the future.
 
user895378
Can someone explain (or point me to a link explaing) why PDORow is special and different from other classes?
 
@Danack The middle one is a currently used code at dev.kelunik.com, the top one is a future one and the one at the bottom is if I'd have integrated a change in amp.
 
user895378
on the bright side I have discovered a lxr equivalent for openssl hosted online that has been exceedingly helpful :)
 
8:37 PM
@rdlowrey I think they just got confused when writing the code. The real question is why it exists at all when it's really meant to be a PDOStatement
 
user895378
beats the hell out of grepping for everything
 
Sorry for multipinging.
 
user895378
@Danack so basically it's stupid but now that it exists and is a thing we can't just do away with the current behavior? Is that the problem?
 
@rdlowrey No - we can do away with the current behaviour (of giving a fatal warning) by just making it throw an exception instead. Some people want a purer approach of changing the constructor to be private.....which I can't be arsed to do, but also may break some stuff somewhere, for zero benefit.
 
user895378
Oh. Well I'm fine with either approach. As long as the end result is a throw I won't lose sleep over it.
 
user895378
8:40 PM
(I'm trying to tamp down the OCD)
 
\o/
 
@Danack As I said… it is nearly impossible for it to break stuff (not more likely than throwing an exception directly)
 
@kelunik This is possibly a stupid question then, by current code do you mean PHP 7 or why does that code not work (I have hardly used generators...):
function foo() {
    return json_encode([42]);
}

function bar () {
    $result = yield foo();
    yield json_decode($result);
}
s/that/this.
 
... oh well… foo() is a function
 
user895378
What's the question here?
 
8:45 PM
@Danack $result = yield foo(); << well then… why do you yield here?
 
I'm trying to understand news.php.net/php.internals/84226 - "Currently, it looks like this:"
public function getSession ($sessionId) {
    $result = yield $this->redis->get("session.{$sessionId}"));
    yield json_decode($result);
}
 
@Danack Yes, I'm talking about current master. For PHP 5.x, you'd need $result = (yield foo());.
 
Ok, thanks.
 
@Danack redis->get returns a future instance that's resolved by amp which sends the resolved value into the generator then.
 
IKnowSomeOfTheseWords.gif
 
user895378
8:49 PM
@Danack It may be easier to understand the example I pose here: wiki.php.net/rfc/…
 
@Danack a Future instance… or basically just an object which implements Promise.
 
@rdlowrey Actually, I was saying to @kelunik earlier - the more concrete example that showed it being used, is probably easier to understand why the new syntax is desired, and not just a shiny new bit of syntax that doesn't help clarify the meaning of code.
 
user895378
Amp\run(function() {
    $client = new Amp\Artax\Client;
    $response = yield $client->request('http://google.com');
});
 
user895378
@Danack ^
 
user895378
Basically the point is this: this functionality is super important to be able to create things like this in php.
 
user895378
8:53 PM
And nobody seems to understand it in php :(
 
user895378
It's not controversial in any way.
 
user895378
It's extremely useful for writing asynchronous code.
 
@rdlowrey Because nobody has ever worked with it.
 
user895378
And it already exists in languages that recognize the value of asynchronous code.
 
user895378
It shouldn't even be a discussion.
 
user895378
8:54 PM
In particular it's crucial because PHP's only mode of concurrent execution (short of pthreads) is non-blocking event loops.
 
@rdlowrey s/in php//
 
@kelunik That's probably worth being explicit about - because a lot of people will just assume it's a normal function and not see the power of the dark side asynchronous processing.
 
user895378
@ircmaxell you might be right ... I just don't have much exposure to serious development communities in other languages
 
@rdlowrey I'm just messing with ya
 
user895378
Not being able to return a value from your generator is like having an asynchronous work queue to which you can offload tasks for background processing but being unable to access the results when they complete.
 
user895378
8:58 PM
The return value lets you say, "do this work in the background and let me know the result once you're finished"
 
@rdlowrey You should state that clearly in the RFC and the mailing list.
 
"background"
 
user895378
"background" is used very loosely here :)
 
user895378
There's obviously a big difference between "concurrent" and "parallel" ... but it's still a useful metaphor.
 

« first day (1599 days earlier)      last day (3352 days later) »