« first day (3069 days earlier)      last day (2103 days later) » 

00:17
@Danack do you shoot magic missile at the darkness?
NYAHHAHAHAAHAHANAHNANANNAAA
00:49
@NikiC So fn[&](param_list)[: return_type] => expr or somesuch?
Bind by-value?
To be honest, I'm more hopeful for partial function application. It solves many of my needs (perhaps most, haven't quantified it), and can (hopefully) support bind by-value and by-reference naturally.
01:29
@LeviMorrison ^
Both O(n log n), benefit of the tree is that it is online/always sorted. Won't be able to beat the low constant factor of the array, but I think this result is acceptable. Small side effect is that we have per-subtree copy-on-write (N=255) so a write might not have to copy the entire tree. \o/
Phpcompiler surpassed laravel today in trending ;)
8
@rtheunissen Why doesn't the memory climb the same on the sorted set? Lots of smaller allocations?
@LeviMorrison yeah but not per node, uses subtrees/pages of 255.
The first being 16, 32.. 255 but all subsequent are 255.
02:19
@ircmaxell congrats :)
FWIW, you're more famous than laravel
02:50
@LeviMorrison here is a smaller sample (random input)
03:15
@rtheunissen Why 255?
By the way, you are very close to implementing HAMT, I think.
If you want the immutability properties, you should look up immutable data structures. There's a wealth of information, and the only way to know if they'll work well with our GC + refcounting is to try it.
Here's a promising, fairly recent paper on them:
https://dl.acm.org/citation.cfm?id=2993251
Not sure if you have easy access to those somehow, libraries and colleges often have them.
Ah, and CHAMP is another one to look up. Took me a bit to find it.
The RRB-Tree seems to be an "immutable vector" sort of idea, which as far as I know state of the art.
 
1 hour later…
04:46
Morgens
@LeviMorrison thanks I'll read. From first glance it does not seem similar to HAMT but haven't checked the others yet.
255 means we can use zval for the node and split u2 into 4 (flags, parent, left, right).
Outer tree just maintains a min and max for each subtree. When a subtree is full, it is partitioned into a new subtree. This means that all searches will terminate within a subtree (good locality of reference). The range finding is also done on contiguous memory. Could use 9 or 10 bits for each reference because we don't need 4 flags (only 2).
No idea of this is optimal.. but results seem decent.
05:07
*if this
05:44
@JoeWatkins Am I blind or is your merge of WeakRefs missing NEWS update?
@SebastianBergmann woops, noted in upgrading ...
06:06
@JoeWatkins NEWS needs it, too :-)
(Sorry)
@SebastianBergmann no it doesn't, we put new features in upgrading, not news
@JoeWatkins yay for the merge :-)
 
1 hour later…
07:46
Warning: preg_match(): Null byte in regex – #77726
08:00
delate accuse, denounce
08:39
morns
So @Jimbo just RT'ed twitter.com/Shamwellll/status/1104800502796046336. I take that as a very late admission that using YAML is a mistake.
5
09:00
lolol
Morning.
So Jimbo just RT'ed https://twitter.com/Shamwellll/status/1104800502796046336. I take that as a very late admission that using YAML is a mistake.
09:25
Hi Guys

m using dompdf. i want to set the page height dynamically such that my data doesn't go to the next page
can anybody help?
10:10
If you were reporting line/col of an error in something unicode aware, would you print the true byte position or glyph/char/rune position for the column
@Leigh Depends if the error is encoding related or not :)
It's not
For general errors please for the love of god use the actual thing which points to whatever normal people think of as a character
Like
a = "string with a bunch of emoji in it"<accidentally an emoji outside of the string>;
It might be easier for the user to eyeball if the col is the character position
Yes if by character position you mean for example an emoji is a single character
10:16
Yea sorry I mean a multibyte character -> character
Unicode terms always confuse me
I figured if I said "rune" it would be more confusing :P
yeah byte position wouldn't be particularly helpful for that
Good, that's what I've already done \o/ just wanted some backup ;)
10:36
@bwoebi I think we could also do fn($x) $x+$y (without the =>)
@NikiC I heard a complaint back then the "=>" would signify return and would be essential. I however I'm totally fine with omission.
I even prefer that one
I initially thought that there might be some issue with return type ambiguity like fn($x): T1|T2 +$x, but I don't think there is any, as none of the type operators have unary variants
Can you think any any possible future problems there? Generics seems okay too
Though I guess that fn($x): int $x would be kinda ugly from a syntax pov
Not that function($x): int use($y) is much better, mind
@ircmaxell btw this was the rust ruby bridge i mentioned on php benelux blog.skylight.io/introducing-helix
and the github repo for that github.com/tildeio/helix
isn't there a quick link to show all issues on bugs.php.net that i participated in?, wondering if it wuld be helpful to have that
ah i can use the advanced search commented by email function for it
11:01
@bwoebi hrm, there is an issue after all: fn(x): T \T \T could either be fn($x): T\T (\T) or it could be fn($x): T (\T\T)
git mernings
11:30
*Both square brackets and curly braces can be used interchangeably for accessing array elements (e.g. $array[42] and $array{42} will both do the same thing in the example above).*
A strange idea came to my mind.

What about to deprecate curly braces syntax in 7.x and use it for access by absolute offset in 8?
$ a = ['a', 'b' => 'b', 'c'];
$ a {0} == 'a';
$ a {1} == 'b';
$ a {2} == 'c';
@NikiC we could lex qualified names as a single string without whitespace...
@NikiC I guess though the typical short closure won't have a return type. I don't consider that an issue (that the syntax looks ugly, not the ambiguity)
@bwoebi I don't think return types on short closures is really necessary either, but I think the lack of type support is a big reason why the previous rfc failed. (of course we could only support param types...)
@rjhdby Why / how would that be useful?
@rjhdby All in favor of deprecating curly braces. Not sold on absolute offsets.
fwiw I agree with killing the alternative syntax
What @NikiC said :P
You can already either do array_values or you probably are using the wrong data structure to beginwith imo
11:46
@rjhdby Don't forget that offset access on HT is, in the general case, O(n)
@PeeHaa array_values is not costless for cpu/time and ram.
@rjhdby That's the second part of my comment
@NikiC Why O(n)? If array is not packed and do not have holes it will be O(1). Or I mistaken?
@rjhdby yes, but arrays do have holes
You don't want a basic operation like that have O(n) behavior, even if only in some cases
@NikiC it is good occasion for complete eliminating holes in HT :)
11:55
also deprecation and then moving to re-use the syntax with different meaning is surely getting voted down from a user upgrading perspective
Aside from _once semantics, and error handling, is a non-variable require/include identical to just copying the opcode's from the new file into the current one... No. It isn't (you can return from an include). Okay, thanks for rubber ducking
@beberlei okey, okey. How I said - this is strange idea. :)
@rjhdby not viable
wait, you you mean to compact the ht if {} is used?
If so, still not viable, because you can't modify the array during a read operation. It would violate memory safety invariants.
@NikiC as an idea for thinking about. May be add functionality to GC for repack arrays with holes.
@bwoebi What do you think about doing some analysis to check for modifications of imported variables in closures? So that $x = 1; fn() => $x++; would give an error. We can't catch all possible mistakes due to by-ref passing, but this seems like a good way to prevent obvious mistakes
12:25
@beberlei very cool :)
@NikiC I'm fine with the obvious mistakes. But something like fn() x($x += 1, $x) should still work fine
@bwoebi should it?
That doesn't seem worth allowing
@ircmaxell i'd love this so much in PHP, but given my current php version support is php 5.3 - 7.3 - having such an abstracton is probably only viable for newer versions, you'd need to support zvals in all different versions
@beberlei yeah, would only do it for 7.0+
@NikiC I think it should. But obviously only if the variable is also reused afterwards
12:36
@bwoebi eh, not going to both with this then
okay
leave it to static analysis / IDE ^^
Wes
Wes
\o
\o
12:52
o/
13:03
o/
13:25
I'm teaching a 2-day workshop on PHP and MySQL to absolute noobs and I don't know how to go about doing it.
@NikiC yeah, I agree on that
13:57
@littlepootis Pro tip incoming
@littlepootis Tell it like a story. Show where it came from, how they used to do it, simple queries, no escaping parameters. Show the problems with it, how it worked but how it could be exploited. Move up to the next step. Make them go through the learning as if they were doing it themselves, through the story
14:26
@NikiC I think as well that support should be there, just that it's not very important that every case looks nice with them
@rtheunissen Maybe I'm thinking of a different structural sharing structure.
@NikiC I would be very wary about omitting a symbol there.
PHP not working! – #77728
2
@Jeeves Bad PHP!
@Wes well, he's on windows, so its possible he's using xampp(which only offers x86, i believe) or something.
Wes
Wes
@mega6382 no, x64 works fine
@Wes it must be quite recent then, cause I remember that a little while ago, it was only x86
15:01
@rjhdby you should explain why you want to do it in the RFC itself
@Kalle what is it that defines PHP_WIN32 normally ?
@rjhdby Your current error message example looks like this throws E_WARNING, not E_DEPRECATED
And as @pmmaga said, you need to motivate why this should be deprecated
Possible motivation: Two ways to do the same thing, but one of them is very obscure and barely used nowadays
Wes
Wes
@mega6382 no, been using x64 for ages
@Wes with xampp?
Wes
Wes
no, manual installation
15:16
dunno why snapshot is being built with pgo anyway, it's a snapshot, nobody is deploying a snapshot
@Wes well duh, I was talking about bundles like xampp or whatever
I know php x64 version for windows
15:37
hi all! I have a SmartCard usb eToken for digital signature. I want to implement an auto-sign system on a php server to sign uploaded documents and give them back to users. Is this all I need php.net/manual/ro/book.openssl.php , or is impossible in pure php because of usb part?
15:51
@BoteaFlorin you'll need to figure out how the data will be sent from the usb thing to the webserver. I have no idea how that could be done.
Can anyone link to me in PHP src where an existing exception is caught and then rethrown?
@Danack as I guessed. It would be a java/python server then...
@Danack thanks for answer! :)
@BoteaFlorin how does that help getting data from the usb thing?
Can anyone remember what the name of the RFC was for 'silenced' exceptions was, for scenarios like:
$skipped = [];

for ($i=0; $i<MAX_RETRY_ATTEMPTS; $i++){

	try {
		foo();
		return;
	}
	catch (\Exception $e) {
		$skipped[] = $e;
	}

	throw new MultipleFailures("failed after MAX_RETRY_ATTEMPTS", 0, null, $skipped);
}
@salathe thanks but no......there was one way more sensible (imo), that just added getSkipped or getSilenced to the exception interface for code like the above. I'm not sure it was drafted as an RFC.
found it "Throwable::addSuppressed()"
> On Mon, 28 Dec 2015 at 19:12, Dan Ackroyd <[email protected]> wrote:
> Are you going to write an RFC for it? If not, do you mind if I start
> writing the RFC with you either listed as co-author or 'the ideas guy'
> ?
16:06
@bwoebi @LeviMorrison I've put up a first draft at wiki.php.net/rfc/arrow_functions_v2
> On Tue, 29 Dec 2015 at 21:51, Markus Malkusch <[email protected]> wrote:
> I'm going to do that. But if there's any time pressure feel free to take
> it over.
@pmmaga ok, do it tommorow. Today is completely at the mercy of the family :)
$ php-7.4 bin/vm.php -r '$a = []; $a[] = "test\n"; echo $a[0];'
test
@NikiC I do not understand how to show E_DEPRECATED on ast creating phase. Looks like it silently dropped. But maybe I'm wrong.
@rjhdby you shouldn't throw it during ast creation, but during compilation
16:13
@NikiC I do not see simple way to do this check on compilation phase because actually the same ast node is creating. Need to thinking about.
Do we have a list of always-statically-enabled, i.e. impossible-to-not-have extensions?
@rjhdby you can add a flag to the ast attr
@rjhdby We generally don't like throwing deprecations during lexing and parsing, because we don't want things like token_get_all and ext/ast to generate deprecations
@m6w6 standard, pcre, reflection, spl, date and since 7.4 hash
I think that's it?
I guess, the answer is "no", then ? :)
@NikiC skimmed it, looks good. Will read in detail later. One thought I had is: can we automatically bind or not bind $this based on usage?
That way nobody needs to write static fn(...)...
@LeviMorrison Interesting question.
@LeviMorrison It's a bit tricky because it's not just about $this, it's also about scope
16:18
@NikiC Exactly! Thanks! :)
So you have to take care that you still do the binding is e.g. get_class() is used
Though we could also bind scope but not $this ... kinda odd
Did we deprecate get_class?
We could bind scope based on $this/self/parent usage.
I meant deprecate get_class without a parameter.
How many "scope" functions are there? In the worst case could we special case them? I'd like to avoid static being a thing, and for the closure to just Do The Right Thing.
Not sure how hard that is, though.
@LeviMorrison we deprecated null being allowed as a param.
Aug 13 '16 at 22:59, by Danack
/dat code change to RFC text length ratio
@LeviMorrison If it's possible to just always bind scope but only bind $this if used, that would be great. Will have to check if there's any issues with that
Haven't really looked into the implementation yet, I saw that you had something that looks like it could still work ^^
16:36
@NikiC IIRC, bwoebi did most of the "interesting" bits of it.
@NikiC Typo: "putting of the topic"
@TheodoreBrown thanks. replaced with shelving. Is "putting off" even a thing in that usage?
@NikiC Either term is fine.
@LeviMorrison isn't there any such a list? there is really needed.
17:03
@NikiC github.com/bwoebi/php-src/commit/… is the most up-to-date branch
(rebased onto October 2018)
you can take the fn() bits from the other impl
and merge both together
@bwoebi thanks
Probably this feature has already been implemented 10 times by different people :P
haha
17:33
amazing that you can do this feature in that few lines of code
not everything needs a full rewrite of the vm :-P
It's always fun when the tests are bigger than the patch
well, typed properties was really half tests, half patch
17:51
So, I'm wrapping my head around how to compile hash tables...
\I wrote a simple PHP implementation of a hashtable
and that works in the VM
but I really don't want to hand-code the hash table into libgccjit IR
so I'm wondering, what constraints would I need to do in order to compile the hash table from raw PHP (use the same hash table for both)
part of me is thinking if I can just implement a native array type (so [1,2,3] can be compiled to long long[3]), then I could do this. All I'd need is a way of telling the compiler (or detecting) if an array was "array like" or "hash table like"
@ircmaxell I was writing that very suggestion out right now :-D
so yes, once you have a native array, you can build hashtables on top of them
what would that detection need to look like? And how can I reliably do that...?
unless....
what if instead of using an array directly
and any time I see that, I compile a native array of the subtype...
hmmm, don't love it, but could work
the problem I have is reallocation. I can do $a = [1,2,3] just fine, but then how do I grow the size without a hash table implementation, and without doing a realloc() on every single element
technically, you just need a proper syscall wrapper
where you can alloc your own memory
abstract public function malloc(
    \gcc_jit_rvalue_ptr $size,
    \gcc_jit_type_ptr $type
): \gcc_jit_rvalue_ptr;
abstract public function realloc(
    \gcc_jit_rvalue_ptr $ptr,
    \gcc_jit_rvalue_ptr $size,
    \gcc_jit_type_ptr $type
): \gcc_jit_rvalue_ptr;
abstract public function free(
    \gcc_jit_block_ptr $block,
    \gcc_jit_rvalue_ptr $ptr
): void;
ah okay :-)
18:06
So, one issue with this entire approach
nevermind :)
18:50
\o/ I was approved for a coupon card for one of my medications, I'll be able to get it for free ... out of pocket, the medication would cost around 1000 USD
so happy
@NikiC I finished reading the RFC (really like it BTW), and found a few other typos:
"undefined variable noticed" should be "undefined variable notice"
"limitation that are" should be "limitations that are"
"using an array function" should be "using an arrow function"
"$a is explicitly used by-value" should be "$a is explicitly used by-reference"
@ircmaxell #1 now
19:09
Lots of people are excited about Laravel.
We use Lumen for new services at work. But I don't like Eloquent
19:29
@StatikStasis lots of people also think that bleach (MMS) cures authism
Authsome! =P
Open request: I'm looking for small, short-term freelance projects to supplement income. Something came up that will have a serious effect on my financial situation. If anyone knows of anything, please email me at [email protected].
10
SECURITY BUG: SQL Injection with PDO::quote() – #77729
20:22
@NikiC that link you sent the other day to the GDI blog post was very interesting
 
2 hours later…
21:54
Hey @Danack do you know a way in the Docker Compose YAML to say "try to hit a container on the Docker network first. If you're unsuccessful, try and hit the host machine."

We want to be able to bring down one container brought up in docker-compose and then bring up the service locally so we can debug it.
@Allenph a php service?
Mhm. Although if you're asking if it's on topic; it's not.
Never mind. Do you know how to do that?
22:09
No - but I'm wondering why you don't want to debug it from inside a docker container?
The example project I have has two php containers. One with xdebug and one without. When I want to debug some web request I just add port :8001 to the webserver, and that skips varnish and serves the request from the xdebug enabled container.
I don't. That's the point.

I have a bunch of microservices. I have a docker compose file to bring all of their containers up. I want to bring say the "doStuff" microservice docker container down. Then I want to bring my local version of apache up that runs the "doStuff" microservice code. Then I want the microservices from docker-compose that are still running to seamlessly start hitting the local version instead of trying to hit the container which I brought down.
Oh. You said "don't". Yeah. I mean we could do that, but it would be a lot of work to overhaul everything.
I don't know how to do that. If I was going to do the same thing, I'd make sure the domain name to use was in the config file for the application, and change from the container name 'dostuff' for when I want the other services to use the container version, and change it to 'local.dostuff.com' which points to either the docker.host (or however that is spelled), or setup the extra loop back address on the host (which I've mentioned before I think), which is always reachable from inside container.
@Tiffany also if anyone know any recruiters that are looking for short-term/temp help for PHP dev, feel free to send them my way
22:58
@bwoebi where I'm stuck is reallocating. Specifically where I need to grow an array, how do I reallocate an array directly without N+1 realloc calls... Any ideas?
wee, finding undocumened classes DOMNameSpaceNode causing all sorts of problems in DOM API thanks to @ThW - what a mess externals.io/message/104687
23:43
also started on an RFC on upgrading ext/dom to the latest speficiation version. happy about feedback before throwing it into php internals wiki.php.net/rfc/dom_living_standard_api
code is 30% done for this one
@Tiffany Would you like me to share your info with my contracting company?

« first day (3069 days earlier)      last day (2103 days later) »