« first day (1557 days earlier)      last day (3394 days later) » 

6:00 PM
It's not in character for me, but I'm actually cautious on this one
Then again
We're removing new by-reference and PHP 5 changed the object model radically...
Hmm :/
@LeviMorrison re: static closures in PHP 7 - unbound scoped closures caused problems IIRC
can't remember what
but I think there's some reason for why we don't have them
That might just apply to internal functions which really don't like being bound the wrong way
In a "fatal error or segfault" kind of way
Probably fine for userland funcs
 
@DaveRandom who told you to use ctype_digit? :-(
that makes --disable-all builds fatal error…
 
dude
why would it matter what works in disable all builds?
 
user895378
Because that's the only kind I ever build lol
 
Ditto
 
user895378
With switches for the exact extensions I use ...
 
6:06 PM
@ircmaxell also uses it
 
I also use --dsiable-all for PHP internals development
What context am I missing here?
 
yes. An when I want to test something on a specific version, I take my precompiled --diable-all build…
 
I dunno
 
user895378
I'm just working on something that uses @DaveRandom's LibDNS and got a fatal because no ctype extension :)
 
pfft
the language spec's tests can't run under the language spec alone :D
 
6:07 PM
hmm?
 
They implicitly rely on ext/standard :p
 
:-P
 
@AndreaFaulds It works in global scope.
 
@LeviMorrison No, you're unfamiliar with closure terminology
unbound: no $this
static: no $this possible
bound: has $this
unscoped: cannot see into any class's private/protected scope
 
Honestly, that wasn't the terminology people used when I was discussing closures with regards to the static behavior.
 
6:09 PM
scoped: can see a specific class's private/protected scope
@LeviMorrison Sure, but it's important to use the actual terminology that's used in the engine and manual when having a technical discussion, or you'll just cause problems
 
Nobody used it before; therefore nobody knew it. So it doesn't really matter ^^
 
@AndreaFaulds nobody knows any of that terminology ;)
 
@LeviMorrison Has been used before.
 
Exactly.
Hey, Nikita seconded it ^^
 
@NikiC Well they should learn it.
 
6:10 PM
Also I have no idea what "actual" terminology you're talking about here
 
Otherwise we'll have people editing the language spec to make the closure definition incomprehensible
@NikiC The one used in the manual, engine, and language specification
 
@AndreaFaulds That's a common Levi added, iirc
 
I edited it partly but it was already there.
 
@NikiC nope
Oh, I made it say The the, oops
 
http://stackoverflow.com/questions/28052305/how-to-ban-someone-from-‌​my-website
 
6:14 PM
Added four years ago by Gustavo (committed by Stas)
 
I do think anything a closure/anon function is permitted to do in global scope it should be allowed to do in static scope as well.
Do you agree?
 
Maybe.
 
@LeviMorrison That's what I've been trying to tell you. But you didn't seem to agree.
 
But @NikiC doesn't, he just removed support for that.
 
@NikiC Nono, I said there is a difference currently.
 
6:14 PM
$this in incompatible contexts has been removed ^^
 
@AndreaFaulds Hasn't ^^
 
I do believe it was reverted out for now yeah?
 
@NikiC Oh yeah, you reverted it, right?
 
yes
 
6:15 PM
A closure has exactly the same scoping as a PHP function. The three possible closure types correspond to PHP functions:
 
but I'll still grab this chance to disable pear, I think.
 
I'm running Websocket script via terminal and sometimes its exit without any errors, how can I detect the problem caused that ?
 
* unbound, unscoped: global function
* bound, scoped: instance method
* static, scoped: static method
We don't allow unbound, scoped closures, and it'd be rather messy if we did (our APIs "helpfully" make a closure static if you give it a scope but a NULL object to bind)
That's for both the internal and userland closure creation APIs :/
 
Blech
 
user895378
If anybody feels like doing a docs patch ... this page claims hash() is part of core php and no switch is necessary to enable it but if you use --disable-all that's not true and you have to use --enable-hash ...
 
6:19 PM
$f = function() {
    return $this;
};

class A {
    static function method() {
        return function() {
            return $this;
        };
    }
}
 
Methods should just close over properties.
 
^ Meaningfully, are these really different?
 
@LeviMorrison Yes.
 
How so?
 
The second one is scoped to the class and can do anything a static method can do.
 
6:20 PM
What about:
$f = function() {
    return static::class;
};

class A {
    static function method() {
        return function() {
            return static::class;
        };
    }
}
 
Even though I don't necessarily agree, why is the former not problematic but the latter problematic?
 
@LeviMorrison Because it's static and scoped... you can't rebind it, you'd lose the scope
 
@AndreaFaulds Why is that incorrect?
 
@LeviMorrison Because it lets you break things
 
You are still evading it; why does it break things?
 
6:22 PM
So does rebinding $f to an instance of stdClass
 
@LeviMorrison Well, things it could do before (access private or protected members) no longer work
 
$f = function () { return $this->foo; }; ($f->bindTo(new stdClass()))();
 
How is the closure inside A::method different from $f? $f is scoped to whatever it is bound to; why is this meaningfully different than the one in A::method?
@AndreaFaulds I'd argue that private and protected members only matter at call time, honestly.
Anything else should be closed over via use()
 
Hmm
You know, closure rebinding, as implemented, doesn't really make sense
We essentially allow you to rebind global functions to be methods
Which is weird
Bindable closures should be their own category
 
6:25 PM
@AndreaFaulds Disagree.
Everything should be bindable.
 
@DanLugg No, it should be explicitly bindable
 
Binding a closure created from a global function should yield no side effects barring black magic.
 
We capture $this by default
If you're not intending to use the captured $this, surely that should be specified?
@DanLugg It should be an error because it makes no sense.
What we should have is something like: bindable function foo() { return $this->x; }
 
@AndreaFaulds It shouldn't be an error because that's more shit to have to test for, and a no-op is cleaner.
E_NO_MORE_KEYWORDS
 
@AndreaFaulds Was a mistake in my opinion ^^
 
6:27 PM
@LeviMorrison Wasn't. Good idea, learning from JS's mistakes.
JS's lack of lexical this is a major pain.
It's just that, unlike JS, we have no way to not capture this
 
function f() {
    // doesn't deref $this
}

$f = (new ReflectionFunction('f'))->getClosure()->bindTo(new stdClass());

$f(); // no difference
 
@AndreaFaulds static function() {}
 
^^
 
@LeviMorrison No, that's different
In a static method there's no $this to capture
 
I didn't say static method.
That's a static closure.
 
6:28 PM
Oh, right
 
static function () {}; <-- missing semicolon ;-)
I'm not being helpful, brb.
 
Why must closures be another of PHP's mistakes :(
Not closures themselves, the details
 
wat dafuq? seriously, what is going on here?
@AndreaFaulds @LeviMorrison ^^
Y'know, I do 9-to-5 C# .NET, and every now and then I'll encounter and report a compiler bug but it's fairly inoften and also exciting. In PHP it's just frustrating.
 
If your day job is C#, why do you even PHP?
 
6:46 PM
@AndreaFaulds Because PHP room 11 ;-)
 
@DanLugg Unsure ^^
 
@LeviMorrison It's not just me though, that's completely fubar, right?
 
Something about $this() is changing behavior?
 
Apparently.
 
I wonder if $this doesn't properly use __invoke.
BRB; testing
Seems to work: 3v4l.org/JIQU9
This also works: 3v4l.org/ERUuZ
 
6:51 PM
PHP 5 and below have some weird cases where they assume callables must be strings
I think PHP 7 fixes them
 
So maybe it has to do with $this() and a bound Closure's specifically?
 
@AndreaFaulds But beyond that, $this is apparently undefined.
 
@AndreaFaulds To formalize what you were saying earlier, a closure created inside of a class method is scoped to that class.
That's the difference between it and a globally defined closure.
 
fecking planet...
Why must everyone outside of tech be absolute bumbling imbeciles when it comes to... everything?
 
7:02 PM
@SaraGolemon Bought a new WD NAS drive. Works great out of the box. But it won't back up to the USB 3.0 drive. Turns out they're just doing rsync with timeout set, which is actually causing it to time out. Enabled SSH, ran manually without timeout and it works just fine. So there are still bumbling imbeciles within tech
 
@SaraGolemon it doesn't matter ...
you live in a world where this can happen ...
a real life teddy bear, or red panda, sitting atop a 30 foot log ...
 
@JoeWatkins Firefox is hung up.
 
his friend was also cute ...
 
@Machavity That's not as big as his other bear... must be in the shop.
 
7:09 PM
@DanLugg You mean this one?
 
@Machavity No, that's his dancing cracker.
 
Well crap. I just can't keep up with the Putinses
 
My god
 
@salathe that basically describes how I feel about it
 
what's going on here
 
7:10 PM
@bwoebi You accidentally'd into the GIF bin, room 11 is --> that way.
 
@DanLugg there's no rebeccablack video to click on here…
 
@SaraGolemon you should stop watching/reading news. It's not good for your stress and annoyance levels.
also, you are more likely to end up on several watch-lists if you have the bad judgment of "lemme just write a comment about this"
 
1 message moved to Orphan GIFs
 
anyone know of a Linux tool which I can point to a directory listing and have it spider and download files from subdirectories recursively? It's just some PDFs and HTML files, but don't want to have to code something.
 
wget ?
 
7:22 PM
Jouni sounds like a nice guy
 
Totally
 
186
Q: Using wget to recursively fetch a directory with arbitrary files in it

jerodsantoI have a web directory where I store some config files. I'd like to use wget to pull those files down and maintain their current structure. For instance, the remote directory looks like: http://mysite.com/configs/.vim/ .vim holds multiple files and directories. I want to replicate that on the ...

 
sweet thanks
 
7:38 PM
@SaraGolemon outside of tech?
 
Wait, there's jobs outside of tech?
 
Le sigh.......is there a way to download raw files using wget from github that doesn't involve ignoring invalid certificates? e.g. wget https://raw.githubusercontent.com/php/php-src/master/LICENSE
> ERROR: certificate common name “www.github.com” doesn’t match requested host name “raw.githubusercontent.com”.
 
user895378
7:55 PM
Wait ... does wget not observe SAN names? It must not if you're getting that error ... that sucks.
 
update wget. should work as of 1.14
 
@rdlowrey So wget is just as bad as php was before salvation came in the form of @rdlowrey
 
user895378
I think salvation is maybe too strong a word, but yes :)
 
user895378

That time rdlowrey almost broke PHP encryption

23 hours ago, 47 seconds total – 3 messages, 2 users, 0 stars

Bookmarked 6 secs ago by rdlowrey

 
@PaulCrovella .....and so yet another downside of using Centos. Latest in the main repo appears to be 1.12
 
8:00 PM
@rdlowrey the key word there is almost
 
user895378
Yeah ... it was in master for ~1 week before I was like ... "oh crap"
 
user895378
I plan to add OCSP verification for client streams and the ability to staple OCSP responses for server streams in time for 7.
 
user895378
Right now you might verify a peer cert but you're still up the creek if that cert has been revoked.
 
@ircmaxell oh yeah I don’t like that at all. No voted on default constructors. How do we make more people vote no on that? @kayladnls
holy fuck has AT&T fucked up their international plan features
 
@SaraGolemon Hey, you are pollita on Internals yeah?
 
8:04 PM
yes
 
@LeviMorrison The same.
 
I'm just double checking why you've voted yes for default constructors?
 
'cause I think they're a good idea...
 
On what grounds?
I've voted no but it's not a strong no.
I mean, if you are calling a parent method of any kind you have to know if it exists or not.
 
@spolsky Coincidence in my timeline or did you get the money from Sony? http://t.co/f1C5IPrk2t
lol
 
8:06 PM
If I implement a child class on someone else's parent. I can say function __construct() { parent::__construct(); /* my stuff */ }

Then, if the author of the parent decides to add one someday, it'll "just work". Without a default constructor, I'd wind up breaking their behavior since I'm not invoking their constructor.
 
Wait, I thought default constructors was only for internal classes?
 
@SaraGolemon But what if they add a constructor that requires arguments?
 
@Charles no, all
 
@LeviMorrison If they're responsible, they'll provide default arguments.
Since ever new ThatClass; would break
 
Hmm. That moves my I-don't-have-a-vote from soft yes to soft no.
 
8:07 PM
*every
 
@SaraGolemon there are things you just cannot have sensible defaults for.
 
@bwoebi Yes, but there are things for which you can.
@bwoebi What's important is giving the script authors the power to make that decision for themselves.
 
Power to the library authors, not its users ^^
 
@SaraGolemon yes. Then I'd rather have it break once than it just continues to work, but possibly wrongly.
 
@LeviMorrison Not sure if you intend that to support my point or not...
 
8:09 PM
Also @Sara you're assuming that lib authors only do sensible things…
 
@SaraGolemon No, it goes against your viewpoint.
 
@bwoebi Exactly. If the parent library owner makes that determination, then it will break still
 
If the library author did not provide a constructor then why should you call __construct?
 
@LeviMorrison How?
 
8:09 PM
@LeviMorrison Forward compatibility
 
Why the **** are you extending a class you did not write?
 
You asked my opinion, I gave it.
 
Yes, yes.
 
@LeviMorrison because some frameworks enforce shitty architectures.
 
@LeviMorrison I think the more important question: why are you calling methods you did not write blindly without understanding what they do or if they exist...
 
8:11 PM
I can sort-of see the 'future-compat' if they ever add a __construct. My issue is that's dubious at best if it will ever happen, and the chances of it being zero args? Even lower I'd say. Not worth the Internals machinery.
 
@SaraGolemon Which is why I don't like this. I definitely don't want "Add parent::__construct() at the start of every ctor" to become a thing.
 
Perhaps it comes from C++ thinking. And the fact that most classes do have a default constructor. :p
@NikiC Well, no. I'd much rather have "implicitly call parent::__construct()", but I'll take what I can get. :)
 
It probably depends on the kind of code one writes, but I can count the number of times I used a parent::__construct() call without arguments on my fingers
 
So, let's talk polymorphism!
ducks the rotten tomatoes
 
user895378
If you're extending something you've committed to knowledge about it already. I don't see why it's a problem to expect people to know what that static coupling means for the code they're writing.
 
user895378
8:13 PM
At best it's magical. And that's not something I consider "positive," personally.
 
@LeviMorrison A better question might be "Why are you extending a class you did not write without reading it?"
 
hmmm, I wonder if there's another solution to this problem
 
Sara does have a point though, that you create a class via new Dependency and if there is not a constructor and they add one in the future and it isn't 0 arg, then it's a BC break.
But theoretically you can make a 0 arg ctor to support new behavior without breaking code.
 
public mandatory function __construct(); <-- which errors if not called during object construction
or something along those lines
 
@ircmaxell I like that.
 
8:14 PM
In any case, I would have taken the other road of impl.
Rather than making the call magical, just give them empty ctors.
 
solves the problem @SaraGolemon identified without the associated baggage that default constructors has...
hmmm
 
@ircmaxell But what happens if I, in my new class, need to completely replace the parent constructor?
 
Or: require public function __construct() {...} to avoid introducing a new keyword
 
Like, I need to prevent it from being called?
 
But that's detail
 
8:16 PM
Also, we should definitely get rid of the fact that new Something($fn()) $fn isn't called if there isn't a constructor.
7
That's just complete bull-crap.
 
@Charles in this case, you wouldn't be able to (the primary use-case is setup of private variables)
 
@LeviMorrison 100% agree
 
@LeviMorrison ++
 
It should act just the same as providing too many args to any function or method.
 
At minimum: if (argcount > 0) { dontOptimizeItOut(); }
 
8:16 PM
@Charles and that's why I'm not suggesting all constructors be mandatory, but some syntax (require could work) to indicate "this constructor must run"
 
Better: static analysis to see if anything has side-effects.
 
@SaraGolemon well, that's useful in other contexts as well
 
Mid-ground of "Is this constant and simple variable only" would be a good middle ground
@ircmaxell In other cases there isn't the "this doesn't even have to exist" rule though
 
fun fact: an initial build of Recki blew the doors off of bench.php because it saw output didn't depend on any of the benchmark function calls (which had no side-effects) and optimized them out
 
Though one could apply it to the extra-args and func-get-args not used case
 
8:18 PM
even function calls
 
user895378
@ircmaxell lol
 
@ircmaxell lol
 
user895378
I love those benchmarks
 
function id($a) {
    return $a;
}
id(10);
^^ since the return value isn't used, the entire function call can be optimized out
 
HHVM inlines those
 
8:19 PM
sure
 
user895378
You have those five minutes where you're like, "I AM A PROGRAMMING GOD! LIGHTNING BOLT! LIGHTNING BOLT!" ... then you realize that both you and your benchmark are stupid.
 
Oh, yeah, it'd noop that too
 
then you can dead-code eliminate that inlined logic
 
This, btw, is the kinda stuff I added the ast hook for. I wanna put these optimizations into PHP. :)
 
@SaraGolemon ++
 
8:20 PM
@SaraGolemon what optimizations do you have in mind?
 
I'm also working on some optimizations along those lines in Recki where you can generate out PHP code, so it could be a build-step
the problem with doing that at the AST level tho is you need to build a CFG for any of the interesting optimizations, so to compile back to AST is fairly tricky (rather than going directly to opcode)
 
@NikiC SSA, Inline, expression folding, no-side-effect function folding, etc...
 
@SaraGolemon sounds great
 
And if it makes PHP7 more competitive with HHVM... eh...
 
the only optimization the compiler currently does is constant folding
 
8:21 PM
@NikiC Yep, we have plenty of low-hanging fruit to pick :D
anyway, must hit the road, will be back on later
 
@SaraGolemon if you're really interested in that, perhaps it's worth talking about making a CFG a first-class entity in the compiler, so Zend would compile AST to CFG (in SSA form) which would then be passed to extensions...
 
@ircmaxell Let's brainstorm at BNL about this. :D
 
SGTM
tho some parts of the language are going to be REALLY hard to make SSA (specifically references and some of the compact()/extract()/variable-variable stuff)
which may kill the idea before it even starts
hmmm, now I'm interested. DAMMIT
as if I didn't already have enough crap to do/work on
I need minions^H^H^H^Hinterns...
 
Simple: kill references.
^^
 
kill extract while you're at it
 
8:33 PM
If I ever create a something-like-PHP-impl I won't support these features:
- late static binding
- references
- static closures (since there is no late static binding, there is no difference between a static an non-static closure really)
 
you need some sort of concept of reference, every language has one...
 
Objects have reference mechanics.
That is your 'reference'.
 
that works for me
 
But I fear there is so much code out there that uses LSB and references I doubt my impl would ever really work ^^
 
@ircmaxell Gosh, I wonder if HHVM ever ran into those problems. :p
((Short version, we largely throw up our hands in disgust over things like extract() and variable variables and such))
 
8:38 PM
Do you have to back out of analysis or is it just more complicated logic?
Hack doesn't understand references right?
 
I'm honestly not sure how hack responds. I know we outlaw extract() in hack
 
> The Hack type checker largely does not understand references and pretends that they do not exist.
 
user895378
Please kill extract(). Please.
 
snort
 
@SaraGolemon well, we could emit a NON-SSA CFG, and leave that to extensions (which could then add the SSA form with the restrictions it requires)
 
8:41 PM
@ircmaxell I say we start building stuff and see what sticks. :)
 
hehehe
 
I should push towards making my local website reference-free, including arrays ^^
 
the only references I use in Recki are because of @NikiC
 
@rdlowrey that'd break my code! :-(
 
@bwoebi why are you using extract?
 
user895378
8:44 PM
I'm fine with list() but I don't like extract()
 
templates?
 
@ircmaxell Yes, blame it all on @NikiC
 
@FlorianMargaine you should be using a templating language then
 
user895378
templates is the usual place where extract can be justified
 
@NikiC well, it's true
 
8:44 PM
@ircmaxell why? php is good enough as a templating language
 
function include_file($codefile) {
    extract($GLOBALS, EXTR_REFS);
    require_once($codefile); /* do some manipulations on $codefile, it's not just this... */
    $GLOBALS += get_defined_vars();
}
 
Hi, room!
 
@FlorianMargaine no it's not
 
@bwoebi But what if codefile was overwritten?
 
i need to add more 10 faq for each article. for mysql database better i choose (serialized, json, etc) Or row columns ?
 
8:45 PM
@bwoebi ummmm....????
 
@LeviMorrison yeah, well, it won't…
@ircmaxell (legacy code from 2003, not really my code)
 
meh. Should we really argue that? Hasn't it been done over and over again?
 
@bwoebi which you're using to justify the existance of extract???
 
@ircmaxell no. to justify that is has other uses (which doesn't mean these use cases are good ones)
 
legacy is valid, and realistically we wouldn't be able to remove it
 
8:48 PM
@rdlowrey If I remember correctly, you use it to extract parse_url with a prefix
 
OH WOW
 
user895378
I think I have a place where that happens, yes. But I wouldn't be sad if I needed to go in and change it because the language killed it :)
 
what's up Andrea?
 
so I just grep'd Recki's source for &, and they all are either in quotes (const BITWISE_AND = '*';) or doubled up &&... so yeah, no references :-D
 
Oh wait that was sent to me
Not to internals
 
8:49 PM
lol
 
Still, I couldn't tell the difference :p
Why do people email me? Feels weird, I'm never sure how to respond. I don't always
 
lol
I was looking, and like "I don't see that"
@AndreaFaulds I don't either
 
Sometimes I get good emails. Like when Dmitry urged me to work on Scalar Type Hints
 
No-one emails me. :*(
 
By the way, @Andrea, I'd appreciate it if you chime in on the static closures thread on Internals.
 
8:51 PM
Also, I observe that legacy code is rendered unreadable by language changes. First register_globals, then magic_quotes, then probably mysql (we don't want to rely on a possibly badly maintained ext) etc. code just gets patched over patches.
 
But then there's random outsiders thanking me for writing an RFC, which is kinda nice
And then there's others who just ask me random stuff like I'm some PHP guru
 
Basically point out that we have scoped closures inside methods to support private and protected access.
 
@LeviMorrison I... might.
 
@tereško how was the interview?
 
?!
 
8:54 PM
@bwoebi ideally, that should be the other way around (fix magic_quotes first, then register globals)
 
@ircmaxell well… not fixed. emulated.
 
/me twitches
no, do not, under any circumstances, emulate magic_quotes. Fix it.
 
legacy codebases, you know? :-D
 
No, I don't.
I worked on a legacy code base and we were expected to make it complaint with whatever Debian shipped at that time.
 
@bwoebi I have worked on a lot of legacy codebases. And the first step I ever do is fix magic_quotes
you want to emulate register_globals to buy you time? go for it
magic_quotes is an immediate and critical level security issue
 
8:57 PM
We still suffer from magic quotes in one or two places (bugs from removing it, I mean).
But register globals was definitely fixed quickly.
 

« first day (1557 days earlier)      last day (3394 days later) »