« first day (2048 days earlier)      last day (2899 days later) » 

7:00 PM
Basically I tried to make the API as simple to use as possible in the general case, but also granular if you want it to be
Similarly with publishing progress updates on server op promises - you don't need to handle them if you don't care about them, but they could be useful for debug logging
I've no objection to building in some kind of optional auto-reset mechanism (which can be enabled by default) though
although that would be hard to test
 
7:12 PM
@rdlowrey actually that said, if you have some idea for a simpler API (?) there's nothing to stop them co-existing. This is a thin-ish, maximally powerful layer which unifies the two underlying ext libs while still retaining as many use-case possibilities as it can, but there's also a reason why e.g. both DOM and SimpleXML continue to exist and that may be the case here as well :-)
 
@Wes example why it doesn't work… you want to create two objects which reference each other … the first assign will fail because the other object has not set that property yet
 
pq supports an EVENT_RESET watcher
I'd guess so does ext/pgsql
 
@m6w6 isn't that fired after a reset op though?
Also ext/pgsql is missing a lot of things
I have been learning this today :-P
 
!!lxr PGEVT_CONNRESET
 
@m6w6 There were no results for that search
 
7:19 PM
yup
 
@DaveRandom Ugh, I guess?
 
uggghh that moment you wrote a comment and it doesn't look like English when you read it back :(
 
> The connection reset event is fired on completion of PQreset or PQresetPoll. In both cases, the event is only fired if the reset was successful
You want it to tell you that it's about to do a reset instead?
I mean, you probalby know, you gonna call reset() :P
 
!!version
 
7:22 PM
Anyone used software for creating bar graphs, line graphs and doughnut charts that they liked? It must be PHP 7 compatible if it's PHP but must run server side.
 
@m6w6 No but I wouldn't mind something that tells me when the connection state enters CONNECTION_BAD (i.e. when I need to do a reset)
 
@DaveRandom Oh, hm...
@LeviMorrison No
:0
IIRC there was some PEAR lib that was not all that bad... but that was about, ugh, half a life ago
 
@LeviMorrison At a place I used to work someone wrote something that rendered them in HTML and used wkhtmltox to imagify it. And I'm sorry because I know that's a hideously unhelpful anecdote, but the guy who wrote did know what he was doing and asserted that he spent a long time looking for something better and did not find it which is why he rolled that.
 
@LeviMorrison I worked with some layer (cannot remember the name sadly) in between this some time ago.
Or does it have to run serverside. I cannot understand your engrish sentence atm :P
 
It needs to generate images server-side. Or at least the time series data does.
 
7:27 PM
k
 
@m6w6 I can check the state when stuff fails, at the moment I just throw but it would be easy enough to check the state and implement some kind of auto-reset mechanism over it
 
The doughnut charts and bar graphs don't really matter but since the time series data (line graphs) definitely needs to be done server side.
 
What's bugging me at the moment is the lack of single row mode in ext/pg
 
@LeviMorrison You can still render d3 graphs on the server :p github.com/gregjopa/d3-server-side-demo
 
Wes
@bwoebi that is not a good argument. one or the other is an "optional dependency" so the field must be nullable
 
7:28 PM
Which I can deal with in terms of normalising the API but it's a potentially serious memory hit, apart from anything else
 
@bwoebi Regarding the default driver: I really want to avoid having it always set. Otherwise there will be people initializing their stuff outside of Loop::execute and things will break when there's a watcher created outside in a constructor and then Loop::execute will use a new loop and things break.
 
@MorganTouvereyQuilling he suggested a node solution. Get him!
 
@PeeHaa Huh, at least that's possible on Node, PHP lacks a good HTML/DOM API :/
 
j/k
 
@kelunik there's no alternative to that, except if you force users to set it themselves. And that, we should avoid.
 
7:30 PM
@MorganTouvereyQuilling node.js, on the other hand, is perfect in every way :-D
 
@bwoebi It will only be required for sync environments and can even be done in a autoload.files of the wait package.
 
@DaveRandom Have you really used it ? :D
 
@kelunik this creates a dependency on the order packages are loaded (i.e. problematic if the wait package is loaded before the loop package). That's not possible.
 
@DaveRandom Totes. Node.JS is the best. Like MongoDB.
 
mongoledb
 
7:33 PM
@NikiC s/best/the most hipster broad-usage dynamic language thing/
 
Oh wait. That's probably mysql I'm thinking about now
 
MySQL ? That's just a horrible Oracle corporate fork of MariaDB
 
hehe
 
@bwoebi Because there may not be a factory yet? Yes. Then the user has to do it.
 
@kelunik Which is exactly what we want to avoid. No way.
 
7:34 PM
@bwoebi Why?
 
@DaveRandom Uh, well, it got pg_update instead!
 
I've not even looked at node for ages, I have no need for any kind of NoSQL at the moment, I've not touched MySQL for ages, I don't write HTML/CSS any more... my life is good.
 
@kelunik The user should not have to do it. And we should not have to rely on composer loading order.
 
Why should the user not have to do it? Why is it a no way?
 
@m6w6 I will bet money that if I do a blame on it I will find Yasuo's name.
 
7:35 PM
We want to abstract the event loop away.
 
oh, 4.3.0, maybe not
 
@kelunik we have the same problem when the event-loop will be builtin in PHP.
Do not introduce arbitrary restrictions there.
It's fine the way it is.
 
@bwoebi Why?
 
@kelunik because "wait" (aka await) will then be always loaded as it's a builtin
 
wait isn't await.
 
7:38 PM
Hey, today I was wondering if that could be easy to build native extensions in Composer, like npm does with node-gyp, based on gyp. Couldn't we make a standard way of building PHP extensions so they are normal Composer dependencies? And keep them locally installed and loaded via (a revised version of) dl() or something like that.
(I don't know what the difficulty is, i'm a noob in C-related things, but I'm really annoyed by globally-installed-PECL-libs)
 
@kelunik it isn't?
oh, true
 
@bwoebi await is the current yield then.
 
wait() runs the loop.
But anyway, that function will probably be builtin then.
 
@MorganTouvereyQuilling dl is a no-go. for extension in composer see pickle
 
@MorganTouvereyQuilling github.com/FriendsOfPHP/pickle
Blast you @NikiC
 
7:39 PM
@DaveRandom Heh, everyone got a hobby ;)
 
@bwoebi Depends whether the event loop will be in core or not.
 
Oh awesome, I've never heard of it!
 
@kelunik it pretty much makes no sense if it isn't.
 
It can still be implemented in userland. In different ways. If it's in core ... dunno.
await and Awaitable make sense, but we currently have a dependency to Loop then, so yeah ...
 
exactly
And thus what we're doing currently is on the right track and you aren't.
 
7:44 PM
Some testing suggests that libpq itself only knows that the connection is bad when it tries to actually do something
Neither flush, consumeInput nor connStatus report anything when the server went down in the meantime
 
Yeh I mean that's in the nature of async things... you don't know the remote host has gone away until you get a RST/FIN or a write times out
 
@bwoebi The default driver breaks our nice Loop::execute scoping.
 
@kelunik It doesn't?
 
http://lxr.php.net/xref/PHP_MASTER/ext/pgsql/pgsql.c#1796
Though, I'd actually go with `PQexec(conn, "")`
 
@kelunik It's just the outermost scope.
 
7:48 PM
@bwoebi => breaks it.
 
@m6w6 wait wut? it doesn't use PQping()? :-S
 
@DaveRandom Ah, I totally forgot that this exists, because, erm, well, it doesn't look particularly useful to me
 
yeh I know, it's basically just a proxy around testing whether you can establish a TCP connection
I assumed that pg_ping() did the same thing as that because, well, you know, names
 
yea
 
@kelunik why breaks? It's just scoped as well as any other Loop::execute() sub-scope.
 
7:53 PM
/away
 
there's no cross-scoping
 
@bwoebi No, there's no scope, it's open, global scope. It's the thing we wanted to avoid.
@bwoebi I didn't say that. It's just not a defined scope (within execute), it's global.
I wish we had no wait support …
 
@kelunik I can agree that we'd be better off without it, but it seems like a necessary evil to me
 
Do we really need it? You can always use Loop::execute with ugly references. Just not reuse objects. Or you can just put your whole application inside Loop::execute, e.g. with Loop::execute(function() { require __DIR__ . "/index.php"; });
 
@kelunik You can. But is this user-friendly? no.
 
8:18 PM
I'm not sure if wait should have the LoopDriver param, if the awaitable exists outside of the scope of a running loop, the driver was probably already set externally anyway.
 
@Trowski wait should have one single argument, and that's the awaitable?
 
Wes
where do i find documentation for enable-inline-optimization? is there such a thing on msvc?
 
What do you think is more influential on how well behaved a dog is: training or genetics?
 
cookies
 
Wes
@blahfunk must admit asking that in the php room is not completely off topic
 
8:31 PM
@bwoebi Right. I added a LoopDriver arg because it seemed like a good idea at the time, but in retrospect I don't think it makes sense.
Oh, and when I wrote it Loop::execute() required the second param, that was it.
 
@Trowski oh, it's there in your new Amp\wait()
 
Wes
abstract class Qux{
    function baz(){ return $this->foo(); }
    function foo(){ return $this->baz(); }
    abstract function either baz or foo;
}
when i'm tired i invent these things
 
yeah, remove it … with fire :-D
 
@Wes wat
wat.
 
@Wes eih WATHTF?
 
8:40 PM
@Wes I think this is the worst suggestion for a new PHP feature I've seen ... in the last three hours
6
 
Wes
lol
it wasn't a feature request
 
it's worst than traits!
 
@NikiC okay, can we please introduce a way to have two consecutive increments ($a++; $a++;) builtin? like $foo+++; ?
 
@bwoebi It should be $foo++++
 
++$foo++
\o/
 
Wes
8:41 PM
lol
 
we should allow ----$foo+++
 
Actually, I think that in C ++(++i) might actually work
 
@NikiC nah, that's three consecutive increments
 
I'm not sure if ++++i does tho
 
number of increments = number of plus-signs - 1
 
8:41 PM
gotta test this now
meh lvalue required as increment operand
So I misremembered ... C isn't this crazy after all
 
Wes
in case you are wondering, i'm actually doing that. i have an abstract class with two methods relying on each other, but i don't have a way for to force the concretion to override one or the other :B
@NikiC implement it pls :B
 
but ++(++foo)->bar should work … does ++++foo->bar work too?
 
@bwoebi doubt it
precedence is wrong there
 
@PeeHaa
 
ah
 
8:45 PM
@bwoebi Ah got it ... I wasn't so wrong after all
 
I see my mistake
 
C forbids ++(++i), but C++ allows it
That's why it's called C++ you know
 
@RonniSkansing
 
lol
 
And C++ also allows ++++i
 
8:45 PM
@NikiC but disallows ++++i?
UUUUGH
 
As you can see, your feature request is not nearly as unreasonable as you thought! HA!
 
Now, we have precedent in another language…
Let's introduce it in PHP!
 
@bwoebi I'm pretty sure I actually saw a feature request for this on the bug tracker once
 
such confusing things can be writtnew
$x++ + ++$x+ ++$x
 
Sadly ++i++ does not work. (++i)++ does, but precedence is getting in the way here
 
8:49 PM
@NikiC But as always, it!s just C++ being shit :-D
 
eh
it just has a more liberal interpretation of lvalues there
 
s/more/too/
@NikiC no, honestly… i++ and ++i return rvalues, not lvalues <.<
 
If i++ returns the (transformed) i, then that's an lvalue
Which is the position that C++ takes
 
@NikiC you mean ++i, not i++?
Thus you make ++i and i++ inconsistent…
 
@bwoebi yes, ++i
 
8:56 PM
which is, uhm, well, not good?
 
Wes
look what i've found
28
Q: Why are PHP function calls *so* expensive?

NikiCA function call in PHP is expensive. Here is a small benchmark to test it: // create test string $string = str_repeat('a', 1000); $maxChars = 500; // with function call $start = microtime(true); for ($i = 0; $i < RUNS; ++$i) { strlen($string) <= $maxChars; } echo 'with function call: ', m...

a teenager nikic asking why php sux :D
8
 
lol
 
@Wes pfff
The correct answer to that question is "because Dmitry didn't optimize them yet"
 
Wes
why didn't nikic optimize them in php7 yet? :B
 
@Wes Um... I'm writing a php script to calculate answers? Yeah... that's it
 
9:03 PM
@NikiC well, remember my patch about restructuring the vm calls?
 
@Wes Somebody should have warned him at that time
 
Wes
lol
 
That's from where IMO, the underlying optimizations should start @NikiC
 
Wes
or bob. go bob. fcalls are still expensive
 
"Thanks Artefacto, this really helps me. I will have a look at those definitions.". Then he studied the Zend Engine and became a language contributor :o We should throw more opcodes as answers to PHP newcomers
 
9:05 PM
@MorganTouvereyQuilling Hehe
 
@MorganTouvereyQuilling Legend has it he is still looking at those definitions
 
Wes
@PeeHaa haha
gn \o going to bed
 
bah
 
@Wes noight sir
 
After execute_ex finishes can anyone think of a way to determine which oplines were executed? or would you need to peek after each handler invocation?
 
9:13 PM
@adsr you want a list of executed oplines?
 
Yeah, trying to do this from an extension
 
What for?
but yeah, you're gotta have to implement your own execute_ex loop for that
I don't think anything else has the granularity you want
extended mode only covers statements, not individual oplines
 
I'm attempting to build stacktraces of mutations per variable
What is extended mode?
 
@adsr The -E flag. ZEND_EXT_STMT etc
 
Ah didn't know about this. I'll check it out. Thanks @NikiC
 
9:23 PM
I'll quit PHP if that insolent curve continues to grow google.fr/trends/…
 
9:38 PM
@JoeWatkins Urgh, I'm really sorry for having brought up all the old nonesense on the typed properties RFC
I wanted to discuss the specific case of nullables, and instead it has turned into the usual crap
 
9:56 PM
@NikiC congrats, your prize is a new extremely valuable contribution from Lester to internals!
 
@NikiC What position does ++C take?
 
Wes
10:16 PM
eh, can't sleep. E_TOO_MUCH_COFFEE
 
@Wes Throwable or fatal ?
 
Ekn
I feel coffee actually helps me sleep lately
 
Wes
Throwable, of course
@Ekn it's because it finishes what's left of your strength :B
 
Ekn
yeah I guess
 
Wes
408 Request Time-out
Your browser didn't send a complete request in time.
i'm trying to understand what is "enable-debug-pack" and if affects speed on windows - An unknown error has occurred - retry / edit / cancel
because the php i downloaded from windows.php.net has that, but should probably not use it
 
Ekn
10:34 PM
there's just this that contemplates a bit on it at a quick look
 
Wes
damn internet not workin - An unknown error has occurred - retry / edit / cancel
 
Wes
11:03 PM
--with-pgo used to work, now it says i need a pgo compatible compiler :\ - timeout - retry / edit / cancel
 
Wes
11:39 PM
LOL
so i spent days trying to optimize the impossible, now i recompiled php without the debug pack
got benchmarks 14 times faster
and i've even blamed @NikiC because fcalls were slow :B
 
@Wes 14 times?!?
wtf?
or did you forget the period?
 
Wes
it's even more than that, wait
so this without debug pack 0.0690040588seconds
(opcache enabled)
14.2688159943seconds
this with debug pack
206 times slower
 
wtfs your debug pack??
 
Wes
i have no idea
windows.php.net compiles php with debug pack enabled
this is the configure of windows.php.net's php
cscript /nologo configure.js "--enable-snapshot-build" "--enable-debug-pack" "--with-pdo-oci=c:\php-sdk\oracle\x64\instantclient_12_1\sdk,shared" "--with-oci8-12c=c:\php-sdk\oracle\x64\instantclient_12_1\sdk,shared" "--enable-object-out-dir=../obj/" "--enable-com-dotnet=shared" "--with-mcrypt=static" "--without-analyzer" "--with-pgo"
cscript /nologo configure.js "--with-prefix=E:\php-sdk\phpdev\vc14\x64\install\" "--with-gmp=shared" "--with-pdo-mysql=shared" "--with-pdo-pgsql=shared" "--enable-apache2-4handler" "--enable-phpdbg" "--enable-phpdbgs" "--enable-intl=shared" "--enable-object-out-dir=../" "--enable-mbstring=shared" "
--enable-mbregex=shared" "--enable-pdo=shared" "--enable-scalar-objects=shared" "--without-analyzer" "--without-uncritical-warn-choke" "--without-gd" "--without-libwebp" "--without-wddx" "--without-simplexml" "--disable-cgi" "--disable-phpdbg-webhelper" "--disable-calendar" "--disable-com-dotnet" "--disable-ctype" "--disable-hash" "--disable-session" "--disable-zip" "--disable-zlib" "--disable-xmlreader" "--disable-xmlwriter"
this is mine
do you notice something that could make the difference other than debug-pack?
i'm so happy. i couldn't believe my code was so slow to execute
 
I have no idea about the windows builds
 
Wes
11:51 PM
holy crap. also phpunit is like a trillion times faster
TIL
 

« first day (2048 days earlier)      last day (2899 days later) »