« first day (2038 days earlier)      last day (2926 days later) » 
02:00 - 13:0013:00 - 00:00

user895378
2:09 AM
@Trowski I think I have a minor preference for Promise over Awaitable because we don't actually have to wait on the future resolution of an async operation. "Promise" seems more semantically correct to me for this reason; it's just a placeholder for some future value. Whether or not your application chooses to wait on it to resolve to take some future action is immaterial to the essence of the placeholder value.
 
user895378
@kelunik yeah, the link @kelunik mentions is the very reason why we initially started using the $callbackData ... it allows us to save on new closure instantiations when resolving coroutines
 
user895378
Which really added up to significant performance gains when everything in the app was based on those coroutines
 
user895378
@kelunik I really like the spec draft you created. It does a great job of outlining the significant performance improvement from not pipelining new promise instances. There are a couple of very minor grammatical changes I would make and one small spelling correction. On the whole you've done a great job with it.
 
@rdlowrey You can do [$this, "_nextTick"] though
it's a little bit slower, but not significantly, I believe
basically what we loose there, we gain again by having real fields on the object and $this-> access
having a Closure there obviously is a no-go
 
user895378
2:24 AM
Sorry, I'm not familiar with the _nextTick instance method ... what object does that live on in the interop spec?
 
@rdlowrey none
Talking about Amp
 
user895378
I'm confused then, because that operation doesn't happen on an object?
 
we could make the coroutineStruct a real object
(only for internal usage, obviously)
@rdlowrey and thus eliminating our need of passing callbackdata to when()
 
user895378
Even if we did that, I still see value in having that callback data optionally available to whatever callback awaits the eventual promise resolution
 
user895378
Because it doesn't force you to use OOP ... you can use functions and pass around the state yourself if you want to
 
2:29 AM
@rdlowrey you can also just use Closures, technically ;-)
 
user895378
sure, but then we couldn't microoptimize ;)
 
@rdlowrey if you really want to microoptimize, you can do a bit of OO. It's not forbidden.
also, that is not really OO, it's just a struct with a $this and some methods
It's still totally encapsulated behind resolve()
@rdlowrey we still might retain it in Amp, but I don't see enough value to integrate it into the when() function inside the interoperable interface
 
user895378
@bwoebi I can get on board with that ...
 
After all, the goal should be to be minimal, yet cover everything. And we actually do. If you want to micro-optimize, then you're free to do that on your own impl
@rdlowrey … okay great then :-)
 
user895378
there are a couple other places in that file where we use the callback data on when() as well FWIW
 
user895378
2:39 AM
(outside coroutine resolution)
 
user895378
It's just kinda nice to have the capability if you want it.
 
@rdlowrey right, but there we again have a struct. (i.e. in combinators you mean) … there's even a Closure…
for some reason we're using a Closure, but no use()
 
Mornings
 
Hello, I'm trying to decouple the PHP parser from php-src, but I can't find the function where that happens (total newbie to C). I've found upto a reference to zend_compile_file/compile_file but I can't seem to find any function declaration of that name?
 
2:54 AM
Hey guys I am having trouble with some PHP. I watched a tutorial and it is using the old deprecated non mysqli functions so it is all screwed up. I modified it as best I knew how to update it.

Here it is: http://pastebin.com/rrFN5Kww
When you submit the form it is die'ing at line 15 (error 201).
 
@MichaelYoo compile_file is declared in zend_language_scanner.l ?
 
I've probably just been looking at it far too long.
 
@JTYoerger perhaps have a look at mysqli_error()
 
Thank you, I will try that.
 
@JTYoerger Also, = is not the same than == … And $banned != 0 or 1 is not what you expect … it's always true (evaluated as ($banned != 0) or 1 and 1 is an expression evaluating to true. You need to write $banned != 0 && $banned != 1
@JTYoerger And btw. the necessary warning: look up sql injection and prepared statements
 
3:01 AM
Thank you! Line 10 was if($username && $banned) before but I changed it to the = 1 because that was also producing an error. And thanks on the SQL injection warning! This tool is only for 3 people so I wasn't too wary! :)
 
@bw
@bwoebi I see, thanks!
 
@JTYoerger Still, bad habits often remain … do it always in a safe way, future you will thank you ;-)
 
3:14 AM
Got it all fixed! Also had to update mysql_num_rows to use mysqli. Thanks for your help! @bwoebi!
 
 
1 hour later…
Wes
4:36 AM
 
4:52 AM
o/
 
Wes
5:16 AM
\o
 
Does anyone know why this won't work:
<?php
if(!in_array($_SERVER['REMOTE_ADDR'],$global_ip_allowlist)) {
header('Location: https://www.google.com/');
} ?>
My array looks like this if it's helpful:
$global_ip_allowlist = array(
'0.0.0.0',
'0.0.0.1'
);
 
nin
 
5:54 AM
@JTYoerger misses a exit() after the header(...)
@bwoebi the argument is as bad as the less-to-type argument
 
6:21 AM
@staabm adding exit(); or exit; makes my page turn white and do nothing
Read PHP documentation and put Header at the top of the page before any other output fixed the redirection issue. Trouble now is adding IP addresses to the array has no effect and you are redirected no matter what.
 
6:49 AM
@JTYoerger you should enable sisplay-errors and increase error-reporting to E_ALL. Header() needs to be before any other ouput, but not before all remaining php code lines
 
Thanks for your help
 
s/sisplay/display/
 
lol
 
7:19 AM
moin
 
@bwoebi In that case Amp can't resolve other Promises again. So that's a nogo. I think we do not use the $cbData anywhere else.
 
Hello!
 
@JoeWatkins nin'
 
7:36 AM
any suggestion what library/function to use that can send email to any email address
i have use phpmailer and mail function
but they are not sending mail to hotmail and yahoo
 
@bwoebi Well it can if we switch to a real object.
 
o/
 
8:36 AM
@JoeWatkins ah bugger, I had wanted to talk to you about the functional interfaces RFC....
 
8:59 AM
?
I saw the draft you are working on @Danack
I really dislike making an interface of __invoke, what happens if a class wants to implement >1 functional interface ?
bits I like also, I think we can/should entertain the idea of casting, and possibly coercing callables ...
I think that's a separate thing though ... I'd actually quite like explicit object casts to be a thing in general, and would like to include casting callable/closure to fi impl as part of that .... I'd also be happy to just tackle fi casts on their own, since object casts in general have several difficulties ...
 
9:20 AM
@JoeWatkins Basically after talking to Bob yesterday, I like your RFC a lot more. The two things were going to be i) I think the words in the RFC could do with a little polish ii) I think we still need a way of converting existing callables to closures with interfaces on them.
 
feel free to edit the wording of the rfc, though probably a bit late ...
 
Nah - I feel strongly against editing RFCs in vote....
 
yeah probably right ...
 
Bob was kind enough to work on wiki.php.net/rfc/closurefromcallable yesterday - and as is that is ready to be put to a vote. The question I guess is - I there a way to expand your RFC to include being able to attach interfaces to existing callables, or would be making it be part of:
Closure::fromCallable('someFunction', 'functionalInterface');
// returns a closure around someFunction decorated with an interface called functionalInterface
 
as you say, too late to expand, but I don't object to that idea, it's certainly easier than casts ... and avoids all the problems of coercion ...
 
9:25 AM
yeah....bob looked the coercion......it would be bad magic.
 
good, I'm glad we all agree about that ...
there may be another way though
you don't really need coercion, you need vaidation
 
@Danack I'd still prefer callable(...) as a language construct, so it can also handle callable($this->method).
 
verifying the signature of one function before invocation is very cheap (and only needs to be done once) compared to registering a class entry, verifying it, instantiating an object and then invoking a function ...
 
@kelunik I could put that as a voting option maybe.....a lot of people were really vocal against it.
 
What are the reasons against it?
 
9:29 AM
@kelunik yeah, this is what I want...
 
callable is a reserved keyword anyway. 3v4l.org/l9AYG
 
It only has that pesky problem with the method property ambiguity
 
@NikiC Yes. We could forbid properties.
But that'd probably be inconsistent with everything else in PHP.
 
A special rule like that doesn't sound appealing...
 
closures already have that rule
so should generators ...
 
9:32 AM
@JoeWatkins Which rule?
 
> We could forbid properties.
 
callable($obj, string $method) wouldn't solve a problem that the static method doesn't solve.
@JoeWatkins You're talking about use()?
 
@kelunik that's not good enough
for forward compatibility, we need explicit disambiguation between :: and ->
 
@NikiC I know. It's worse than the current proposal.
 
The other alternative is callable($this->method())
or $this->method()::callable ^^
 
9:35 AM
@NikiC No, that would make a callable from the method's return.
 
@kelunik not if it's part of the syntax
But yeah, I can see the confusion there
I'd say it's fine to simply make it specific to methods
I mean if you call $this->method() it will also ignore the property, so nothing new there
 
Mornings
 
@PeeHaa o/
 
why do you want to create callables and not closures ?
or are we talking about closures ?
 
@JoeWatkins we're talking about closures
 
9:38 AM
@kelunik that's the other problem with callable() generating a closure....
 
@Danack what other problem?
 
is there some problem with Closure having a constructor ?
 
Yes, the problem is that I'm unlikely to use it
 
@NikiC That it's confusing, using something called callable that only returns cloures.
 
@NikiC I'm unsure, why ?
 
9:40 AM
Passing callable($this->method)? Fine. Passing Closure::fromCallable([$this, 'method'])? Nope, I'll just directly use [$this, 'method'] instead.
 
new Closure($this->method) ?
 
@JoeWatkins wat
 
@JoeWatkins it is highly likely that we are going to want to have other ways of constructing closures in the future, e.g. from AST or anything. Using the default constructor makes it confusing when that happens.
 
That would pass the property $this->method to the closure
 
@NikiC Uhm, that's exactly why we have that thing?
 
9:41 AM
callable($this->method)
 
Because method might be private.
 
why is that remarkably different ?
 
> If anyone wants to use a short name for this functionality in their application or library they can do so easily, by defining a function:
    function fn(callable $callable) : Closure {
        return Closure::fromCallable($callable);
    }
 
@kelunik That's only one aspects. This would also serve as a way to explicitly show where you're actually referencing a method.
IDE refactoring and static analysis would make use of it
 
@JoeWatkins it can be a language construct instead of a function
 
9:42 AM
@NikiC wouldn't you just do that?
 
@Danack That again looses all the value for static analysis and refactoring
 
@NikiC For that we should just merge symbol tables and directly pass it.
 
I mean, if this is really just a solution for private methods, it's fine. I just thought there was more behind this than that.
 
yes, which requires 2/3 majority ... and it's really strange to suddenly start using the word callable in the context of closures ....
but there's no way to do the constructor without language change anyway actually
 
@NikiC I think that's the thing it's trying to solve. @Danack
 
9:43 AM
It's the main one.....
@NikiC tbh I don't understand what you meant for "loses all the value for static analysis"?
 
@kelunik okay ... it's not like I actually read the rfc ^^ I only saw the hack section and jumped to the conclusion that it's for the same purpose
 
@Danack Because [$this, "method"] can just be an array, it's not something that can be recognized as a callable.
 
@Danack Something like callable($this->method) gives a definite signal to IDEs and analyzers that this is indeed referencing a method and not just some weird array. If you rename the method, this callable will be automatically, and without the possibility of false positives or negatives, also be renamed.
 
yes....the RFC doesn't address that. It only provides a point in the code after which the conversion to a closure is guaranteed to have occurred, not a full on static analysis that this is definitely a callable referencing a particular callable.
And I suspect the static analysis problem might be a bit hard to solve without other changes...
 
@Danack In that case, if this is intended for use only with private methods, fine :)
In that sense it's a reasonable change to avoid going through reflection
 
9:48 AM
can it be Closure($this->method) without reserving Closure ?
 
So, should I just put this to vote now or wait to think about:
25 mins ago, by Danack
Closure::fromCallable('someFunction', 'functionalInterface');
25 mins ago, by Danack
// returns a closure around someFunction decorated with an interface called functionalInterface
 
@Danack as that does not conflict as a future addition, don't think there's need to wait
 
agree, can be done later, quickly ...
 
So mote it be.
 
Fingers crossed that functional interfaces will fail anyway :P
 
9:50 AM
@JoeWatkins PHP 7 doesn't have chat much issues with reserved things anymore.
 
handbags
 
@Danack What's with closure($this->method)?
 
we're discussing using ^ or \ in place of a word ....
 
@JoeWatkins imho doesn't even make sense of closures in that context
The fact that it's a Closure object is an implementation detail
This has absolutely nothing to do with closures in the usual sense of the word
 
it returns a closure though, right ?
 
9:53 AM
In that case we can just co with callable again.
 
so we're changing the usual sense of the word ...
 
@JoeWatkins It does, because PHP
 
@kelunik I don't think it should be part of this RFC. It would have to be a full on language construct and is going to have weird semantics for $this->method meaning the "method of $this" vs the value of $this->method.
 
Because the thing ensures it is callable regardless of the scope.
 
@NikiC you only need callable or closure for the same reason, if it returns a closure, it has more to do with closures than callables imo
 
9:54 AM
Unless you think implementing it as closure([$this, method]) currently would be okay.
 
$this->method(...)
(That may be less stupid than it looks)
 
@Danack It is only indented for visibility protected methods, so I think callable($this->method) makes total sense. You don't ever want a property there, because then you could just use the property as callable.
 
@kelunik No.....
 
May I offer my perspective?
 
@MadaraUchiha Always.
 
9:57 AM
apply($array, filter($fn1, ...), map($fn2, ...))
 
(An incomplete perspective, I'll admit, but still)
 
You would use it for the "Gives errors at the right place" reasons in the RFC.
 
When would you want to pass an instance method, as a callable to another function/object?
 
@NikiC Uhm, what's that?
 
@MadaraUchiha the validator example in the RFC.
 
9:57 AM
Curry + callable?
 
@kelunik callable() syntax combined with partial application :D
 
Passing in instance method as, say, a mapping function is awkward
@Danack Thanks, reading
 
(obviously that's stripped down for the RFC. A real validator would have loaded up some business rules from a database.)
 
@Danack A real validator would probably use polymorphism
But I see where it could be beneficial
 
10:00 AM
@MadaraUchiha e.g. github.com/amphp/redis/blob/master/lib/RespParser.php where the connection has to pass a closure, because [$this, "onResponse"] would be private and can't be used.
 
@Danack "Which is a difference of 1,894 operations per loop." That's a pretty meaningless number ... maybe provide a percentage instead?
 
@NikiC I have to say, I like that.
 
@kelunik Here's my take
Practice-wise, callables/closures/whatever you want to call them, are used in higher order functions
$this undeniably implies state
And higher-order-functions + state is almost always trouble.
Because you lose the advantage of a tight class where logic is all encapsulated in a single place
 
@kelunik might be a bit unclear if not familiar with the syntax...
 
And you don't gain the nice clean abstraction of a higher order function, in that you can inject clean functionality (basically "inject code" as if it were data)
I know that it's already possible today
 
10:03 AM
@NikiC Yes, but that's so with most new syntax.
 
But now you're suggesting to loosen the limitations on it further by allowing private methods to be passed as callables
 
@MadaraUchiha they can be already.
They just only work sometimes.
 
@Danack That's such a PHP thing to say :P
"sometimes" being, if they're injected into an instance of the same class?
 
Hey guys, so I'm building an android app that deals with taxi ordering, I'm planning to store users' data in a mySQL database, so there are two types of users: riders and drivers, which is a better practice: to make two tables in the database one for drivers and the other for riders, or make a column in a single table that indicates drivers/riders?
 
@MadaraUchiha If it's called from a scope that has access to the method ^^
 
10:05 AM
@NikiC yeah, so what I said, only more general
 
@MadaraUchiha how much booze do you have within reach of you? Full details are logged here: wiki.php.net/rfc/consistent_callables we'll look at fixing them for 8...
 
So the proposal is to remove that limitation
 
@SamIbraheem Have a person table. A single person can be driver and rider.
 
@SamIbraheem separate them out as much as possible.....have 'person' and then 'riders' and 'drivers' that join to the person table.
@SamIbraheem I would recommend reading this and probably buying the book.
 
I don't know, I feel like Java handled the case of passing callables around better than how PHP is doing it/planning on doing it.
 
10:07 AM
@MadaraUchiha No. The proposal now is to allow generation of closures that close over the private method, so that classes can restrict what is in their public API.
 
And that's a bad thing when Java does something better than you :|
@Danack But now you're lying
 
i.e. to not reveal the private methods.
 
Because you're saying that the method is private, but you can return a closure for the outside world, with a private method referenced in it.
So it's not really private anymore, and it being "private" is now being enforces solely by convention
 
yes. The closure closes over the private method. Just like other closures close over $this.
 
(i.e. don't return the closure from any public method)
 
10:09 AM
@Danack Thanks dear
 
No problem me luvver.
 
heh
PHP has static checking for these things, and that's a good thing to have
You're effectively allowing users to bypass that
 
I don't even know what you're trying to argue for. The same argument would be made for using $this inside a closure and then returning that closure out of the objct.
And it's dumb argument as that is exactly what closures inside objects are intended to do, and what people use them for.
 
@Danack Yes, which is also bad practice in my eyes, like I said HOF + $this = mess
Wait, you can have $this is a closure?
 
that's kinda the point of closures
 
10:12 AM
As in, a closure not created with [$this, 'method']?
 
they can be rebound
 
@JoeWatkins So basically, you have $this inside of a closure, and you have no idea what it is by reading it out of context.
Same as JavaScript's this.
 
they have lexical scope, they have the $this of whatever scope they are declared in ... but can also be rebound at runtime ... you don't read it out of context, do you ?
if you are reading it at all, you are reading it in context ...
 
@JoeWatkins Isn't that a bit performance heavy?
 
if you're consuming it, you don't care ...
 
10:15 AM
Creating a closure in every instance?
 
"which is also bad practice in my eyes" You're making an argument based off your own personal preference, one that is not how the vast majority of people use the language, and one that is counter to how the closures were designed to be used. You don't have to use closures that close over stuff you don't want to......but it's a really useful practice.
 
@Danack Closures (or, callables, really) are a tool used in functional style programming to abstract behavior, a form of polymorphism, if you will.
PHP did not invent callables, or passing functions around, even if you don't call it that.
 
the same instance is used, but you're right, there is overhead ... we don't talk about that ...
 
you guys one more question: is there any free hosting services online with good mySQL capabilities? I mean joining tables and establishing relations and so? Or I'm gonna have to use SQL-server or something
??
 
@JoeWatkins Heh
 
10:17 AM
I think it's already minimized ... I'm not sure it can be removed completely ...
 
Here's what I'm afraid of
JavaScript's this is one of the biggest weaknesses in the language
 
and strength
 
Granted, the default behavior is worse than PHP's
But if you allow $this to become a mystery object that you can only know about in runtime (and, potentially, have to try really hard to understand what it is), you're going to get messes much like how globals cause messes.
Well, I guess it's already the case, so arguing about it is kinda moot.
But I don't agree that functions that are potentially returned from public methods should be allowed to remain private.
They're now part of the public API, other methods can call them out of scope
 
@SamIbraheem Don't go with free hosting.
@MadaraUchiha Javascript's this is different from the one in PHP.
 
@kelunik Aside from the faulty default behavior in JS
How so?
 
10:23 AM
@MadaraUchiha Usually, there's not rebound.
 
@kelunik Well I'm afraid I have to, I don't mean to go politics right now but the US and EU won't allow Syrians to do any money transactions
 
@SamIbraheem Then don't expect something good. Nobody can provide good things for free if you don't have sponsors like Let's Encrypt has for example.
 
@kelunik Yes, aside from the default "rebound every time" behavior
 
@SamIbraheem that is going to be inconvenient, to put it mildly. I was going to suggest vultrcouponcode.com but they probably require a creditcard to sign up. I would recommend just developing everything locally through vagrant, and opening a port on your computer to act as your own server.
 
Before callables, $this was a static thing, you could determine, in compile time, whose $this it was
But now you can't, not really
 
10:26 AM
@MadaraUchiha That makes a huge difference.
 
Because at any time, any method, including private ones (according to the RFC), can be passed out, and $this might be rebound in runtime.
@kelunik It does from an author's perspective (unless, you know, you're dealing with someone else's misbehaving code)
 
@MadaraUchiha There's nothing new about that in the RFC. The RFC just makes it possible to be more efficient.
 
But from an optimization perspective, you can't do any sort of pre-optimizations now in fear of someone creating a closure and rebinding $this.
@kelunik I need to read the RFC more thoroughly then
Because apparently I've missed the point.
 
@MadaraUchiha Yes, that's true, but that's how it is.
 
@kelunik yeah I know, but it's just a simple graduation project, nothing too complicated.
@Danack looks like I'm going with that, but how can I simulate google maps function on a local made-up server?
@danack
 
10:28 AM
@MadaraUchiha The point is avoiding an extra closure like that:
 
is there anyway?
 
@SamIbraheem How is Google Maps relevant to what server you're running?
 
class Y {
    function foo() {
        $x = new X(function($foo, $bar) { return $this->privateFunc($foo, $bar); });
    }
}
 
Google Maps is a client-side script, it should work even without a server.
 
@SamIbraheem I don't understand the question. Assuming that your computer has access to the internet, it would be able to do anything a real server could do. The only thing that will be more difficult is allowing other people access to your server i.e. giving it a domain name is harder.
 
10:30 AM
@kelunik that's the point.
morning
 
@kelunik cringe and how would that be done under the RFC?
 
@bwoebi But apart from that, we don't really use $cbData, right?
 
@danack
 
@MadaraUchiha new X(Closure::fromCallable([$this, "privateFunc"]));
 
@kelunik right… the only occurrences I know of are in amp/lib/functions.php…
 
10:32 AM
@kelunik What's stopping me from new X([$this, "privateFunc"])?
 
@MadaraUchiha privateFunc might not be callable depending on scope.
 
@bwoebi o/
 
@kelunik Unless I make it public, I'm guessing
 
@Saitama \o
 
@MadaraUchiha Yes.
 
10:32 AM
@Danack sorry this mention thing is confusing, you mean I can set up my PC as a server and let people access it through the internet?
 
It might be a valid callable when passed, but if that passes it to another scope, it might not be valid anymore.
 
I see
So, it's basically JavaScript's fn.bind(this)
(For different purposes, but same effect)
 
@MadaraUchiha Basically, yes. With the additional effect of visibility change.
 
@MadaraUchiha that's what Closures do… a $this and scope bound function
 
@SamIbraheem yes. Try searching for "wamp server external access" or whatever server software you are using. e.g. the top result for that is stackoverflow.com/questions/19132059/…
 
10:34 AM
@bwoebi Yes, I realize
 
btw - don't open all ports ......just port 80 and 443.
 
Scope binding is one thing, but I've come to dislike this binding
Because it's unpredictable
And I don't see it being any more predictable in PHP than it is in JS
 
@SamIbraheem Better use a firewall and block all incoming connections on other ports than 80 and 443 then. You should do that anyway, because there are often programs on your computer that don't bind like they should to localhost.
 
Basically, anything that's mutable in a passed callable is a red flag for me
Scope can possibly be immutable, if you treat it that way
$this is almost always mutable
And that scares me.
 
@MadaraUchiha Well, that's the scope?
 
10:36 AM
@kelunik No, what you call use ($var) is what I call "scope"
In JS (and most other languages that allow closures), you get everything from the outer scope automatically
PHP took the conscious path of specifically declaring what variables you import from the scope, which I think is actually not bad at all.
But you don't need to declare $this, you have no guarantee that the $this you have is what you think it is, and thus, it makes your functions impure and less stable
For the sake of simplicity, I'd expect that a function(){} expression with no used variables to always output the same result no matter how many times I call it with the same parameters.
 
@JoeWatkins The problem with callable($this->method) is that you might want to do callable($this->property) (i.e. convert an existing callable as Closure) … what'd be interesting would be eventually some sort of trampoline … then we could also do callable($this->method($foo, $bar)) with prebound arguments \cc @NikiC
 
@NikiC @bwoebi Why do we even have closure rebinding?
 
@kelunik Often used to hack into encapsulation?
 
@bwoebi read on, that comes up later in the discussion ;)
 
@bwoebi See @NikiC's suggestion of $this->method($preArg, ...).
 
10:39 AM
@bwoebi Hmm, the way I read callable($this->method($foo, $bar)) is that calling $this->method($foo, $bar) returns a callable (in the form of an array or whatever), and you're passing that.
 
@bwoebi Yes, how often do you need it? If you need to hack into it, you're mostly doing something wrong.
 
If anything, maybe this: Closure::partiallyApplyOrSomeShorterName($this->method, $foo, $bar)
 
@kelunik something the wrong thing is the best one.
You never should need it.
 
Or even, if you're daring: callable($this->method)::partiallyApply($foo, $bar)
 
but sometimes you do
 
10:41 AM
@bwoebi Right. But it prevents optimizations, so why has it been introduced?
 
@kelunik at that point we didn't care so much about optimizations
 
@MadaraUchiha What if I want $foo, $bar at the start instead of the end or the other way round?
 
@kelunik Various languages handle it in different ways
Some introduce a placeholder argument
So say ::apply($foo, _, $bar)
Some, like JavaScript, just don't allow it at all, you can only bind from the start.
 
@MadaraUchiha The ... in the $this->method($foo, ..., $bar) suggestion, no Closure::... at all.
 
@kelunik ... is normally used as a spread operator
 
10:44 AM
@MadaraUchiha Right, so it fits quite well.
 
I don't know if that's the best construct for it, but yeah, I see your point
@kelunik Not exactly.
... is one argument? All of them?
What if I want $foo, _, $bar, _?
 
All of them.
 
@MadaraUchiha I'm not sure how far partial binds are even possible in VM. (passing args is currently at a compile-time determined offset to execute_data (i.e. the call frame))
 
@bwoebi What do you mean? (specifically, "in VM")
 
But we could go with $this->method(...) and extend it to partial bind later.
 
10:47 AM
In most functional languages, the stdlib functions are written in a way that configuration is in the first arguments, and the data in the last ones
So for example, a sort function would be
function sort(callable $sorter, array $collection) {}
And then you can do something like
$sortById = sort::apply(($a, $b) ~> $a->id - $b->id);

// later

user_call_func($sortById, [...]);
 
@MadaraUchiha can you clear my last flag. Something/one already removed the comments of OP I target and those custom flags tends to hang in there for weeks otherwise :)
 
@PeeHaa Looks like another mod is looking into it
If it's not handled today, ping me tomorrow?
 
the guy from the previous day removed his answer :'D
 
Oh sure :)
@Saitama Let just keep it at "he didn't have his day and move on"
 
:)
 
10:53 AM
hehe creative way to go around the only code message stackoverflow.com/q/37237318/508666 :P
 
:P
it took me a while to get it tho
 
;-)
 
Hey guys, any idea if google-play-services library is included in android studio?
 
Is't it just a download away just like you download sdks?
 
http://stackoverflow.com/questions/37237227/open-source-bot-detectio‌​n
http://stackoverflow.com/questions/37236773/php-framework-which-is-b‌​est
 
Wes
11:43 AM
theverge.com/2016/5/12/11664668/… brown space undies needed
 
:P
 
12:23 PM
Don't know if you watch that repo yet.
 
Anonymous
Does anyone have the Dell XPS 13?
 
02:00 - 13:0013:00 - 00:00

« first day (2038 days earlier)      last day (2926 days later) »