« first day (3853 days earlier)      last day (1081 days later) » 

1:56 AM
@CraigFrancis you broke the patch
 
2:11 AM
@Danack sure
<?php

$a = "this is";
$b = " very ";

var_dump(is_literal($a . $b . $_ENV['BAD']));
?>
it's literally the worst possible thing that could happen ...
I'm not sure if I'm saying it right, but you cannot do without concat changes, it leads to somewhere between making the thing utterly pointless and making it unreliable.
There isn't a reliable way to implement this feature without effecting the vm, simple as that ...
@CraigFrancis stop taking the patch apart and get on with the job of writing the RFC, if the patch needs changing, I'll change it ...
to be absolutely clear, if you remove the unsets (nikita agreed yesterday) you make it utterly pointless - it becomes dangerous, marking unsafe strings as safe
if you remove the sets, you make it unreliable, it will produce different results for ct and rt concats, and some concats of literals will produce literals and others won't ... totally unreliable ...
you can't make any of these changes without making the patch much much worse and the feature much much worse ...
like I said yesterday if someone says we have too drop sets for perf reasons, we'll do it ... but otherwise the patch needs to stay as it is for me to vote for it ...
 
2:57 AM
not because I'm so important, I mean to say that the only correct patch is the one I gave you, if you change it, you make it incorrect, nobody should vote for it ...
 
 
3 hours later…
5:56 AM
@JoeWatkins I've been updating the is_literal RFC, and I think it's ready (will re-check it again later, after I've hopefully had some proper sleep, as I don't know if it even makes sense any more).
I feel like I have to explore all things people might complain about. And you're right, there is a small impact either way (which I hope I've explained in the RFC). With timings from @MateKocsis on your version (with concat), the affect for normal projects looks very minimal (it's only measurable if a script is doing a concat loop a few million times).
My hack job on the patch isn’t intended to be used, it’s just to give some very rough numbers on what might happen (noted in the RFC under Supporting Concatenation). It's there to explore the suggestion from @Danack.
tbh, I'm out of my depth with the RFC process, and I would prefer concat support (because it would help projects like mine use it immediately), but I want to show that it's a well thought out idea, with all possibilities covered (yep, you can stop laughing now).
bbl, will attempt to sleep again :-)
 
6:33 AM
@CraigFrancis your focus under "Supporting Concatenation" is totally wrong, you ought to focus on how supporting concatenation is actually required for a safe and consistent implementation, and mention the cost, but it shouldn't be the focus, being fast is not more important than being consistent or correct ... without support for concatenation, you have an inconsistent and incorrect implementation ... it's not optional, it's really not optional ...
don't present it as an option we might take for perf reasons, it's not that ...
there's no point in comparing an implementation without support for concatenation to one with support, you're comparing a useless implementation to a useful one ...
I hope I've said the right mix of words to help you understand ...
 
7:27 AM
morning
 
Hello. Anyone here familiar with Ratchet PHP websockets?
 
@AloHA_ChiCken just ask your question, if anyone knows they will respond
 
7:43 AM
@JoeWatkins about the bus factor, I am wondering if not remi and cmb, and maybe even derick should be considered as part time funded to work on PHP?
its unrealistic to set the expectation that the support works in binary 0 or 1, part time is much more likely
 
well I wanted to use Derick as an example, he's clearly an asset, however, there's no way we can take him away from working on the things he's working on that make him an asset and set him to work on php-src ... it might raise the bus factor of php-src, but it would do damage to the ecosystem ... it's a net loss I think ... and as much as he does, and others like him, they don't actually effect the bus factor of core ...
I didn't want to say it in public, but it looks to me like all of the work we all are doing does not match the work of one full time employee, that has the effect of lowering the bus factor to two, it's not to dismiss all of the work everyone is doing ... it's a recognition that we need more developers, however they come ... and I didn't specifically ask for people who can work full time ...
I didn't really think about peoples feelings ... sorry @cmb @RemiCollet ... you know I'm doing what I think best, not trying to dismiss or upset anybody ...
 
i know you didn't, but the factor is an integer and you mention good arguments not including part time people, but I think there also good factors for including them.
i don'T disagree in general with your premise that we need more people
its much easier for frameworks like laravel or symfony to build a company around the open source and pay people, and for projects that are even closer to end users like wordpress, drupal, magento etc even easier to build multi million companies around it
its like an inverted pyramid, the foundations have it harder to get funding, like in science :)
 
7:59 AM
Is it really like that though? Isn't funding related on how you market the foundation rather than what pyramid level you are in?
 
moin
 
PDO boolean casting not working ・ PDO PgSQL ・ #81010
 
8:17 AM
o/
 
Bore da :-)
 
8:35 AM
should I have asked, someone said I'm "missing endorsement" ... @NikiC sorry if I should have asked ...
I'm sure you calculate the number with much more precision and probably disagree, it wasn't really a "OMG I calculated the precise bus factor and found it to be two", it was more of "it might be as low as two, and that's scary so come help us" ...
 
9:05 AM
@JoeWatkins I completely understand, I've replaced that section with a simplified [wiki.php.net/rfc/is_literal#performance](Performance) section, and the next bit on String Concatenation... I hope that better reflects your position, while still including the two points Dan was making - where I note that the performance difference still seems to be fairly small, and that literal_combine()/literal_implode() might still have a use.
 
I'll read it over properly later today and ping ... but I can still see the suggestion that an incomplete patch might be a good idea, and that makes no sense ...
 
Oh, that's not the intention... it's to imply mine is a bodge job
Maybe "I made up an test patch..."?
 
let me read it properly later, little busy for a while
 
np, and thanks for all of this, I really appreciate it.
 
9:25 AM
@CraigFrancis Please create a branch :) I need a commit at least. I'm also a bit busy, I've been refactoring the benchmark to be able to add new features
 
9:56 AM
@JoeWatkins I realise that VM changes would be needed. But what I mean is that is_literal("Foo" . "Bar") should give false. That only actual strings give true.
 
unconditionally unsetting in the vm is going to be more expensive than selectively setting or unsetting
and you can't get away from vm changes whatever, so it's only sensible to do the selective thing that doesn't always cost at least one branch
 
There's got to be a limited number of places where changes would be needed.
 
I'm a little busy, and I've got nothing to say that isn't a repeat of stuff I already said ... this needs to be proposed the way it is, the way it's consistent ... this focus on performance is totally unnecessary ... I would not vote for the feature myself if it didn't have support at the level of concat, that is how people tend to build their queries and the only place it's really useful ...
 
I'm writing an example of usage with a query builder. I'll update my version of the words when that's done.
 
10:13 AM
@Danack oh I don't object to additional functions, if you're writing something that uses additional functions, fine ... but it still needs to have concat support ... there are still use cases for functions and nikita suggested we use literal_sprintf, and so I guess we can have the prefix literal_ for another couple of functions without a problem ...
I dunno if we want to put them in the RFC, or just propose them as a PR if the RFC passes, the functions are dependant on the feature of strings ... and don't really need an RFC, if the feature exists ...
 
10:25 AM
I know concat support is needed, but I think it is preferable that people have to use a specific function (rather than concat operator) so that errors are pushed to the edge of the application, rather than having to reason about a large fraction of the codebase. I'll write the example.
 
I'm sure they will use the functions if they are available, but we shouldn't push (your) personal preference on them, we are blessing the language with a feature, not it's users with your insights ...
from the perspective of the language, it treats a . b as if you had written ab at the compiler level before anything is executed, and so should the feature, and so should the vm follow form, for consistency ..
 
10:44 AM
@Danack that sounds real bitchy, not intended, I could have said our insights ... I'm just coming at it from a different perspective I think, wanting to make it consistent with what we have, rather than something we imagine people will do ...
 
@cmb None of the tooling knows how to handle "pl"s any more, so I'd rather not go there.
 
cmb
ah, yeah, that would be an issue
 
11:02 AM
morns
 
@cmb I'm building 7.4.19 tarballs from the PHP-7.4.18 branch now
 
cmb
okay @GabrielCaruso ^
 
11:31 AM
o/
 
@JoeWatkins I was going to say......but also, it's not just my opinion, it's the opinion (as I understand it) of the guy who works at Google who made them implement literal strings across google's codebase. The talk is quite good in general: youtube.com/watch?v=ccfEu-Jj0as&ab_channel=OWASP
But the most relevant bit is at around 44 minutes in:
tbh he might be more convincing than me, but the example I'm trying to write, and words to go with it are basically "make the code be easier to reason about so that any flaws are obvious and restricted to a small area, rather than spread across the whole application".
Which is the same reason why taint analysis hasn't been found to be a useful/enjoyable thing to work with.
 
I'll have a proper watch of it, hopefully today, it's not clear from the slides what's going on and I really don't have the focus at the moment ...
 
cool.
 
but again, people will use the functions if they're available, for the reasons you gave, and I'm sure, the reasons in the video ... but that shouldn't stop us from implementing the thing consistently from the perspective of a string in zend ...
I mean let's include them, I'm convinced they're important enough to put through with the rfc, but it shouldn't be either or, the implementation should behave consistently with strings, and also provide this useful api ...
 
12:02 PM
anyone knows what this means? :( started happening recently, but only with PHP >= 8.0.2
 
@Tiffany Happy belated BDay! =)
 
@StatikStasis thanks :)
 
12:32 PM
@SaifEddinGmati from a completely fresh checkout and build?
oh lordy...brew.....
 
I'm trying to remember where someone saw a very similar thing. think it might have been seldaek....
 
not brew, phpbrew, it doesn't do anything special, it clones the repo, and build it
 
basically it was one bit of brew using one set of compile flags, and another set using another lot of compile flags.
er, so even if phpbrew != brew some chance of being the same problme.
@SaifEddinGmati maybe just do what it asks and add -fPIC to your CFLAGS ?
 
@GabrielCaruso @Sara who is going to handle 8.0.6 ?
 
12:39 PM
@Danack when building PHP? that results in an unknown flag error
 
Guten morgen
 
cmb
@SaifEddinGmati maybe as workaround you can build without imap?
 
i reinstalled libc-client, and now it seems to be building ... will see if this fails.
nope ... same
 
@SaifEddinGmati from phpbrew or from the build? aka what is the exact message?
 
12:52 PM
I meant when adding -fPIC
 
ah
```
Error: Configure failed:
The last 5 lines in the log file:
checking for grep that handles long lines and -e... /usr/bin/grep

checking for egrep... /usr/bin/grep -E

checking for a sed that does not truncate output... /usr/bin/sed

checking build system type... Invalid configuration `fPIC': machine `fPIC-unknown' not recognized

configure: error: /bin/bash build/config.sub fPIC failed

Please checkout the build log file for more details:
```
logs:
```
configure: WARNING: you should use --build, --host, --target
configure: WARNING: unrecognized options: --enable-hash, --enable-json, --with-xmlrpc, --enable-maintainer-zts
configure: creating cache /home/azjezz/.phpbrew/cache/config.cache
./configure: line 3338: /home/azjezz/.phpbrew/cache/config.cache: No such file or directory
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /usr/bin/sed
 
@SaifEddinGmati Ok, I think I'm going to opt out of looking at m4 config..... maybe just ask the phpbrew people how to set -fPIC correctly. I can see that they're attempting to detect it, but.....yeah. m4 files. someone needs to be paying me to debug those.
 
@NikiC Congrats for the property accessors RFC! It's insane how detailed the description is :) Do you think it'd make sense for me to propose "clone with" as a followup in order to make readonly properties more useful?
 
mb_convert_encoding removes array alements ・ mbstring related ・ #81011
 
1:15 PM
@LeviMorrison do you have time for composite intersection types or should I go on with just my current patch/proposal of pure intersection types
Also @IluTov how far are you with type aliasing?
 
@NikiC Is there any particular reason why you stripped lazy/guard away from the proposal, apart from reducing the scope and potential controversy of the RFC?
 
@bwoebi yeah, just a question of scope
 
@NikiC okay. Also, is implementation complexity your only concern or is there something about the RFC itself what makes you unsure about the feature?
@NikiC Something the RFC does not mention: when casting to array, retrieving the properties in foreach etc. are the synthetic properties ignored? I.e. will the array-like or iterator usage of objects always directly access the whole visible backing storage, but nothing else?
at least it's not very clearly mentioned, you are just putting the example or var_dump() forward, but that's __debugInfo() and not really the same
… ah it's yet in another section
okay, I'm just blind.
 
1:31 PM
It's a long RFC. :-) (I'm still reading it.)
 
I haven't even started yet, I'll wait for the dead of night when it's quiet, there are still offspring all up in my face at the moment
 
@NikiC Two typos, I think:

Under inheritance, you have __METHOD instead of __METHOD__.

Under by-reference getter: "leaves a loophole that allows you do bypass the private" - I think that "do" is supposed to be "to"?
 
Hi all, first and foremost, I'd like to introduce myself, my name is Flavio, I've been working with PHP for the past ~18 years in-and-out and have been following internals more closely for the past ~1 year. With that being said, I just read @JoeWatkins blog post about the current bus factor in PHP and about a month ago I've approached my employers to ask exactly to be allowed to contribute to open source during my work hours, to which they were 100% on.
 
hola Flavio
 
I'm still digging through PHP's internal code and so far I've been able to write some simple extensions (mostly wrappers for Linux's libraries/drivers), but I'll keep digging and do my best to become a contributor
@JoeWatkins hello there!
 
1:37 PM
Give your employer our thanks. :-)
 
They are awesome people <3
 
@Crell Thanks, fixed
 
I want to write some documentation around my learnings, that could possibly help newcomers as well
 
@FlávioHeleno As someone still struggling to learn internals myself, that would be delightful.
 
@FlávioHeleno that would be awesome
 
cmb
1:40 PM
@FlávioHeleno are you aware of phpinternalsbook.com?
 
I'm more than happy to contribute to the language that helped me to get where I am now, and specially, help in any way I can to get more people onboard to contributing
@cmb yes! it's an amazing resource and has been one of my recurring help resources
 
@bwoebi I've updated that section to mention (array) and foreach more prominently
 
It's a good read, for the parts that are written. But there's huge swaths that are not yet written. Filling in those gaps would be very helpful.
 
cmb
^ + updates
 
Also, "where to find a list of this kind of stuff" (eg, what function calls do what.)
 
1:42 PM
as soon as I'm able to fill in the gaps, I'm more than happy to do it
@Crell I had a good time figuring that out myself hahaha
 
I still haven't...
 
@FlávioHeleno there is also zend.com/resources/writing-php-extensions
 
we're all so friendly ...
 
I tried to structure my extension code to be easier to get a grasp of what is actually happening under the hood and thrown in some comments
 
@bwoebi Mostly a question of language/implementation complexity. I think the RFC is fairly solid apart from the TODOs, though some of them are rather significant (especially the one about parent accessors).
 
1:44 PM
@Girgias I simply love that article, that's one of the first ones I used to understand what I had to do
 
I may be in the minority here, but adding inline comments that describe what a given section of a file is for and what it's doing and how to modify it would be fantastic in my mind. Internals currently is sorely lacking on the inline documentation front.
 
Well it's kinda the only one which tooks about the hashtables :D
 
another thing that is amazing is the ext_skel, it does a great job with the stubs and method/function entries/parameters
I'd love to give it some attention at some point to get it to generate a bit more boilerplate code than what it does right now
 
by documentation, I think you mean code for humans ... but two sets of code doesn't sound very appealing ... the best documentation is the code itself, it can't be wrong or out of date ...
still, I remember wanting to improve the internals docs also ... you just sort of get over it when you find your way around ...
 
Suggestion: In addition to updating the inline docs, internals book, and other "in place" documentation, blog about what you're doing and get it on Planet PHP. And make sure you mention in your blog posts who your employer is, so they get credit/karma/PR for letting you work on php-src. :-)
 
1:48 PM
it's like demanding a map of the street you live on ... useful when you move in, for about 5 minutes ...
 
agreed @JoeWatkins!
 
@NikiC Can only speak for myself, but I'm using the feature all the time in c#. At least the language complexity is definitely worth it, in my opinion.
 
@Crell I think I lack the skills to write appealing blog posts hahaha
 
@JoeWatkins "Docs can get out of date". Yeah, yeah, sure. If done poorly, sure. But things like, does the %precedence block at the top of zend_language_parser.y order top to bottom or bottom to top? I recall being very surprised by whichever it was. A comment block above it explaining what the heck that whole block does would be extremely helpful, and isn't going to go out of date very quickly, I'd imagine.
@FlávioHeleno Appealing isn't the point. Getting your employer some good PR/karma in return for their investment in you is. ;-)
 
@Crell hahaha well pointed!
 
1:51 PM
(Because that encourages them to keep doing it.)
 
@Crell (but that's rather something to look up in bison docs)
 
Assuming someone knows that a .y file means "Bison". And where to find said docs.
 
another very interesting resource I've used is this repository: github.com/ThomasWeinert/php-extension-sample
 
where to find? google it - and eih, if you actually want to change that file you probably want to have read some docs least
 
it shows how to do usual things with methods/classes/etc but internally rather than in php
 
1:57 PM
@NikiC the example under this line: "It is not possible to mix an implicit get with an explicit set, or vice versa: "

I feel is missing some semicolons. I also do not fully understand that section. :-)
 
@Danack installed it without imap, then ran phpbrew --debug ext install imap -- --with-kerberos --with-imap-ssl, and it worked ... not sure why i hate to install imap separately later, but it worked ...
 
@Crell I thinkt the example is alright - where a {} is present no semicolon is needed
Should be more obvious if you imagine this being multiple lines
 
@SaifEddinGmati Because IMAP is weird
 
@Crell Is it clearer now?
 
@NikiC Much better, thanks.
The other "empty explicit" examples would benefit from the /* ... */ body as well, I think, to make it clear that get {} isn't itself a legal syntax.
 
2:09 PM
I just spoke to my manager about our chat and she said "let's put tasks on your week so you can block your schedule to do work for php"
 
<3
 
That's quality management right there
 
funny thing: my employer is a consultancy but currently has no PHP devs other than myself AND has no PHP projects being done. They are fine with the contributions because the DO KNOW the value of open source. I wish more companies were like that.
 
@Crell It should be legal syntax though, just always returning null.
 
@bwoebi correct
But it is rather confusing for examples
 
2:39 PM
@Girgias Uh, I forget the exact state of the branch I sent you, but I definitely remember being disappointed in our grammar. As in, to the point I really do think we should go about a multi-year effort to change it.
Supporting static as a type really burdened the grammar, and supporting intersection types would do the same if we don't upgrade the parser. However, upgrading the parser has downsides, and still won't fix some of the damage done by static, at least as far as I understand it.
Switching to types coming after variables would alleviate these in the long-term.
 
@LeviMorrison Yeah I remember you rambling about the grammar, oh well I'll probably make the discussion official and will see if people want the full feature or just pure intersection types are good ATM
How on earth would you make types after variables a viable migration?
But the issue with & could also be solved by removing by-ref variables... (with proper inout refs)
 
I still struggle to come up with use cases where I would want intersection AND union types in the same type def.
 
Actually, post-variable types are trivial. It seriously took me 2 minutes.
@Crell array | (Countable & Traversable & ArrayAccess)
 
Was going to say just ^
 
Damn you!
 
2:43 PM
@Girgias You allow either (but the compiler forbids both on the same parameter).
 
Can we just add an arrayish custom type for that and call it a day? :-)
 
@Crell And then someone else will want Seekable, and someone else Serializable (or whatever).
The exact requirements vary.
 
Grmbl.
 
class Foo {
  static $var; // true ambiguity at the grammar level; is this a type or "static"?
}
Upgrading the parser does not fix this.
 
The ground work is there, I might look again at my branch where I use precedence for composite types to see how easy that one is to support
 
2:46 PM
class Foo {
  static $var: static; // oh, types are in a separate position, so no ambiugity.
}
 
I mean that's more an issue because static has a bajillion meanings in PHP
 
// An upgraded parser would be okay with this one.
// not truly ambiguous because `$var` is not permitted in types, so that's a by-ref arg
// I don't see that changing, either
function foo(Foo & Bar & $var) {}
Still, I think this is simpler for humans, and if I'm ever wrong about variables being in types, then we'd be good-to-go:
function foo(& $var: Foo & Bar) {}
 
I don't see why this is simpler for humans
 
Also, it's academic. PHP's type hinting isn't going to flip on its head at this point without a LOT of pain.
 
Where's the pain? Social discussion about it?
 
2:52 PM
The only reason the second version is "clearer" is because & is the by-ref marker, and no one on earth is going to put a space between the by-ref marker and the variable name
The IDK how much code has been written with types which might need to change
That or you need to support both variants for ever
 
The pain is in dropping the old syntax
 
I read an article a while back that suggested post-fix type declaration was gaining in popularity because of the growing appeal of type inference. But PHP doesn't do type inference, so that's less relevant.
 
@Sara Legacy syntax is best syntax
 
$HTTP_POST_VARS
 
I mean, it's not, but it IS syntax.
 
2:54 PM
I kid I kid
=P
 
@Crell It's not just because of that, but also because it's simpler at the grammar level. That makes tools that work with languages a bit easier to write. This is partly why practically every new language does the types post-variable name.
 
BUT LET'S JUST MAKE A NEW LANGUAGE
WITH BLACKJACK
AND HOOKERS
IN FACT, FORGET THE LANGUAGE
 
@Sara I like it. hahahaha
 
@Sara Fortunately, we can keep the old syntax but only for the type features which existed at the time.
 
In the annals of history, languages have been influenced by some pretty bizarre occurrences...
 
2:55 PM
@LeviMorrison Hrmm, okay. That's a fair point.
 
hack solution: all union and intersection types must be declared between parentheses.

so: `private (array | (Countable & Traversable & ArrayAccess)) $arr;` instead of `private array | (Countable & Traversable & ArrayAccess) $arr`
 
I don't like it, but it's fair.
 
Of course, we tell everyone to prefer the new syntax, because it's better so the old feature will go away eventually (like in 12 years).
 
@SaifEddinGmati You say "hack", I say "practical"
 
// Which do you prefer?
private array | (Countable & Traversable & ArrayAccess) $arr; // A
private $arr: array | (Countable & Traversable & ArrayAccess); // B
 
2:56 PM
Also, gonna say it again: Type aliasing.
 
@Sara i mean, like ... hack, the langauge, not a hack
 
@Girgias Haven't worked on it for a few weeks.
 
I prefer:

type Arrayish = array | (Countable & Traversable & ArrayAccess);

private Arrayish $array;
 
@LeviMorrison Definitely the latter. But it's a little too late for that ^^
 
@IluTov Okay, just to let you know that if only pure intersections are added you might need to do some extra work to get it to work nicely if you do type|Alias and Alias is an intersection type
 
2:58 PM
@IluTov I don't think so, honestly.
 
My only concern with that is how it interacts with autoloading.
 
But groundwork should be there
 
@Crell The way you'd expect.
 
@Crell This is a very legitimate concern, and we already have some troubles with class aliases in this same vein.
 
@Sara I mean, does a type def trigger autoloading? Does that mean we end up with files that have just one single type line in them?
 
2:59 PM
If a type doesn't exist at the time it's used, then obviously it doesn't match. ... except that's wrong, because aliases are a thing today, and adding type aliases other than class_alias will make it more common to hit this edge.
 
There are ways that could get answered. I am unclear on what the best answer is.
 
@Crell If that scares you, put your stuff in preloads. :)_
 
That is another option, yes. Or composer file blocks, for dev.
It's not a perf concern for me as much as a "people getting pissed off at having to add a while file for one frickin' line" concern.
 
we will end up with

if (!type_defined('foo')) {
type foo = bar | ( baz & qux );
}
 
@SaifEddinGmati I certainly hope not.
 
3:03 PM
@SaifEddinGmati No. We won't.
 
if preloading + composer file for dev, we will.
 
Have you heard of autoloading? I feel like you haven't heard of autoloading.
 
then 1 type per file ..
 
@SaifEddinGmati You're one of today's lucky 10,000! Take a look at: php.net/autoload
PSR-4 isn't the only autoload mechanism
It doesn't even have to be the only mechanism in a given project.
There are so many reasons why THIS is not the blocking problem.
 
aware ... but no one is registering their own autolaoder (expect people that want to do some sort of per-processing ).

personally i would just declare them all in types.php and include that at the start.
 
3:06 PM
You don't have to write your own autoloader. That's a non-sequiter.
Have you also never heard of Composer? Or frameworks?
 
I'd be OK with a file that has a bunch of namespace {} blocks with type defs inside them that gets included automatically. But given how pervasive PSR-4 is, there would need to be some community communication around how best to handle one line defs. That could be done, but it's something to consider.
 
which would be the solution to include types.php

i'm not saying that autoloading is a blocker, just thinking out loud :p
@Crell same with constants actually
but at least autoloading would be triggered for types, it's not for constants and functions, so currently only solution for that is including the files manually
 
Autoloaders are not currently told what type of thing they're autoloading, right?
 
yea
because they are only triggered for "classish" types ( classes, interfaces, and traits )
 
And enums. :-)
I wonder if it would make sense to tell them, or register different autoloaders for different types. Possibly allowing for type-specific autoloaders. Could be a stupid idea, not sure.
 
3:12 PM
and that, which is also "classish" :p
 
@Crell That's Dan's idea, and something I wanted to look into, but eeeeeer too much stuff going on
 
I see you have had similar thoughts.
 
It would make sense IMHO to have a different autoloader for functions/classes/types
 
@Crell that's basically the same as in hack :p #another_one
 
@Crell we could make it a convention in composer to have a namespace-specific fallback file, which then loads your type.
There's nothing which necessitates 1 type per file
doesn't do any harm to load a hundered types at once
 
3:18 PM
@SaifEddinGmati "no one is registering their own autoloader" how sure are you of that? :P
 
I'm complaining about autoloading types while my library loads over 600 files using composer file lol
 
True. That's what I was talking about with using the file key, which gets loaded up front at every request.
 
@Crell (I think "file" is a bit too invasive, but that reason is that we don't have function and constant autoloading)
 
Invasive how? How would it be any different from "put your types in types.php and load that" (which would be done via file).
 
@Crell fallback i suppose would be the opposite, as in "here's a file, but only load it once something from "Foo\\Bar" namespace is missing"
 
3:21 PM
@Crell well, because currently all file from all included composer projects are always executed on every request
@SaifEddinGmati yeah exactly that
 
Oh, I see what you mean. But... I don't see why that's a problem in the modern era, with opcache, preloading, and file systems that cache stuff for you anyway.
 
@Crell so, why don't we then just always load everything, but instead use an on-demand autoloader?
 
There are people that have argued for that. :-) Mostly for convenience and historical reasons. But also because there is a memory cost to loading a lot of unused code.
But I would be shocked if a bunch of typedefs ate up enough memory to care about.
 
depends if type a = b | ( c & d ); results in b, c, and d also being loaded
 
I wouldn't expect it to.
 
3:26 PM
typedefs alone no. but functions, constants and typedefs all together may have a sizeable footprint. Also, if we had proper function autoloading I could imagine usage of bare functions becoming more popular again. At least I dread using too many functions for that reason.
 
500 functions, sure. But 500 typedefs I wouldn't expect to be costly.
 
@Crell I'm just arguing about the whole package, of which typedefs are part. typedefs themselves shouldn't be too costly, no.
btw. @NikiC is the property accessors impl basically ready or can I contribute anything there? having a bit of free time the next days…
 
3:51 PM
How can I get the current session save handler
 
4:02 PM
@ln-s not sure if that is possible. there can be normally only one and it is commonly global. what is your use-case? maybe wrapping and switching the implementation inside the wrapper does suffice w/ your use-case.
and there might be an ini setting that you can query for the string value.
or was that the serializer?
 
cmb
@Sara, 7.4.19 is already tagged, and 7.3 is not affected by the issue, so we only need 8.0.6 :)
 
4:32 PM
Unrelatingly, there's no longer a 0 after the 3 at the beginning of my age and I feel I have peaked. At least now that's done I can stop having expectations.
 
@FélixGagnon-Grenier … so you've reached the mature old age of 311 years?
 
indeed ;-)
 
or was it the zero immediately following the 3 and now you're 310?
 
lol, that would be a hard step, 30 > 310
overnight back problems
I think the hardest hit was when I realized I now have a favourite back-pain relief exercise
 
I don't know why, but fried pickles sound really good right now
 
4:45 PM
Anyone know when --EXTENSIONS-- was added to phpt? I've never noticed it before, so that's why I'm wondering. Documentation doesn't say anything about when it was added. Has it always been there?
 
@LeviMorrison github.com/php/php-src/commit/… according to git blame - so PHP 5.3
 
@cmb Is Sara handling it? I just saw the emails, I'm off this week and away from my laptop :(
 
@bwoebi Awesome, thanks.
 
cmb
@GabrielCaruso well, than it would be great if @Sara could roll 8.0.6
 
@bwoebi It could use a review if nothing else :) I think from implementation side main things missing are some trait handling if we want it (abstract property in trait implemented by class) and some way to use parent accessors (where it's not clear how that should even look like...) Also static property support, but I think that is better left off
 
cmb
4:50 PM
@LeviMorrison note that it wasn't used until recently (see github.com/php/php-src/pull/6797)
 
@NikiC yeah, I think first we should get the core proposal in, then we can add lazy/guard, implicit backing support to properties with get/set methods and static props
but I'll check it out tomorrow then
 
@cmb Ah, new behavior seems much better.
 
@Crell definitely different callbacks for different types. I was playing with something and realised that it would require different info in the params passed to the registered autoloader. And if the other params vary based on what the $type param is.....then that sounds bad.
 
Spending the day reorganizing my ToDo list. Making a kanban board on the wall via tape and sticky notes. Trying to modify my format. I have Firefighting Work, My ToDo, Assigned Work (to others), Routine Work (weekly stuff), Things requiring follow-up, Projects...
@Danack You've read The Phoenix Project... do you have a kanban board?
 
Was the splat operator (variadics) added in 5.5 or 5.6?
 
5:01 PM
@StatikStasis I haven't actually read it.....just got it on my bookshelf. And no, though they sound like a good idea.
 
ah- k. It is a very good read.
 
D'oh. I guessed wrong. Thanks.
 
My plate has become fuller, current ToDo not working anymore. Must rethink before I stress my self out.
Also wanting to incorporate some way of labeling the work by the 3 V's: Vital, Valuable, & Very Nice to prioritize.
 
@cmb I'm happy to roll, wasn't sure if @GabrielCaruso wanted it.
Command decision, I'll just do it now.
 
5:08 PM
Howdy folks. I have to store a big array of data that don't fit memory and be able to add items either to the beginning of end of this structure, and to read and delete data from both ends, too. The current implementatio is filesystem based, and when reading from the beginning, the whole file needs to be re-written. Does anyone recommend a more efficient data structure for this?
The first thing that comes to my mind is DoublyLinkedList, but I didn't visualize how to actually implement this, yet, given it has to persist between different requests
so I'd have to store it on SQL, or filesystem, as the current implementation is doing, I guess.
 
First question: What are you actually doing and why, to what kind of data? "Don't have that much data in memory" seems like the best first step.
Using DLL in your own code is almost certainly going to be worse than a plain array in this case.
 
It's for a WordPress plugin that has to run on all kind of servers, including low memory ones
One usage is to build an array of all files inside a given folder, that can be very big
If memory or time limit is hit, it commits to filesystem and picks up where it left off in the next request
 
Ha! Sounds like what @Tiffany was working on recently.
What do you plan to do with this data set?
 
I need to process this Queue later, performing different actions
 
So the general concept is "do operation X on all files in this tree, which is of unbounded size"?
 
5:14 PM
exactly
- Grab file A
- Process File A
- File A Done
- Get File B
 
Use DirectoryIterator and friends to have the list generated lazily. Then foreach() over that. You'll never have more than one file record in memory at once, so memory will not grow.
 
- Grab file B
- Process File B
- Memory or Time Limit hit
- Re-add File B
- Finish Request
- Start new Request
- Pick up File B
- Process File B
- File B Done
- Grab File C
I am using DirectoryIterator to build the list
 
If you are worried about hitting a timeout, instead toss each item into a queue (or just a DB table), and then have a separate queue worker that chews through that list and pops stuff off as it gets done.
 
yes, that's exactly what I'm doing. However, a filesystem-based Queue is proving to not be a good choice, as I need to re-write the file everytime I want to unshift from the top
 
You don't unshift from the top. That's not a thing.
And a giant file on disk makes for a lousy queue backend. :-) Either use a real queue server or a DB table.
And then check if you're close to a timeout before each item you process. If so, quit and wait for the next run to continue where you left off.
Stopping mid-item is a mess you do not want.
 
5:19 PM
It has to stop mid-items, to process 5GB files for instance
Well, I guess I'll switch to SQL-based Queue...
 
What exactly is the processing?
 
Unshift from the top is a legacy requirement
The processing varies, it can be compressing or extracting, for instance, but the processing is not important, the problem is managing items in both ends of the Queue efficiently
 
If you're fetching from both ends then it's not a queue. Stop doing that, and the process becomes way simpler.
 
I need to be able to manage both ends, so you're right, maybe the name is not "Queue"
 
Why manage both ends? Does the order of processing matter?
 
5:23 PM
see File B example above for instance, where I re-add it to continue processing
- Grab File B (get first element from Queue)
- Re-add File B (re-add B as the first element of the Queue)
 
And can the longer processes be themselves split up into sub-tasks at discrete points?
 
it already does that to the most atomical levels it can
there are files that are just too big
 
Exciting.
 
you can't process a 1GB file in one request in GoDaddy
 
Sounds like GoDaddy is the problem there. ;-)
 
5:25 PM
Nope, this already works very well
Except when I need to manage the beginning of the filesystem-based Queue
 
Instead of putting stuff back in the queue, try having an "active" marker. Each worker gets its own separate active space, and on start checks its active marker. If there's already something there, keep working on it. If not, move an item from the queue to its active space and start on it.
(active space in this case is probably a separate DB table with the original queue item and whatever partially-done data it needs, if any.)
 
cmb
@LucasBustamante do you need to remove the file before it is processed in the first place?
 
@cmb In the current implementation, yes, but I suppose I could use ftell and fseek to avoid re-writing the file
I already make heavy use of those in other areas
@Crell that's a good idea. Well, thanks guys, I will grab some coffee and pause for a while and think about this
 
cmb
yes, that's the idea. if you need to mark the file as being currently processed, add some marker to the line (space vs *)
 
A true queue wouldn't let you do that, but a custom SQL queue-like-thing would make that easy. And it's still better than trying to juggle "put in, take back out, put back in, etc." And it still allows for multiple parallel workers, and keeps the order irrelevant.
 
5:34 PM
@Crell to an extent, I'm fortunate I was building on top of something already present that did a lot of the legwork for me
 
shouldn't argon2 algo be always available if ext-sodium is present in PHP 7.4+ ( according to wiki.php.net/rfc/sodium.argon.hash ) ?
 
a coworker helped me rewrite it last week, it's better in all sense of the word: more efficient, transforms the data better, code's easier to read
 
Noice.
 
and if I need to modify it, that will be easier as well
 
cmb
@SaifEddinGmati requires libsoodium 9.6 at least (github.com/php/php-src/pull/4012/…)
 
5:47 PM
opcache (without file cache) on the CLI with opcache.enable_cli is still per process or? i am seeing confusingly great improvements in performance doing that and unsure why this is the case
 
opcache is great and evil at the same time, I remember changing some stuff and driving myslf nuts as to why changes did not take effect
 
forget it, the customer mentions they used the filecache actually.
 
@cmb thanks!
 
Or pushing to dproduction and thinking everything was fine, and then a coupple of minutes after testing everything was definitely not fine
:D
 
@cmb Done
 
5:59 PM
lol
 
@Crell btw, if you want to add examples, i created: github.com/azjezz/php-rfcs
 
imposter sus
 
Examples of...?
 
Apr 27 at 22:23, by Crell
@SaifEddinGmati btw, please feel free to steal any of the examples I use on the mailing list for the RFC if you think they'd help strengthen it.
 
Oh. I was saying you could steal them. :-)
 
6:02 PM
wondering how to phrase the interface behavior in the RFC...
 
@Tiffany there's an obvious joke around that theme but I don't really like it
 
@Sara sorry, I should've let you know that I was off :)
 
6:33 PM
lol funny amogus
 
@Danack had a shower thought, possibly somewhere in that sentence there's the word "alegory"
 

« first day (3853 days earlier)      last day (1081 days later) »