« first day (4447 days earlier)      last day (726 days later) » 

00:06
so for any of what I want to do too really make a difference you'd probably need to only allow a subset of PHP without the dynamic stuff
and the dynamic stuff is in just about everything one way or another
To even make it possible to do such things you'd need to add reflection to a compiled language and there aren't many of those. Go, Delphi and Objective-C are the only ones I know
actually reflections are pretty "easy" to implement, they are basically a constant data structure at runtime, but, you can't allow changing visibility ( or maybe you can? )
I honestly couldn't say either way, but I think the idea would be to have enough to do things like dynamic method calls as thats one of the biggest uses in php (outside require and include).

Azjezz ideas look good, but I honestly think coroutines are better than Async/await for PHP. PHP is pretty lucky in that we haven't yet committed to a particular method right now and I think people generally agree Go has the better async model for most use cases
00:23
@JedJonesUk actually not, async/await as described there are better than goroutines, the async keyword can only be used in front of an expression to indicate it runs in an async context, which results in an awaitable, that you can use await keyword to wait for.
Ok, reading a bit more it makes sense because Ara would essentially be a new start with the ecosystem in many ways and so you don't really have function colour issue as you can just async everything from the very beginning with psl at the heart. This would work nicely
you don't have to async everything, your code can be still the same, and just one function uses async await internally,.
that's how async/await work with Fibers, using PSL v2, or Amphp v3, or ReactPHP async v2 ( not sure about version)
01:07
For the record, this is why I don't post past my bedtime, insomnia excepting: twitter.com/mikeblack114/status/1604630179166371841
that guy has a god complex
He thought content moderation was easy, and that the people at twitter doing it were idiots for claiming it's hard....and it looks like the sudden banning of links to other sites was a kneejerk reaction to him asking investors for more money, and the replied with "why should we invest in a site that is filled with posts saying, you can find me elsewhere?"
 
1 hour later…
02:22
Do Mastodon instances allow inserting ads? I have yet to see any. What's the incentive to hosting a Mastodon instance?
02:43
phpc doesn't have any ads
there's an open collective thing for donations
however, promoting one's stuff is allowed within reason ... i.e. don't flood the timeline with it (this is just phpc, other instances may have different rules)
to give an example, one account was limited when they used a script to load tweets into their mastodon account, and ended up with like 60+ posts in the span of a few minutes...
(we didn't know that's what happened, we just saw the 60+ posts and limited their account, which required them to contact moderation to appeal it, they explained what happened, and said it wouldn't happen again, we removed the limit)
That explains phpc and hopefully is sustainable. I meant my question to be more general though. The thought that running one targeted at a hobby crossed my mind today and might be fun, but also sounds like a lot of work.
ahh
so... you can run your own if you want... there are some platforms that offer hosting, but I'm not sure which ones are open for new people... phpc used to be hosted on MastoHost, but they're "temporarily unavailable" ... when we got to around 2k users, it started getting really slow, and it ended up being more cost effective to self-host on a VPS
there are people I know you might be able to ask for assistance, but I need to make sure it's okay
03:34
toot.io/mastodon_hosting.html and fedihost.io/launch are getting into the managed Mastodon hosting game
But yeah, it's some level of work. If you want to start your own that's pretty well-trod ground on the tech side, as admins are pretty free about how to scale things up to 100k+ active users. Moderation is OTOH the thing that may be more annoying, since, well, it's a community.
IMO if you want to set up a single user instance it's because you really want to tinker...it's not "throw together a WordPress blog" simple and there are no longer super cheap managed options
Eventually there'll be some ActivityPub compliant thing that's super easy to self-host but Mastodon isn't quite it.
Thing with most Mastodon instance admins is they're infra folks more than they are devs, with a few exceptions. And if you want to host ads you have to figure out how to get advertisers in a way that provides you measurable revenue. And you have to build ads in on top of that. Thusfar, it's been most cost-effective for all involved to either ask for donations or, in an isolated case or two, gate membership in the instance behind a paywall (cloudisland.nz does this).
Due to Mastodon being a bit of a BDFL-ish project, pretty much guaranteed the first thing with ads that interoperates with Mastodon will be Tumblr or the like.
Ignoring Truth Social and Gab, who forked Mastodon, have been defederated by everyone (or effectively ran in standalone mode), and might have ads, idk
03:51
@Tiffany won't mind if phpc.social showed me ads about dev tools or PHP conference, those are things I'm interested in, i know my data is not being collected, and it's another income stream for phpc.social, so it's a win-win
we do post announcements about conferences and stuff :P
well, is it paid?
the goal has been to accept signups who have even a passing interest in PHP so that we can post announcements specific to PHP and the userbase not be annoyed by it
narp, not paid
@iansltx was thinking about this, it would be really cool to have a smaller activity pub complaint tool that one can use for a single user instance, basically lightweight mastodon
@Tiffany well, that sucks, it would be nice to have a stable income stream through ADs on there, by ADs i mean just static images within an <a> tag, no tracking or data collection.
I dunno... phpc is non-profit... balancing that with ads can get messy
03:57
@iansltx Moderation is the frightening part. I've been down that road before and it's a thankless and time consuming job. I think most are understanding of ads if they're reasonable.
yea, ADs that interest me, without collecting my data and tracking, are 100% fine, there's space in the screen for them.
I'm not sure ads exist anymore without tracking and data collection.
Ads have always had some degree of tracking embedded in them in my experience, which dates back to about 2002.
yea, i don't know much about mastodon, but if it enables something like plugins, one could use the space under the textarea on the left to add an ads widget for that, static ads. just images with links.
That's just not a thing. No one would pay for that.
They would, back in 2008 :D
04:02
if it's a big enough community for something specific, they might
you are targeting an audience
in this case, it will be PHP developers
@Girgias To what are you referring?
@Trowski You, about textual ads
@SaifEddinGmati For phpc, sure. I was speaking more generally. It would be difficult to start a site that had a payment wall from the start.
Anyway I should go to bed
@Girgias Text ads usually had some tracking embedded in the link or script that generated the text.
04:05
@Trowski yea, but if it's an option, instances that could make money from it, would find it beneficial, others can just keep it disabled?
Definitely. For certain communities that might work. I'd be willing to pay a small fee for phpc to support the site.
04:18
@Trowski I'm sponsoring it via open collective, but won't mind seeing ads to the side on top of that tbh, as long as they are PHP/dev related, don't have tracking or collect data.
04:31
@SaifEddinGmati also, my apologies for hijacking your thread of joy with something... completely unjoyful
oh it's okay :D
 
3 hours later…
07:43
I have two branches, one that was severely outdated from upstream (Branch A), and one that is freshly branched from upstream (Branch B). I need to apply changes from Branch A to Branch B. Is there a way I can diff between the two branches and ignore changes from upstream that occur on Branch B? Effectively only seeing changes from Branch A.
looks like this is what I need, basically stackoverflow.com/a/17605501/2524730
 
2 hours later…
09:55
@Tiffany I think you want git diff B...A, which compares A with the common ancestor of A and B
note the three dots, and note that for git log to list the same commits you need two dots, git log B..A
416
A: What are the differences between double-dot ".." and triple-dot "..." in Git diff commit ranges?

Mark LongairSince I'd already created these images, I thought it might be worth using them in another answer, although the description of the difference between .. (dot-dot) and ... (dot-dot-dot) is essentially the same as in manojlds's answer. The command git diff typically¹ only shows you the difference be...

 
2 hours later…
12:17
o/
got new glasses
lol
12:29
Should array access always return a nullable type? That has to be checked with ?? or is_null/!== null ?
In terms of type-safety.
Wonder how that logic works in Psalm/Phpstan, with null checking. Or how smart it is.
12:55
@Danack Not sure how much "glee" I got out of it... I wasn't that bored.
13:14
@OlleHärstedt i think so
I would use something like if(!array_key_exists( $key, $array)) { // error handling }
or assert(array_key_exists($key, $array));
13:35
I want one help from you guys,
I have one array -
$arr = [
'cb',
'title',
'author',
'categories',
'tags',
'date',
];

but I want add a value just after title
13:51
@Ekin Ugh!!! I saw the starred link, hit the link, hurried and scrambled for my headphones because I saw it was a YouTube link, only to have 'that' blasting in my ears. Good on you... //cc @PeeHaa
1
A: Add new element in array after particular value in PHP?

TarangPuse array_splice(): <?php $array = array( '1' => 'staff', '2' => 'Name', '3' => 'Email', '4'=> 'surname', '5' => 'registrationno', ); array_splice($array, 3, 0, 'myvalue'); print_r($array);

@JedJonesUk "Azjezz ideas look good" fyi, 'Saif Eddin Gmati' == 'azjezz'.
14:17
My search-fu is failing. Are the procedural versions of the Intl functions (e.g. numfmt_format_currency ) actually listed in the PHP manual?
@yessure These days we have ?? to give a default instead. :) Dunno if it's enforced by Psalm. It probably should be.
@Danack it looks like they appear on the OOP variant page only, and don't appear in search results or from the url function redirector
Does anyone remember discussion about #[SensitiveParameter], w.r.t making it apply to object properties too?
Hmm. The page is here: php.net/manual/en/numberformatter.formatcurrency.php but searching in the search box for the function definitely doesn't work.
cmb
cmb
14:46
@Danack see github.com/php/web-php/issues/677 (same issue)
Thanks.
@Stephen No, and I can't see any discussion. My gut instinct is that it sounds like an 'ungreat' idea.
15:14
Did the announcement of the vote for the DateTime exceptions collapse itself into the discussion thread for anyone else? I looked for a cause, and couldn't see one as it appears to not be a reply message, and has a different subject.
@OlleHärstedt I'm old school
lol
15:47
Hello, i have probleme where i'm working with more then 20 api at once and for insertion php( symfony framework) take longtime to insert data in database. is there any solution where i can avoid php timeout. thank you.
@Astronaute In general, if any request to a webserver is going to take more than half a second, it should be moved to be processed in a background worker, rather than in the webserver.
I'd suggest maybe googling "php background worker gearman" and learning what is possible.
@Danack thank you i will take a look. i wanted to do it in js but the company policy won't let me to that. i mean js is good for working with API's
@cmb How search index is generated for web-php?
16:19
@Astronaute if the app is in Symfony, Symfony already has a solution for this, "Symfony Messenger"
@Krzysiek In a terrible way, AFAIL it's an SQLite DB that is generated during rendering?
16:45
@SaifEddinGmati yes it is in symfony.i receive more then 11 000 each time i call API so i don't realy find a solution to insert them without php tiemout
@Astronaute $this->bus->dispatch(new InsertCommand($data)) and have the command handler insert your data, if you are doing some manipulation to the data before inserting it, do that in the command handler, only do validation in the controller.
so i need symfony messanger ?
@Astronaute yes
17:47
@cmb thx, doesn't look good :)
18:17
@IMSoP cheers
 
2 hours later…
19:59
Bummer. Anyone knew that PDO accepts list arrays for named placeholders, at least when emulation is off?
https://phpize.online/sql/mysql57/undefined/php/php8/f71f977849754865bf2709158f9b3057/
 
2 hours later…
22:05
If a constructor is allowed to return, even by ref ( 3v4l.org/JBM5k ), why are return types not allowed
also, is returning by ref from ctor supported by design, or just a side effect of constructors being parsed the same way as methods?
if the latter, why not error for them the same way as we currently error for having a return type on a ctor?
should i open an RFC to remove this? there's only 5 instances of this in GitHub, and all are invalid ( returning $this by reference doesn't do anything, and the others don't even return - github.com/… )
22:23
@SaifEddinGmati weird but true: constructors aren't just parsed the same way as methods, they are methods; they have no special status, the engine just calls one immediately after creating the object if it exists
@IMSoP they are kinda special, since they have their own place on the class entry, unlike other methods
( well, other magic methods do too )
the point I was coming to is that calling one as a normal method has all the same properties as any other method, and then and only then does the return value have any meaning at all
I'm pretty sure there was discussion of making them implicitly void - i.e. ban any return value; I can't remember what the argument against was
there's only something else special about them
they are the only method that can have a promoted property
if it's a concrete constructor
true, that does make them special in the parser
but I'd argue the & there shouldn't be a parser error, it should be a logic error
you can even yield from a constructor! 3v4l.org/pW2aa
not really, the parser allows all methods to have promoted properties, but they are checked at compile time 3v4l.org/a3tSL
^ this isn't a parser error
22:30
huh, TIL
yea, all methods, regardless abstract or concrete are parsed the same way, the checks are done at compile time
i would expect this to be a parse error, but it parses just fine: 3v4l.org/cNf0J
I wouldn't be against banning & there, but it seems a rather minor and arbitrary ban, when it would make more sense to ban return values full stop
that would mean introducing a new type of statement group, that is basically all statements - return - yield
no, just make them implicitly void, that already does all the necessary checks
apparently combining void with by-ref isn't currently banned, but is deprecated 3v4l.org/qiurr
and yield is already flagged as incompatible with void: 3v4l.org/XJ4dL
yea, i think we can just add a compile time check for by-ref like we do for types, and make them void.

https://3v4l.org/5UShO
@IMSoP that error is going to be quite confusing when : void isn't even in the code :D
22:39
true; there might be a way to force it to be more helpful; or do the check in the other order, so that it says "constructor return type must be void, Generator given"
no fundamentally new checks or special syntax rules needed, though, it's all things that are already being detected for other scenarios
meanwhile, I was curious how yield even works at run-time; I guess it gets effectively turned into return new Generator(...), and the Generator discarded
so the constructor returns at that line, but if you call it directly, you get a proper Generator 3v4l.org/Cs1dJ
22:53
there's going to be someone complaining that they somehow have a use case for this in their 2008 code base /s
@SaifEddinGmati Only after 2 years, and on internals they'll stop after 2 days, so screw them :D
23:54
@IMSoP Yeah no not always (e.g. overridden DOMNode instances)
Also there was an RFC to add a void return type to constructor but smh that didn't pass

« first day (4447 days earlier)      last day (726 days later) »