« first day (1616 days earlier)      last day (3346 days later) » 

2:05 PM
@Danack You don't vote for dictators.
 
insert monty python references here
 
@LeviMorrison well, sometimes, yes you do
 
didn't Germany vote for Hitler?
 
@ircmaxell I don't think "Vote for me or I'll kill all your family" counts as voting.
 
@FlorianMargaine that
@LeviMorrison no, the vote is how they initially get into power, then they just stay there
 
2:08 PM
tbf, they didn't vote him to be a dictator
 
which is what @LeviMorrison meant about not voting for dictators
 
Strawpoll: which PHP.net website would you like to see improved?
7
 
user4433485
hi ladies and gentlemen
 
@HaltlolXD fyi the reason you get no response to this is that no-one here considers themselves to be either of those things :-P
 
user4433485
Lol :D
 
user4433485
2:16 PM
Hi Fools and geeks!
 
Hi!
 
user4433485
^^
 
@LeviMorrison what's your definition of improved?
in general? Or design? or...?
 
@ircmaxell I left it undefined on purpose.
 
user4433485
@DaveRandom there are ladies and gentlemen on stockoverflow tho:p
 
2:17 PM
@LeviMorrison The poor usability of bugs is hampering the project - the others don't matter imo.
 
@LeviMorrison OK :-)
 
What's a reason I would locally load a page fine but in a browser my html is practically cut in half? Chrome keeps telling me "net::ERR_INCOMPLETE_CHUNKED_ENCODING"
 
user4433485
what does google say about the error?
 
Nothing that's been useful so far.
Some say Chrome specific issue, some say CORS issue, some say cache control.
Nothing has really worked.
 
user4433485
Could you upload JsFiddle?
 
2:22 PM
@LeviMorrison cheap improvement for bugs.php.net: Replace the select for the bug category with autocomplete dropdown thingy
 
Not really tbh, I doubt it's a JS/HTML issue.
 
user4433485
yes, you could upload jsfiddle
 
user4433485
brb, smoke break:) don't forget to @ me so I can read it back in 10 min or so
 
user image
2
courtesy of @Farkie
 
lol
 
2:27 PM
@DaveRandom lol
Throw in some Python while it's still dark, before the Eclipse is over
 
@DaveRandom lol
 
@Fabor What's your server setup? Is it only happening with one specific document and other pages from the same server/vhost container are loading OK?
 
Happy Happiness Day!
 
Think I am narrowing it down @DaveRandom. Mustache issues with some loops
 
2:46 PM
Fake Internet points to someone who finds a duplicate for this bug: bugs.php.net/bug.php?id=69262
 
@LeviMorrison public proprety
 
Thanks mate.
 
wrong ping and same link found ^^
 
2:49 PM
@LeviMorrison site:bugs.php.net property accessors Google, fyi
dammit, also wrong ping :-P
 
@DaveRandom lol, searched for the same, just accessor without s^^
 
> Google (n): Black magic
 
Also, I know voting on bugs doesn't really do anything but for the sake of Internet points will you guys vote for this bug as high importance to you? bugs.php.net/bug.php?id=43157
 
@LeviMorrison what are dynamic properties? __get/set?
 
@FlorianMargaine I guess I should clarify, but I think it means adding properties to the object that aren't declared in the class.
 
2:54 PM
@FlorianMargaine No, expando props I think
 
@LeviMorrison ah
how would you implement that though?
declare(expando_properties=disabled);
?
:P
 
I personally want to deprecate and remove that behavior.
 
@LeviMorrison That… actually is a nice way to store metadata to an object…
 
@bwoebi So declare a private $meta variable that holds it.
 
@LeviMorrison no, metadata on the callers side
not on the callees side
 
2:57 PM
Ugh, you have the strangest use-cases for things.
In any case, it complicates one of the biggest memory savings optimizations: compiling classes to more compact structures.
 
@LeviMorrison nope…
 
And it also just sucks because it's often an error.
@bwoebi Go look at a JS engine. Yes, it unambiguously complicates compiling classes.
 
In case we don't add not explicitly defined properties, we already use a compact structure.
We just use an alternative structure [HashTable] when the first implicitly defined property is added.
 
@bwoebi It's not really that compact...
 
@LeviMorrison It's an array of zvals. And $this->var is compiled directly to the array offset.
 
3:01 PM
@bwoebi We don't compile the methods.
Do we compile parent properties?
 
I need to look that up.
 
@bwoebi there's a bunch of things, I don't know if it will explain it gist.github.com/nikita2206/921ea24e935e5b6d1c6c
 
@bwoebi I don't think we do because of dynamic parent properties. I think we can I just don't know if we do, because it makes it more difficult.
 
@LeviMorrison What would you do with stdClass? special-case it? Or make it an internals-only feature?
 
3:04 PM
@DaveRandom It was nginx config for proxy_temp. I change nginx to run as a different user and it didn't have permissions for proxy_temp_path. So it was cutting my file off around 65k. Centos 7 related maybe. First time on 7 and not had this issue before.
 
@DaveRandom Probably. Not 100% sure.
 
@LeviMorrison looked up. We don't compile the offset at compile time… but put the offset upon first fetch into a polymorphic_cache_slot. And yes, we merge parent tables etc. there.
 
@bwoebi Can you show me the code for parent properties?
 
@DaveRandom Implement __get, __set on it ^^
 
@NikiC Yeah, that works.
 
3:06 PM
Ahh yeh, makes sense
 
To my knowledge there is very, very little that can be done with dynamic properties that can't be done with formal __get/__set.
And I much prefer the explicitness of the latter.
That's really where I'd like to see PHP's future go: become a more explicit, dynamic language.
All varargs functions need to use ... is another potential example.
 
@LeviMorrison zend_object->zobj contains all explicit property offsets from class&parent(s)
 
Ah, right. A parent can't have dynamic properties.
We don't expose a parent "instance".
 
yes
dynamic properties are always bound as public to the whole object
 
@LeviMorrison ...i.e. bin func_*_arg*()? Because if you mean something else internally then I know of at least one internal function that does something you can't do explicitly in userland with ... (array_multisort())
 
3:12 PM
@DaveRandom No, those functions don't need to be removed.
 
...but prevent their use in functions that don't have a ... in the signature?
 
@DaveRandom Possibly. Really I want passing too few or too many parameters to a function to fail except when ... is used.
(well, too few isn't an exception to that; just too many)
 
@DaveRandom why that? var_dump(func_get_args()) is sometimes nice if you just want to quickly debug inline and see what args were passed into the function.
 
Well, I closed a few bugs on bugs.php.net today. How about you guys?
 
@LeviMorrison Preferring to code on php-src ;-D
 
3:15 PM
:)
@bwoebi Thanks.
Hey @bwoebi, do you know why this is in a do {} while (0);? lxr.php.net/xref/PHP_TRUNK/Zend/zend_vm_def.h#1781
 
@LeviMorrison because break; statements?
 
I suppose.
Seems odd.
 
Why odd?
 
Should probably be a function with return.
 
You also could use goto
 
3:19 PM
I think a function with return would be better, honestly.
(I know some people disagree with that idea, though, so I'm not going to push it)
 
@LeviMorrison no, OP*_TYPE is accessed directly which is set via zend_vm_gen.php, so, cannot be put into an extra function
 
@bwoebi This is honestly a horrible part of our architecture.
 
@LeviMorrison sure? It rather is a nice optimization at the very core of the VM
 
And while also on the topic of horrible things, note that that same do-while block uses EXPECTED for practically every conditional.
 
Happy fryyyday Room11 =] yaaay!
/me opens a beer!
yaaaay [=
 
3:22 PM
@LeviMorrison because a cached $this->var is the expected way.
 
Humans get branch predictions wrong quite a bit.
I've seen code that removes these things and becomes faster.
Leave branch prediction to the hardware.
 
@LeviMorrison I've also seen cases where branch predictor was awfully wrong and made the whole code enormously slow down…
 
@bwoebi So do it in those cases only.
 
@LeviMorrison only issue is that it often is really hard to isolate the perf bottleneck to a specific branch condition
 
We have three expecteds in a row in that code. I am fairly confident at least two of them are not actually expected in practice.
@bwoebi So let's slow down our code in general by doing everything with EXPECTED? That's not a good argument.
 
3:25 PM
@LeviMorrison I broke the entire sales floor of a 120 seat call centre for ~2hrs. All in all, pretty productive day. Oh, no, wait, the other thing.
 
'noon
 
@DaveRandom … do I laugh? (lol)
 
@LeviMorrison Well, != UNDEF and != DYNAMIC_PROP is definitely expected. If it's expected that it's cached… yes, I think so.
 
1789            if (EXPECTED(prop_offset != (uint32_t)ZEND_DYNAMIC_PROPERTY_OFFSET)) {
1790                retval = OBJ_PROP(zobj, prop_offset);
1791                if (EXPECTED(Z_TYPE_P(retval) != IS_UNDEF)) {
1792                    ZVAL_COPY(EX_VAR(opline->result.var), retval);
1793                    break;
1794                }
1795            } else if (EXPECTED(zobj->properties != NULL)) {
1796                retval = zend_hash_find(zobj->properties, Z_STR_P(offset));
1797                if (EXPECTED(retval)) {
 
At least most class code which is repeatedly called, is not just a few times called…
 
3:27 PM
By definition the else if can't be expected if the first if is expected.
That's a guaranteed incorrect prediction.
The inner ifs can be expected, and one of the outer ifs can.
But not everything.
 
No. That means, in case the first if unexpectedly fails, we expect that the subsequent if then won't fail
 
@bwoebi No, that's not actually what it means.
 
no?
 
It has to do with code layout in memory and branch predictions.
These macros rely somewhat on compilers and somewhat on hardware.
Using EXPECTED in that else if means the compiler cannot move it out of line.
(it may not be able to anyway)
 
@LeviMorrison I didn't, but you can :-P
 
3:30 PM
I know what compilers can do (e.g. it saves one jmp instruction to put the expected branch after the unexpected one…)
 
Sure, but a saved jump instruction does not mean it's faster
 
@LeviMorrison You realize, that this else if is basically an else { if (...) {} } which is an inner if.
 
@bwoebi There's no "basically" about it. They are exactly the same.
 
There is nothing like multiple outer ifs
An if is just two branches after conditional
 
Right, but where they are placed is important.
You can do conditional jumps on failure and the passed conditional's body is the next instruction, or you can do a series of jumps and put the bodies out of line. (There are other options too)
 
3:35 PM
@LeviMorrison Don't take my word on it, but I think dmitry often places expected/unexpected by reading the assembly and making sure the fast-path is linear
 
When you use these macros you add extra meaningless conditionals to try to finagle the code into looking a certain way, even when that resulting code is not what is best overall.
 
@LeviMorrison well, compiler branch predictions. It actually has little to no effect on the CPU's branch prediction engine. All it does is eliminate jumps in the expected path (so you're jumping out of the linear flow for the unexpected paths)
 
@NikiC As often as we use EXPECTED/UNEXPECTED there is no way all of them are measured improvements.
 
@LeviMorrison not all, sure. stuff like checking whether an exception was thrown is usually directly wrapped in unexpected ^^
 
@NikiC github.com/php/php-src/pull/1185/commits Dmitry did some refactoring
 
3:42 PM
> You may use __builtin_expect to provide the compiler with branch prediction information. In general, you should prefer to use actual profile feedback for this (-fprofile-arcs), as programmers are notoriously bad at predicting how their programs actually perform. However, there are applications in which this data is hard to collect.
 
So I finally figured variance rules for lambda types, it kinda works now github.com/nikita2206/php-src/tree/callable-signature-typehints
 
@nikita2206 The tl;dr is that parameters and return types are invariant.
 
@LeviMorrison not for lambdas
 
All types must exactly match.
@nikita2206 Give me a concrete example.
 
@ircmaxell "some"
 
3:46 PM
yes
 
It was done because other way was hard to do because of compilation time issues. But thing is runtime
 
crossposting from #php.pecl: does emalloc request memory from a pool or should i allocate more memory in advance when i know that i will need it? xhprof implements some magic on structs that it creates using malloc (not emalloc) i was wondering if just switching to emalloc would allow me to get rid of these optimizations
 
@bwoebi @NikiC I think our EXPECTED macro is too limiting: lxr.php.net/xref/PHP_TRUNK/Zend/zend_portability.h#260
 
@beberlei yes, it's a pool
 
Clang and Intel support the builtin.
 
3:47 PM
@LeviMorrison here's an example of what is possible (including possible variance paths) gist.github.com/nikita2206/efbd3148101ea08cbc73
 
@ircmaxell so when i efree() it doesnt actually free, but reuses if i emalloc a same type later? xhprof does this here: github.com/QafooLabs/php-profiler-extension/blob/master/… it seems like a sane optimization
 
@beberlei if you use ZEND_ALLOC, yes
 
@nikita2206 That is not helpful.
 
@ircmaxell any docs on that somewhere by any chance?
 
Also, what does function (callable: A $cb) even mean?
A callable that returns an A? (If that is true then require parameter lists)
 
@ircmaxell thanks
 
@LeviMorrison It's pretty hard to explain. I tried to explain it here gist.github.com/nikita2206/921ea24e935e5b6d1c6c also you can read this chapter on wiki en.wikipedia.org/wiki/…
 
^^ I was in that talk, but haven't watched the video. It explains it quite well
 
@nikita2206 I am intimately familiar with covariance, contravariance and invariance.
My point is that in PHP all parameter and return types are invariant. You can't use different rules with callables.
 
why does php.net/manual/en/internals2.memory.management.php refer to a programmer as "hacker"? :D
 
3:51 PM
It's the same as inheritance, essentially.
 
@LeviMorrison I have to support all possible ways. If you typehint callable: A - it means you don't care about input, but only care about output. If you typehint callable(): A - it means you want this callable to accept zero required parameter
@LeviMorrison I can, why not?
More over I NEED
 
Please don't go that route. Allow no signature or complete signature.
@nikita2206 Callable compatibility is no different from inheritance compatibility.
And in PHP inheritance says invariant.
 
@beberlei zmm uses a small alloc cache, which is similar to that code there, just a bit more generic
 
It's not what I want, but it's what we have.
 
@LeviMorrison Well it's pretty much different
 
3:53 PM
@nikita2206 No, it is not.
 
In general or in PHP? If in general then no
 
Assuming B is a subtype of A, I understand how one could pass a callable(): B to something expecting callable(): A.
I understand that.
It's the same thing with inheritance.
If the method has a signature of function(): A then the child must be compatible, and in type theory function(): B would work.
But PHP doesn't have that. It only has invariance.
 
@LeviMorrison I don't reaaaly see that as a problem
 
Make inheritance support contravariant parameters and return types support covariance and then go ahead. OR make callables match with invariance.
I also think not specifying the complete function signature parameter list is unwise.
 
Look, interfaces and classes can be nested and we support this. Basically we support covariance and contravariance on the clases/interfaces level (meaning that B can be used anywhere where you expect A) but you don't get this with functions, so there's only way to support inheritance between functions
@LeviMorrison that's not something I have strong opinion about... I just made it possible because I could
 
3:58 PM
I think maybe we might be misunderstangin something. Just a moment.
Let's make sure I'm on the same page.
function f(callable(): A $a) {
    $a();
}
function g(): B { /* … */ }
@nikita2206 I can pass g to f, yes?
 
Yes, you can pass g to f
 
Okay, that isn't what I'm talking about. I'm talking about something like this:
(but I do agree, that is permitted)
interface A {
    function __invoke(callable(): A);
}
interface B extends A {
    function __invoke(callable(): B);
}
Permitted, or not?
 
That would violate LSP I think
 
It doesn't. Is it permitted in your patch?
 
@nikita2206 huh? Why would that be allowed?
 
4:03 PM
@NikiC Because B is a subtype of A.
function f(A $a) {};
f(new B());
^ It's the same as this (assuming again that B is a subtype of A)
 
Honestly I still try to evaluate it. But I didn't even touch inheritance of types yet and this is of course not going to be changed.
 
@LeviMorrison oh sorry, I wasn't aware of that constaint. Thought A,B are random classes
 
Unless someone changes everything
(as in reworks it to implement full support of covariance/contravariance for args and returns)
 
@NikiC Was a bit farther up, yeah.
@nikita2206 For the record, when doing inheritance they need to exactly match.
4 mins ago, by Levi Morrison
interface A {
    function __invoke(callable(): A);
}
interface B extends A {
    function __invoke(callable(): B);
}
^ this would be invalid.
Essentially, when doing inheritance the signatures must exactly match, but when you are seeing if a particular value (not declaration) is accepted it's quite trivial: check if the passed types are subtypes of the declared types.
 
yep yep, I know, still trying to evaluate it, I still think it violates lsp
 
4:09 PM
Take your time.
Maybe a simpler example with just return types would help:
interface A {
    function __invoke(): A;
}
interface B extends A {
    function __invoke(): B;
}
(PHP doesn't allow this, but is type-safe in type theory and does not violate LSP)
 
Yeah, it doesn't
 
@LeviMorrison Yeah… I have no idea why this !defined(DARWIN) is in the #if there… But I'm not a compiler expert to know that.
Maybe Dmitry knows… no idea.
 
I have question about separation of concerns. If I have a data class that holds attributes of an email. I am I right that there should not be any actual data manipulation in a class such as this to allow for reuse? There are several attributes that I have to parse. Those should be performed outside of that class, right?
 
@LeviMorrison I wish it would work…
 
I should have said that the class creates to data object that holds the attributes of an email.
 
4:17 PM
@Danack "master Empty commit to trigger a new build" funny how a Travis employee used a git push to trigger a build instead of using the travis web interface for that. :P
 
@gutenburgb I dont see why methods that allow data manipulation would hamper reuse. if the manipulation is on the data of the class, it's cohesive and placed correctly according to InformationExpert principle
 
hey, is this complete nutter?? pastebin.com/qVc5kPJ4 Basicy I just want to unit test the function (me feels ashamed)
 
@Tyrael Eih, I didn't even know that this works at all via webinterface…
 
@bwoebi you can only see those extra buttons when you are added to the github repo/organization for that build
 
@Leigh if we're going to introduce slice syntax, I'd go for making {} offset based indexing with slice support. So $foo{-1} is length-1'th element (both str+arr) and $foo{0:-1} is array with one elem popped
 
4:20 PM
but yeah, you can restart the build manually on the web ui, for the whole build or per matrix jobs
 
Ah okay
 
@RonniSkansing why do you think you need to do it that way? what does it give you over just checking in the file system? also, cant you test the correct functionality through another method, e.g. get($key)?
 
php -r '$a = [-1 => 1, 2]; var_dump($a{-1});'
int(1)
 
@bwoebi I'd like to do it. One day.
 
@NikiC ^ You want to break that?
 
4:21 PM
@Tyrael Can't blame him ... the travis interface is oh so slow
 
@Gordon thanks
 
@bwoebi yeah. nobody uses {} for array indexing
 
only the log listing imo (and only for builds with long build output)
 
@Gordon that I do not use the file system. I want a unit test not a functional test. No cleanup in file system... hmm said in another way I think of the filesystem as the I would the database, I do not want to use it, I want to mock it out
 
If we already support this ugly alternative syntax, may as well use it for something useful
 
4:23 PM
@RonniSkansing how about vfs.bovigo.org
 
@bwoebi Maybe I'll submit a PR that generates a definition based on a configure test.
 
that infinite scrolling/collapsing javascript display for the build output is really expensive when the build output is huge
 
@NikiC Yeah… I've seen it in some ugly old PHP 3 code… but well… that was the only time in my whole life I ever saw it…
 
"Did the compiler fail? Okay, don't use builtin."
 
@LeviMorrison +1
 
4:23 PM
@LeviMorrison yes, please.
 
@LeviMorrison and since it's not a BC break, it can be done in a minor :-)
 
@ircmaxell did you review dmitry whole version or only diff to your patch?
 
@Gordon thanks, I need to read up abit and I will get back to you =] cheers
 
@NikiC the entire version
 
k
 
4:24 PM
@bwoebi I'll have to learn how to use those parts of autotools though. Might take a while but it's good to learn new things.
 
I looked at individual patches to learn what he changed and why (for my own edification), but the "review" itself was on the entire end result
 
Oh, and I'm not going to just steal an existing test for it (I know they exist).
I will force myself to learn something here.
@ircmaxell Well, that might not be true. If you are talking about covariant return types then yes. If you mean invariant parameter types... maybe.
 
@LeviMorrison well, we're already invariant, no?
 
invariant contravariant
 
ah yes
 
4:32 PM
I know A' means a sub-type of A, but is there a super-type notation? Can't find it.
I think they say something like B where A is B'
Or they use and company. I've never like that notation though.
Subtype: B ≤ A
@bwoebi Should it go in acinlcude.m4 or aclocal.m4?
Previous experience says latter, but based on the contents of the two files I'm not so sure.
 
acinclude I believe. Because that's not a macro specific to some part of ZE, but everywhere where EXPECTED is used… Not sure, better ask someone else and tell me what he says then.
 
4:49 PM
O.o We define PHP_CHECK_STDINT_TYPES in both files.
Is the latter auto-generated for us or something?
I'm not very familiar with autotools/autoconf.
 
… I have no idea. my experience with these files was trying until it worked^^
 
@Gordon thanks. Worked well. I ended up with something like this instead pastebin.com/W9X53Spm
 
in reference to thehackerblog.com/…
This is what an eclipse viewed from space really looks like. http://t.co/T3Rd9CbS0m
 
@LeviMorrison wait. aclocal.m4 is an autogenerated file.
 
@bwoebi You sure? I thought you took that and generated the configure?
 
4:59 PM
100% sure.
 
Okay. So where do I put it and what command do I use to update the configure script?
 
@LeviMorrison buildconf (to update). And acinclude.m4 is global, configure.in is specific to static build
 
@Tyrael To be fair, the travis web interface is pretty horrible.
 
posted on March 20, 2015 by kbironneau

/* by danja */

 
5:17 PM
@bwoebi Thanks. Was transitioning locations so that was quite helpful.
 
make distclean && ./buildconf && ./configure ... && make -j8 && make test
 
This machine is a wussy dual core with hyperthreading. All I get is -j 4. I miss my -j 24 at work :(
 
yo
 
ho ho and a bottle of rum.
 
@bwoebi this list is outdated already, I have a new wish list. But leaving the params out seems even worst IMMO
@NikiC are you trying to do some form of error recovery?
@Danack I'm finally catching up with the ML, thanks for reporting that bug :D I messed with the wrong part of the VM
 
5:33 PM
@marcio cool. tbh I think we really need a better process for scheduling RFCs....having ten open at once is a bit much.
 
A good chunk of that is due to everyone trying to get them in before the deadline set for 7.0
 
Which was announced only about 3.5 months in advance
 
@Charles Yeah.....but a lot of the RFCs really didn't need to be done for such a strict deadline. e.g. my CTOR behaviour one has zero impact on anything else in core, and almost zero impact on userland code. It could have been done after the first alpha.
Also, 23-1 \o/
 
@marcio link?
 
@bwoebi not on a gist yet, will do it soon
@Charles as long as we have a feature freeze announced at least 8~10 months before the date I see no issue. I started to contribute ~2 months before the feature freeze and only got to know there was a formal date less than one month before.
 
5:40 PM
Makes me wonder if there'll be a similar problem with 7.1...
 
It won't be as bad, because there's fewer possibilities for making changes that affect BC.
 
@Danack better idea would be to have a "release manager" who controls voting
giving some consistency to the process
 
FYI I tried multiple things on the ext tokenizer these days:

1. prepass before lexing - is reliable but caused perf issues and is too hard to maintain. In the middle of the patch I realized that pre analyzing source was too slow.

2. Make lexing and parsing non concurrent: lex first, post process what was lexed and then parse - it's reliable but required too much changes + not as efficient as the concurrent steps we already have.

3. (currently) Post process the returned token stream of token_get_all - this gives a bit of duplicate work but seems to be the easiest approach and is as reliab
 
hi all
 
BTW, how do we access a specific index of a zval? (array) :3
 
5:55 PM
@marcio of an array? check zend_hash.h, there are a ton of functions depending on specifically what you need
 
@marcio zend_hash_index_find(Z_ARRVAL_P(...), ...) ?
 
ahh, it's all on zend_hash, thanks :)
 
eiiiih… why do we now have Z_ARR() and Z_ARRVAL()?! The one being defined by the other…
 
@marcio You can also include this header if you want a nicer API
https://github.com/sgolemon/php-array-api
I keep meaning to pick my RFC for this back up, but.... internals.... shudder
 
@bwoebi BC?
 
5:58 PM
If anyone wants to run with it, god speed
 
@ircmaxell I mean… why do we have Z_ARR at all?
We didn't have Z_ARR before PHP 7…
Some months ago, we made a difference between zend_array * and HashTable *
 
perhaps a relic?
 
and Z_ARR referenced the zend_array *
yeah… seems so
 

« first day (1616 days earlier)      last day (3346 days later) »