« first day (3828 days earlier)      last day (1111 days later) » 
00:00 - 16:0016:00 - 00:00

12:54 AM
lol Dmitry's PR seems to have unstuck me for composite types
That's nice
 
 
3 hours later…
4:22 AM
posted on April 08, 2021

 
4:42 AM
Would it be a feasible feature for PHP to return multiple values like Go? I know you can always return an array and use a list operator for array destruction but you cannot put a type constraint on it which matches the returned values and we want more types in PHP.
<?php
function foo(): mixed, int {
    return ['bar', 'baz'], 2;
}
$arr, $no = foo();
<?php
// file1.php
function foo(): mixed, int {
    return ['bar', 'baz'], 2;
}
return foo();
<?php
// file2.php
$arr, $no = include 'file1.php';
I should've used array instead of mixed in above
Thinking about it internally functions should return packed array instead of zval, right? But aren't there ways to optimise it somehow, like an union or something else?
Does that even make sense?
 
@cmb I'm now using a Makefile.frag.w32 for building ext-fiber on Windows. Is there anything I can do to improve this?
 
I imagine some functions could use that to return error no immediately like:

function json_decode(string $json, bool|null $associative = null, int $depth = 512 , int $flags = 0): mixed, int {}

Where int is the value which is exposed by `json_last_error()`
 
@brzuchal It does make sense. Internally it could be handled like array unpacking, but compare each array member to the declared return types.
 
The use would be the same if further return values are not used, ensuring BC
$data = json_decode('[]', true);
$data, $err = json_decode('[]', true);
@Trowski Do you have an idea if that's complex to implement? I'm afraid that I'm not that skilled to ensure high quality code and this would also reach opcache
function foo(mixed $data, int $err) {}
foo($data, $err = json_decode('[]', true)); // this should be forbidden then
 
@brzuchal Declaring multiple return types sounds like a big challenge right up front, since I imagine everything is built around a single type.
 
4:56 AM
It should then be limited to standalone assign statement
What I see interesting about that is that it allows adding more return values without BC break, like above example with $data and $err adding further return values won't break old code.
In expressions like the foo() last one this would only assign $err since it's used inside function call argument list, but if it would be limited like that from the beginning I see no problem here.
What I don't know is if there could/should be a way to pass all returned values to another function call without use of temporary variables.
foo(json_decode('[', true)); // cannot add '...' in front and cannot pass more than one return value
 
It's rare to assign a variable when using a function result as a parameter. Using only the first value returned as the parameter to the function is limiting though.
I have no idea how you'd do that nicely.
 
foo(>json_decode('[', true)); // unfold return values, crazy idea 😂
 
Seems like a lot of work for what can be an object with typed properties.
Unpacking the result isn't particularly nice though.
 
Looks like, but most use cases possibly won't deserve such small class with mostly two props
 
We have exceptions though, so the result, err pattern is less useful.
 
5:09 AM
Question is what would that mean:
$foo = [json_decode('[', true)]; // [null, 1] ??
Fair enough, but easily understandable examples
function access_token($id, $secret): string, int {} // returns access token and expire ts
 
$foo = [json_decode('[', true)]; // [null, 1] ?? That is not obvious behavior. The more I think about it, the more I think it's not a good fit for PHP.
 
> As a special case, if the return values of a function or method g are equal in number and individually assignable to the parameters of another function or method f, then the call f(g(parameters_of_g)) will invoke f after binding the return values of g to the parameters of f in order. The call of f must contain no parameters other than the call of g, and g must have at least one return value. If f has a final ... parameter, it is assigned the return values of g that remain after assignment of regular parameters.
So the only reasonable use would be like a list operator, but with the difference that you can put type constraints and omit the [] on the left side
 
Array deconstruction of an object could provide type-safety.
['prop1' => $var1, 'prop2' => $var2] = $object
 
package main

import "fmt"

func vals() (int, int) {
    return 3, 7
}

func main() {
	primes := [3]int{2, vals()}
	fmt.Println(primes)
}
# example
./prog.go:10:26: multiple-value vals() in single-value context
Go forbids that
@Trowski Return type constraint would be more complex cause it should include then whole array shape, ain't?
Sorry didn't notice the $object was thinking of a type constraint for array shape instead
I see what you propose but that would break all old code, while returning extra values not
In most cases it would work in single-value context using Go nomenclature
 
5:27 AM
@brzuchal Does array deconstruction worth with objects now?
 
But in statements which are assignment expressions it could work in multi-value context
@Trowski No, there is a Fatal error: Uncaught Error: Cannot use object of type stdClass as array
 
Yeah, just tried it myself too :)
 
$foo = (object) ['bar' => 1, 'baz' => 2];
['bar' => $bar, 'baz' => $baz] = $foo;
 
That maybe would be useful…
 
I can still see benefit of returning multiple values but limited when used in single-value context:
1. Backward Compatible
2. Type constraints for all returned values
@Trowski Personally I wouldn't go that path, because you have to know property names and put them as a strings. I'd say it's ok for destructing arrays since keys on the left and on the right can be int|string|object (the latter am not sure if was introduced with success, meaning the object)
That's one issue, another would be to try to destruct without keys on the left like a packed array using integer indexes, how would unpacking object then work? Depends on order of properties in declaring class which might change over time when programmer decides and from that PoV it should not break anything
 
5:38 AM
Yep, probably not a good idea.
Was just tossing around ideas.
I'm off to bed, night o/
 
@Trowski you're more familiar with yield in generators would it benefit if yield could returnmultiple values?
function foo() {
    $foo, $bar = yield 1, 'foo';
}
You could avoid yielding an array and be able to send more than one value to the generator then.
yield foo(); // if foo returns multiple value I think won't break anything if you won't explicitly assign the yielded values using destruct to multiple vars
function foo() {
    $foo, $bar = yield 0 => 1, 'foo';
}
foreach(foo() as $i => $first, $second) {
}
This could be an option I guess
@IluTov wdyt about the idea of returning/yielding multiple values?
A real life use I can see I personally could use that for processing a dataset from remote service. In this context cannot rely on all processing to finish without issues so I often store in some KV storage identifiers of already processed entities from a dataset, meaning when I approach to process the same dataset a second time I process only what was not processed yet
but I also have to return the amount of overall expected entities processed and there I also count the ones processed in previous runs
 
 
2 hours later…
7:58 AM
o/
 
\o
Did you ever get another kitty, @JoeWatkins?
Or still the doggies?
 
no, my dog would eat them
still have three dogs
 
One of my cats is currently purring like a rattle on me, heh
 
there's a real problem with stray cats in spain, they hang around in packs ...
they are all very diseased, it makes having a cat problematic ...
they can't go out without being attacked
 
:( are there any trap, neuter, release programs?
 
8:08 AM
no, but there's plenty of stupid people that put food out for them
 
cmb
@Trowski you can merge the rules for php_fiber.dll (one line for both deps); you could also merge the *.obj rules, but not sure that it's worth it
 
TNR is the most humane way to reduce stray cat populations. I wish more places sweet up programs for it.
 
the lady across the road has a cat, and it's always got marks on it from fighting with them, I couldn't cope with that ...
 
Yeah :(
 
and fur missing ... the thing is a mess ... not as much as the strays, but it doesn't have a peaceful life
 
8:10 AM
I keep my cats strictly indoors, but they do sometimes run out.
 
@NikiC (or @JoeWatkins?) - how would I call an original Zend opcode handler from my overridden one? I know I can prevent the VM from running it again by returning ZEND_USER_OPCODE_CONTINUE, but I can't find how to call the original one
 
you directly invoke the one you saved before you set yours
ah the original zend one
 
Yes, but the ... exactly :-)
 
I've been tempted to let them go and hang outside but just too nervous. Cars deriving on my street tend to drive fast cause it's a one-way, and I'm scared of them catching something from outside. These cats are currently the longest living cats I've ever had
 
DISPATCH_TO
 
8:13 AM
@JoeWatkins But that's a return from my opcode handler, not?
 
yeah, I dunno if you can do it another way
 
I need to call the original zend one in my own, so that I can examine what they put into result.var
 
probably the observer api is the way to go
 
that's just for functions
 
oh that's a shame, it was meant to cover opcodes
then I'm not sure it's doable
 
8:19 AM
github.com/php/php-src/pull/6847 If you have nothing to contribute, at least don't go out of your way to make it harder for people who do.
 
@NikiC Do you have an idea regarding my conundrum? :-)
@NikiC And with regards to Vori: github.com/xdebug/xdebug/pull/629
 
@Derick I don't think the opcode abi really supports that kind of nesting
you could call the function but would then probably have to do some fixup
 
that's annoying... so it's possible to do something before the original handler runs, but not after ?
 
like, the call already moves the opline at the very least
 
@Derick that's my understanding
 
8:23 AM
@Derick Generally I'd say yes
 
@NikiC It's worse, as this is for the DO_FCALL opcode
 
@Derick Yeah I don't think you stand a chance with that one ^^
 
you could implement do_fcall
 
Your question doesn't even make sense for that one
 
Maybe I should describe what I want to do. — I want to debug the intermediate "results" of chained methods.
 
8:24 AM
As it switches to a different call frame
 
@NikiC Yeah, I realised. - but it returns at some point.
 
@Derick Wouldn't observer work well for that particular use case?
 
I don't need observer for that really, as I just override execute_ex anyway
 
or that
 
the reason why I wanted to use DO_FCALL, is because I can make DO_FCALL act as a breakpoint intercept) like EXT_STMT does by default
 
8:26 AM
shouldn't you be in the override in the frame you're interested in ?
 
I didn't understand that
 
DO_FCALL should enter your execute_ex
 
oh sure
 
@brzuchal This is usually done with tuples. It's technically possible to introduce tuples in PHP (fixed arity, ordered, probably immutable list) but since we have packed arrays now I'm not sure how big the difference would actually be.
 
so you can access result.var after you forwarded to zends execute_ex, no ?
 
8:29 AM
I think my main problem is how to tell it to break after every intermediate function. It's to capture intermediate results for some Laravel fluent API, like is documented at laravel.com/docs/8.x/collections#introduction
sure - the tricky is to decide when to do the breakpoint :D
thanks guys
 
I got nothin
well
not nothin, but nothin you'd really want to do ... possibly you can look at the subsequent INIT_FCALL and the types of cv to determine if the next call is chained
I dunno if that would work, but it's all I can think of
 
8:47 AM
yeah, I know. Sounds flakey though
 
@IluTov The difference I can see is that tuples change the return type dramatically while returning multiple values is backward compatible in single-value expressions, with tuple you receive completely different return value, right?
 
yeah maybe a bit fragile, although if you narrowed it to specifically chained methods, that produces a sequence that can be detected
 L19   #8     DO_FCALL                                                          @4
 L19   #9     INIT_METHOD_CALL<1>     @4                   "call"
I'm very unsure though
 
@brzuchal I suppose, but it also poses multiple questions. Like, what happens when you pass the return value of a function returning multiple values as an argument, will only the first value be passed? That seems unintuitive.
 
@brzuchal I think I'd rather see proper out parameters; the examples I've seen of using multiple returns for error handling rely on the fact that you can't just ignore the error part
so saying "this function returns an error code as well as a value, but you can just ignore the error code" doesn't feel like it gains much
 
error codes are just examples, it could be anything in all the cases where you wanna return more values but cannot which is why you'd use an array to do so but then you limit the type constraint to an array cause there is no other way around additionally forcing you to destruct the returned array where could be anything cause you cannot type against array shapoe
 
9:01 AM
in that case, let's have array shapes
then you can have function returns_shape(): shape<int, string> { ... } function expects_shape(shape<int, string> $foo) { ... } expects_shape( returns_shape() );
I'm not dead against multiple returns, but fitting them into the existing syntax does sound like a big can of worms
 
that's what I'm trying to figure out now, dunno how many worms are there
the shape would be nice but it almost looks like a generic type
besides I think you could still expect more values even if we could shape an array
am I wrong?
array has to be destructed anyway
 
not sure what you mean by "expect more values"
 
@IluTov I think only the first value would be passed then, there is a special case in Go which passes all returned values to function call only if count of returned values match function expected arguments count, but I would only limit it to passing only first returned value in this context.
@IMSoP *intend to return more values than just one
 
9:17 AM
passing them via an array doesn't seem like a big cost to me; it's just an extra pair of brackets on each end
function foo() { return [1, 2]; } [$a, $b] = foo(); vs function foo() { return 1, 2; } $a, $b = foo();
I think the inability to compose functions when they have multiple return values is a big downside
 
@IMSoP I see a difference in type constraint : array vs : int, int, if you wanna pass only first then you have to ask for it
 
use arrays or structs micdrop
 
function foo() { return [1, 2]; } [$a] = foo(); or $a = foo()[0]; vs function foo() { return 1, 2; } $a = foo();
classes are not structs
 
yeah, this just looks broken to me: function foo() { return 1, 2; } $a = foo();
is that how it works in Go?
 
checking
apparently not ./prog.go:10:8: assignment mismatch: 1 variable but vals returns 2 values if you return more than one you have to accept all
 
9:25 AM
yeah, that was my impression from examples I'd seen
 
so in case of errorno you cannot ignore it
 
you can probably discard with _ or something
 
yes, that's an option there in Go
 
which we could also do with arrays if we wanted: [_, $b] = foo()
 
define('_', null);
[_, $foo] = ['ignored', 'bar']; // Fatal error: Assignments can only happen to writable values
it is possible to define _ now
 
9:28 AM
would definitely be useful in foreach destructuring: foreach ( $list_of_tuplies as [_, $b, _, $d] ) { echo "$b and $d are all I care about"; }
 
that is another topic but agree, maybe $!
 
yeah, we're a bit stuck for spare punctuation :(
 
foreach ( $list_of_tuplies as [$!, $b, $!, $d] ) { echo "$b and $d are all I care about"; }
 
or re-purpose "null" or "void" maybe: foreach ( $list_of_tuplies as [void, $b, void, $d] )
note that de-structuring also works for a generator that yields arrays
 
yeah but with multiple return values generator could yield couple of values instead of array as well
the thing to omit values received could work in both contexts
 
9:33 AM
this already works:
foreach ( $list_of_tuplies as [, $b, , $d] ) { echo "$b and $d are all I care about"; }
 
true
I'm confused if to put more work on research or not onthis topic
 
@gharlan oh, nice
it does feel like all the neatest solutions involve some form of generics :(
e.g. AFAIK generators can't even declare the types they yield right now, so declaring multiple returns is a non starter
although I think it was a mistake for generators to be declared with "function"; generator foo(): int { yield 1; yield 2; } would have made more sense IMO
 
9:50 AM
@brzuchal Knowing nothing about Go, that sounds weird to me.
 
mean trick to play on someone with a messy code base: find a long function, put "if ( false ) yield;" somewhere in the middle - the function runs as normal, but the return value is wrapped inside a Generator object!
 
$fp = fopen() or yield;
 
@IMSoP >.> I know a few places I could do that, but it'd get caught in code review, I think
 
@DaveRandom yield or die;
 
Nikic is the master at trolling people with PHP
 
10:09 AM
ooh, even cheekier, you could hide it in the middle of a string expression: (''?yield:'') evaluates to an empty string, but turns the containing function into a generator
 
10:36 AM
@IMSoP return; yield; usually - i.e. a yield after the final return
if I need that
 
hah, yuck :)
I get that generators-as-coroutines make mixing "return" and "yield" kind of meaningful, but I still find it bizarre
 
11:02 AM
function foo(): noreturn { yield; } // would that work?
 
@brzuchal No, adding yield will make it return a generator.
 
with generics you could maybe do this:
    function foo(): Generator<never> { die; yield; }
actually, no; I've confused myself
 
11:19 AM
@IMSoP It could kinda make sense since T could be the return value of getReturn. But it would make more sense if T was returned directly from next().
 
11:34 AM
I'm encountering a logic issue, and I'm not sure exactly what I'm doing wrong. I'm using xpath to find the type in an XML file, I'm looking for types of 'picture' and 'video', but my code is attempting to parse files of type 'story' which I want it to skip. code sample
method names are probably bad, open to suggestions ...
 
other context: code is part of a file that is ran as a command in command-line, the command runs a loop based on the directory passed to the command, so it's hitting a file that has a 'story' type, but I want it to skip it... not sure if I should like... return a null if 'story' is encountered, and in the foreach loop check for a null... and if it's a null, continue;
 
not a royalist type ... but an old lady loosing her husband of more than 70 years is sad ...
 
The only royal family I can be sad about is Zelda's
 
11:51 AM
Aye, being dedicated to someone for 70+ years is pretty incredible. A privileged life for sure, but stressful and, in many ways, not their own.
 
yeah and being surrounded in gold isn't going to help her today, or tomorrow ...
I expect she'll follow not too long after ...
 
:( a month short of his 100th birthday as well!
 
I suspect you're right =\ many a joke about the queen living forever (if only to spite charles) but this has to be like losing her reason for living
 
12:40 PM
@IMSoP can't we store the remaining length in the stream options?
@NikiC did anyone already look into implementing an auth log for main.php.net?
 
@kelunik not that I'm aware
 
Morning
Happy Friday!
 
@NikiC Uh, it has a master and main branch now. I'd work on that now if you're fine with that.
 
@kelunik I did wonder about that; it feels a bit of a hack, though
 
@IMSoP Yes, definitely. :D
 
12:52 PM
I guess it would have to then be read by the underlying generic stream
[ "close_after_bytes" => 42 ]
did you see my suggestion of extending the stream filter API and signalling the close from there?
16 hours ago, by IMSoP
I'm obviously way out of my depth at this point, but digging through, I see that the chunked transfer encoding is implemented as a stream filter on top of the HTTP stream wrapper
16 hours ago, by IMSoP
if the filter could indicate "this stream should be closed now", you could have a "pipelined_http" filter that closed the connection after reading content-length bytes
16 hours ago, by IMSoP
would presumably need an extra status in php_stream_filter_status_t
 
@Danack Thanks for the simple reproduce case, it's as simple as php -r 'file_get_contents("https://correios.com.br/");'
 
@kelunik now that we've confirmed what the server is doing, you should be able to reproduce on any server by sending a "Connection: keep-alive" header
I think Danack also has some nice examples of that :)
obviously, explicitly sending that and then closing the connection anyway is fairly pointless, but it will remain testable in future if Correios upgrade their server
 
@IMSoP Yes, it's as simple as this:
php -r '$server = stream_socket_server("tcp://127.0.0.1:8080"); while ($client = stream_socket_accept($server)) { fwrite($client, "HTTP/1.1 200 OK\r\ncontent-length: 0\r\n\r\n"); }'
 
hah, neat
 
1:11 PM
I typed php -r '$server and it automatically completed to a similar example :D
 
hah, I wish my shell had that feature ;)
thinking about it, even if we have a different solution for the content length, the "dechunk" filter needs to be able to signal the stream to close somehow
 
because it's the only piece of code that will ever see the "last chunk" marker
 
If I want to set a bug report to Won't fix do I need an agreement from other contributors or can I make this decision myself?
 
1:57 PM
I recall you saying something about trying to keep the number of defines to a minimum.
 
cmb
@Trowski configure_module_dirname is generally available; X64 as well
 
Hmm… I think I tried that and it was empty.
I'll try it again, maybe I messed it up.
 
"Notice: Undefined index" on unset() ArrayObject non-existing key ・ SPL related ・ #80945
 
cmb
@Trowski ah, you mean in the makefile? Neither is available there. There is PHP_ARCHITECTURE (x64 or x86), but I don't think there's something like configure_module_dirname.
 
@IMSoP No idea what I'm doing, but I have a fix for the chunked case. ^^
 
cmb
2:12 PM
@kelunik care to share? :)
 
cmb
yep :) but yours looks harsher (not sure if setting eof=1 does cater to all cases, though)
the drawback of using a filter for non-chunked would be additional copying of memory; might be acceptable, though, in this case
 
@cmb It'll send a FIN, but will reset the connection if there are trailers to be received. PHP ignores trailers, but not sure what it does with the connection reset.
 
@cmb we could perhaps only register the filter if the server doesn't reply with "connection: close"?
there's obviously the possibility that a server would send that header, but not actually do it, but it would cover the current case
 
cmb
@IMSoP that sounds interesting! I just wanted to check the headers, but now requesting with curl stalls ;)
 
2:27 PM
@IMSoP @cmb It gets better, if auto_decode is false we'd need to add the chunked transfer filter without actually filtering.
 
real programmers craft HTTP requests by hand with netcat :P
 
cmb
oh, right auto_decode==false has to be considered :(
 
0 ron@Paddington /mnt/c/Users/Rowan $ nc -v ws.correios.com.br 80
Connection to ws.correios.com.br 80 port [tcp/http] succeeded!
GET / HTTP/1.1
Host: ws.correios.com.br

HTTP/1.1 200 OK
Content-Type: text/html
Last-Modified: Mon, 15 Apr 2019 12:52:36 GMT
Accept-Ranges: bytes
ETag: "b66ed6198af3d41:0"
Server: Microsoft-IIS/10.0
X-Powered-By: ASP.NET
Date: Fri, 09 Apr 2021 14:30:20 GMT
Content-Length: 703
 
@cmb amphp/http-client works fine. :P
 
130 ron@Paddington /mnt/c/Users/Rowan $ nc -v ws.correios.com.br 80
Connection to ws.correios.com.br 80 port [tcp/http] succeeded!
GET / HTTP/1.1
Host: ws.correios.com.br
Connection: Close

HTTP/1.1 200 OK
Content-Type: text/html
Last-Modified: Mon, 15 Apr 2019 12:52:36 GMT
Accept-Ranges: bytes
ETag: "b66ed6198af3d41:0"
Server: Microsoft-IIS/10.0
X-Powered-By: ASP.NET
Date: Fri, 09 Apr 2021 14:31:17 GMT
Connection: close
Content-Length: 703
 
cmb
2:30 PM
thanks @IMSoP (no netcat here; could use PuTTy though)
 
telnet
will give you a raw enough TCP connection for that
 
cmb
PuTTy also supports raw :)
 
ah, never used it for that
in fact, I don't use it at all any more, just Windows Terminal
now that Windows has a native "ssh" command
and WSL
 
@cmb Yes, sorry, I meant in the makefile. I guess I can set a variable based on PHP_ARCHITECTURE. It would be awesome if I had any idea how these nmake files worked :P
 
@IMSoP Hm, with the main domain I get server: nginx/1.14.2
 
2:33 PM
does it have the same buggy "connection" behaviour?
 
Anyone know how to build your own SAPI that doesn't depend on the embed SAPI's libphp.so being built? I can't build all the SAPIs at once (don't know why that is, either), so the short-term hack was to not build the embed SAPI. I don't need the embed SAPI really, the only thing it was used for was building another SAPI we're working on to do certain kinds of testing.
 
i.e. "connection: close" giving a different answer to "connection: Close"
oh, wow, "Host: correios.com.br" explicitly returns "Connection: keep-alive" in response to "Connection: close"
but not "Connection: Close"
I wonder if there's a broken firewall / load-balancer in path that's mangling the request header
doesn't make much difference to what PHP needs to do, but weird to observe
 
@IMSoP Nginx usually doesn't forward the connection header, yes.
 
no, it's treating it case sensitively
if I request "Connection: Close" it replies "Connection: close"; but if I request "Connection: close" it replies "Connection: keep-alive"
 
which appears to be related, but not the root problem.
> For example, Connection: close in either the request or the response header fields indicates that the sender is going to close the connection after the current request/response is complete
php closes the connection.
 
2:42 PM
@Danack it doesn't, because we don't have any code to track the content-length
the HTTP stream wrapper hands off to the TCP stream
which has no idea what "end of response" means
 
Are i386 builds on AppVeyor a thing?
 
what is the fin, ack packet that php sends if not the connection closure?
 
are you sure that wasn't after the timeout? I didn't get round to looking at the traces
 
yes. I'm sure.
the timeout is 120 seconds.
 
hm, odd; because there doesn't seem to be anywhere in the code that would know to close the connection; and the observed behaviour is entirely consistent with that
other than you seeing that in the traces
this comment even mentions that fact: heap.space/xref/php-src/ext/standard/…
PHP always asks the server to close the connection, because it doesn't know how to do it itself
 
2:48 PM
Following up with what @LeviMorrison asked, when trying to build #AllTheSAPI's (specifically `--enable-embed`) I'm running into this:

+--------------------------------------------------------------------+
| *** ATTENTION *** |
| |
| You've configured multiple SAPIs to be built. You can build only |
| one SAPI module plus CGI, CLI and FPM binaries at the same time. |
+--------------------------------------------------------------------+
 
meanwhile (purely out of curiosity) testing the server in question further, it seems to correctly detect any capitalisation other than "close": "CLOSE", "cLoSe", "cLOSE" all seem to work
 
@Danack it only closes half of the connection.
 
ah, is it closing the write half after sending the request?
that would make sense
 
@IMSoP :o
 
@kelunik If I had more energy, I would riff off of en.wikipedia.org/wiki/The_Grand_Old_Duke_of_York with something to do with socket states.
 
2:50 PM
@SammyK If not, I assume you just have to build twice, once with --disable-embed and once with --enable-embed (and turning some other SAPI off, like phpdbg?).
 
@SammyK presumably there is some limitation in the build system that would bork building multiple ones at once.....maybe look into the difference in how the cgi, cli and fpm ones are built. they may have some stuff somewhere that avoids that borking.
or just ignore that message and see what breaks...
 
@Danack Haha. The quickest way to find out I guess. :)
@LeviMorrison Yeah, the workaround might be to disable phpdbg for now.
 
@SammyK If we build once with --enable-embed --disable-phpdbg and then afterwards without clearing the cache we build with --disable-embed --enable-phpdbg then hopefully it's quick and we don't lose anything? Dunno.
 
cmb
@Trowski nmake files are basically a subset of gnumake files, plus some fancy stuff which would be done by configure with autotools; I don't think PHP's makefiles use that.
@Trowski would be possible, but given that AppVeyor builds already take that long ...
 
3:09 PM
@cmb config.w32 and the fragment are succinct now, so I'm happy with it. Hopefully I can keep it that way when adding to Zend.
 
cmb
\o/ (and when merging to php-src, we can see further :)
 
@cmb In theory there's i386 support for Windows, but I'm not sure that's actually necessary.
 
does Windows support i386 any more?
 
Heh, probably not. macOS doesn't.
 
cmb
well, there has been some discussion about dropping x86 support; won't happen from PHPOnWindows side, but for PHP 8 it's up to php.net community
 
3:12 PM
The need to support ARM64 on Windows is probably on the horizon.
 
cmb
what might be a big issue with the dependency libraries
 
> Beginning with Windows 10, version 2004, all new Windows 10 systems will be required to use 64-bit builds and Microsoft will no longer release 32-bit builds for OEM distribution.
seems like 32-bit Windows is basically in maintenance only mode, but only as of last year
 
That's just OEM though
 
yeah, there follows lots of waffle about "supporting various upgrade paths"
 
cmb
I don't think they'll drop x86 support anytime soon. I might be wrong, though.
 
3:18 PM
I think there is value in supporting x64 builds -- that is, it's a 32-bit address space for that program but on the 64 bit architecture.
How different is that to supporting regular 32 bit builds? It's different for assembly, at least.
 
Only the two assembly files that are built change, the cost to support it is negligible.
I just haven't actually tested it :P Can I have AppVeyor do a 32-bit build?
I know basically zero about building on Windows. @cmb has been indispensable. :)
 
cmb
@Trowski you mean for ext/fiber? I can have a look; shouldn't be hard.
 
@cmb Yes, for now. I suppose for PHP too once merged.
 
cmb
for php-src that would be a performance issue (AppVeyor builds already take about ~45mins, and only up to two builds may run concurrently)
 
3:34 PM
Not worth it for something that would change so infrequently.
I'll test it in a branch when necessary.
 
@JoeWatkins I'm looking over your partials PR. Looks like a very different approach than what Ilija was working on. No clue which is better. :-) I don't see any tests, though. Have you tried running it?
 
yesterday, by Joe Watkins
krakjoe@Fiji:/opt/src/php-src$ cat partial.php
<?php
$uri = function($scheme, $host, $path = null) {
    return sprintf("%s://%s%s", $scheme, $host, $path);
};

$krakjoe = (($uri("https", ?, ?))("twitter.com", ?))("/krakjoe");

var_dump($krakjoe);
?>
krakjoe@Fiji:/opt/src/php-src$ sapi/cli/php partial.php
string(27) "https://twitter.com/krakjoe"
 
yeah the basics work ... ^that and
<?php
$krakjoe = (((sprintf("%s://%s%s", ?, ?, ?))("https", ?, ?))("twitter.com", ?))("/krakjoe");

var_dump($krakjoe);

function add($a, $b) {
    return $a + $b;
}

$add = add(?, 10);

var_dump($add(10));

$add = function($a, $b) {
    return $a + $b;
};

$addTen = $add(?, 10);

var_dump($addTen(20));
?>
I think that's all the basics ...
 
Ahso.
 
but it's unfinished still ...
 
3:44 PM
I'm going to add some more robust tests and PR against you, if that's OK. (Tests I can handle, even if modifying the engine is still mostly over my head.)
What is still missing?
 
well not missing, but there's a bug in that
var_dump((((sprintf("%s://%s%s", ?, ?, ?))("https", ?, ?))("twitter.com", ?))("/krakjoe"));
enters an infinite loop
I'm not exactly sure why yet
 
Exciting.
 
a pr for tests sounds good, I'll come back to it this weekend ...
 
Roger.
 
is there something like sprintf with placeholders ?
 
3:48 PM
@Crell +1 for partials, the little functional programmer in me is jumping up and down!
 
You mean named instead of positional?
 
yeah
 
oh named args are missing, but I didn't even get that far yet, I think it's doable ...
 
would be cool to have
 
@Trowski Amen. It's just not something I can do myself, so I'm instead being a slightly annoying nudge and PM in the hopes that I can make it happen that way. :-)
 
3:48 PM
@JoeWatkins Would be killer
 
@JoeWatkins Roger. I'll include some tests for it.
 
@Crell How goes the job search?
 
and in the end I'd like to remove closure backing ...
 
@cmb Didn't you mention something where it would be possible to accelerate the builds with the changes to the test runner with the --EXTENSIONS-- changes?
 
@Trowski I think I have something lined up that will work out well. Nothing is signed yet and there's some logistics to sort out, but if it all lands as we're discussing, it should be a pretty nice setup.
 
3:50 PM
I think it could be easily taken from the PDO param binding code, but I'm no core developer so, maybe
 
@JoeWatkins Yeah, that's a perf op as far as I'm concerned. Avoiding the double function call would be nice, but doesn't affect functionality. The big thing is ensuring that the wrapped function is type-compatible, so that it plays nicely with future typed-callable signatures.
 
cmb
@Girgias ah, right; currently all exts are loaded what is terribly slow on Windows; only loading these for --EXTENSIONS-- could improve perf
 
Huh, why are all extensions loaded in the first place? Is it due to the build system?
 
@Crell So you've already gotten an offer, nice!
 
@Trowski Not officially. :-) There's some international logistics to work out.
I am trying to not count my chickens.
 
3:53 PM
@Crell Well I mostly brought it because I saw this that may be up your alley.
 
I sent then an application for a similar position a month ago and never heard back. :-( But yeah, that would be a sweet organization to work for.
 
@Crell Doesn't hurt to apply for that position too if it interests you.
 
Indeed. And I am supposed to keep submitting applications to places to keep the unemployment office happy, so this looks like a good one. :-) Thanks for the heads up.
 
00:00 - 16:0016:00 - 00:00

« first day (3828 days earlier)      last day (1111 days later) »