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
@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
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?"
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.
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
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
@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
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
@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.
@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, 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.
@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.
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.
Since 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...
@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
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.
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.
@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.
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/
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/… )
@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
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
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