« first day (4235 days earlier)      last day (706 days later) » 

1:21 AM
that's why every software department should hire a retired lumberjack
 
 
15 hours later…
4:36 PM
updated from 7.3 to 8.1 on a client's server the other day and I'm a big fan of the warnings and deprecation notices yelling loud enough for sentry to pick them up. shit like "this value should not be null" at runtime is so very incredibly valuable to pick up, 10/10
 
Roll on 9.0 when the vast majority of accidental nulls are going away
 
5:01 PM
hi all! Is there any workaround of having a loop control structure inside an arrow function in PHP, like in JS? I know I can use an anonymous function, but anonymous functions can't referring outside scope variables which is the point for what I am using arrow function. Thanks!
 
5:14 PM
@BoteaFlorin Lookup "use" syntax e.g. $x = function ($a) use ($varFromScope) { ... }
 
use doesn't work with arrow function, I don't think, but IIRC arrow function in php doesn't need it
 
6:12 PM
@MarkR I know about 'use' and I just wanted to know if is there a way to avoid using it. Arrow function has access to upper scope variables, but if they can't have a multi line block, like in JavaScript, seems useless... would be great a syntax like 'fn() => {...}'
 
@BoteaFlorin You asked for a workaround to have a control loop function, the workaround is to use function not arrow functions, so you can use the normal control structures.
The feature you're asking for is being discussed (wiki.php.net/rfc/auto-capture-closure) but even if it reaches RFC vote and passes it wont be there for probably 6 months or more, potentially another year.
 
@MarkR my bad, I should mention in my question that 'anonymous functions can't referring outside scope variables only by "use syntax"'
@MarkR I heared it is proposed, would be nice to be introduced. Thanks for the link!
 
7:17 PM
morns
@samayo hahaha, someone did actually kick me out
 
7:36 PM
Wouldn't a mod be notified since you're an RO?
 

« first day (4235 days earlier)      last day (706 days later) »