« first day (3546 days earlier)      last day (1393 days later) » 
00:00 - 21:0021:00 - 00:00

12:21 AM
ord should throw ValueError exception on empty string ・ Strings related ・ #79762
 
Wes
what's a ValueError
 
aka the thing that people are going to be quite surprised by, and make noise over how it should have been done as an RFC. Because they like errors being silently discarded probably...
 
Wes
no problem with that but i really dislike generic exception types
i mean it's like Error, just slightly less generic
 
I should write this more clearly, but I think it's okay when the error represent a programming error, rather than an unexpected external condition.
aka, any occurrence of that type of exception should be sent to a programmer to fix, rather than be monitored by an ops team to see if the rate of that error is outside of a 'normal' range.
 
Wes
12:39 AM
shouldn't that be a subtype of Exception then, aka the php equivalent of checked exceptions
 
Error are programming errors (Parse Error, Type Error), Value errors are when you pass a negative number to an argument which expects it to be positive (as an example)
 
Wes
ok so like i need to hire one programmer to fix ValueErrors, and another one to fix ArgumentCountError? @Girgias sorry for being rhetorical, it's friendly rhetorical :P
what i am saying is that if it's programmer errors you just need Error and a good error message
you don't need specialized types, because you ain't catch() any of them
 
It's useful, and has almost zero cost.
 
1:01 AM
@Wes I am very good at ValueErrors, if you're still hiring
I won't give away my trade secrets though, which is to make the negative number positive.
 
Wes
1:12 AM
@Danack it doesn't hurt, but it's slightly cringy for me :B
just had to do a emergency shutdown of my computer. hard disk started to make a lot of noise
now i don't know if it's the same disk that was already dead or another one
it's time to buy some more disks lol
any suggestions? 5200 rpm, long life ones, 2tb or more. they are for storage
oh they are super cheap now compared to a few months ago
wow
 
@Wes If you have shit programmer you may need to :p
 
Wes
1:27 AM
 
yeah but those ones are kinda dumb :(
 
Wes
i joke about that but took me a lot of time to understand how to use exceptions effectively myself
 
Those SPL exceptions caused me so much pain learning PHP
I really have no idea why they exist, much like most of SPL
 
Wes
i am fairly sure the creators did not understand why they exist either, they just tried to match java
except java is a clusterfuck on its own
 
Have you ever noticed how a solid 30 to 50% of all the conversations in here are how to unfuck PHP's past mistakes? :P
 
Wes
1:41 AM
the rationale was, as this is a general purpose library, we introduce very specific exceptions just in case the user need them
which was reasonable to do when your user is the php community at large
but it was disastrous for exceptions, as they are just names with no interface change, with just a loose explanation on the reason they exist
also probably they assumed that java's design was great, given that java was very successful
so they copied the exceptions but they managed to miss the ludicrous amount of critics java has had for the exceptions design :B
 
I just hope when we do write things to do exceptions rather than the hideous E_NOTICE / E_WARNING setup, we can get a proper hierarchy in place that will stand the test of time.
 
Wes
1:58 AM
i am trying to remember the name of the guy and his blog post about avoiding exceptions entirely
was criticized at the time, now people are catching up
golang, unions
 
I personally don't see why they should be avoided, they're a useful tool provided they're used properly.
 
Wes
the guy concluded that exceptions should be used only for programming errors (or more precisely, to demand code changes)
 
Seems like leaving 80%+ of their benefits on the table to me.
 
Wes
i can't find the post, and i can't remember the guy's name. i think he is/was a microsoft employee, he also was on SO
title of the post was "exceptions are bad" or something like that. it was quite famous
ffs
 
Know what's really bad? Not wearing a mask while doing attic work. I feel like I've inhaled an entire room full of insulation fibres.
 
Wes
2:11 AM
that stuff is nasty
 
Trying to board out some of the uncovered area for storage space, and hopefully it'll help me get to the far walls to insulate... turns out keeping computers and servers in an attic which occasionally can reach 50c+ is no bueno
 
Wes
watch out for mold
 
2:30 AM
Aye, it's pretty dry and usually pretty cold and windy up there thankfully
 
2:49 AM
Anyone able to answer my query of using an API with laravel, I can't seem to get any answers:
https://stackoverflow.com/questions/62636223/how-do-i-create-an-api-to-endpoint-returning-uuid

Over 60 people looked at it
Even some advice on how I could rewrite it to get a better response would be useful, otherwise, I'm going to have to hire a freelancer to help but I really want to learn it first hand
 
3:31 AM
@BradleyKirkland what exactly is the problem?
Your current question, as it is, is either "write code for me" or "I need a rubber duck"
(in other words, it's very broad)
It could potentially be a canonical question, but you may be waiting a long time for someone respond with that kind of answer, and you'd probably need a bounty for it.
You could also google with keywords like "message api endpoint example laravel" or some variation therein
 
3:55 AM
@Tiffany sorry I didn't see your message till now
What I am trying to do is write the code like the structure template I have but I can't seem to find out how to do it, what it needs to do is be able to determine the type of data within the API request. A bit like:
https://developer.nexmo.com/dispatch/code-snippets/send-a-viber-message-with-failover

I have done heaps of Googling but can't find anything really useful, the difficulty I'm finding is Google is only helping me create basic API (What I've already go) but what I need is for RCS
@Tiffany Can we start a room to try and talk about it, even if you're able to interpret my question and I can rewrite it a bit better hopefully then I will receive some answer
 
 
4 hours later…
Wes
7:52 AM
mornings
 
morning
 
8:06 AM
Git mergin'.
 
 
2 hours later…
10:12 AM
So...........I had been hoping to work on the function autoloading RFC as I think it's actually quite a key piece that is missing, and also having it in PHP8 would be better than aiming for 8.1 because of semver due to the internal change. However, since the end of last year, I have been in huge amounts of debilitating pain, due to an old injury to my spine (seatbelts in cars are important, yo').
Is anyone able to work on the code for it? Anthony had done a pretty comprehensive patch for PHP 7 - github.com/ircmaxell/php-src/tree/function-autoloading-7 . An updated version of the RFC text is here though I need to add some words about why just pre-loading isn't enough, to avoid people who think that preloading is enough from not understanding why it's needed.
 
Good morning!
 
imagefilledarc fails with odd arc sizes ・ GD related ・ #79763
 
10:30 AM
@Danack I assume the autoloader will be called twice when an function call is done unqualified name in namespaced code?
Or how exactly is the global fallback handled? There are no words about that in the RFC.
 
10:44 AM
@bwoebi you're right, it would need to, if nothing else to allow polyfilling functions that aren't in namespaces.
 
@Danack There's no chance at all that is going to fly
 
Because?
 
This is like, the one single point the dozen or so previous discussions on the topic have been about
The problem that needs to be solved is how to avoid the autoloader call for unqualified global function calls, in a way that still integrates reasonably into the language.
 
11:00 AM
@Danack There are a couple of models that are viable btw, but it's important to specify one, as that's the heart of the RFC :)
Btw, I recently already removed EG(autoload_func)
 
@NikiC I've missed these discussions. Are those models documented anywhere other than in people's heads?
 
@Danack externals.io/message/107967 was a recent discussion, but I don't remember which variant it proposed
There's more in previous discussions ... there's a lot of them
 
@NikiC What's the issue about unqualified global function calls? I see it as a more contentious issue whether first the global fallback (without autoloader) is checked or first the qualified name requested from the autoloader
btw. my take on it would be: check for function in current namespace. otherwise call autoloader on namespaced name (if not called yet and cache the fact that it has been already called, permanently). otherwise check for function in global namespace. otherwise call autoloader on global name.
Where would be the exact issue with that? @NikiC?
Yes, you mention bugs.php.net/bug.php?id=64346 - but I don't see that as a bug.
I think that's a feature, in particular with autoloading which has a chance to step in at the right time
I'd even go the lengths and reserve (implicitly) the global function name in the namespace at the time of the first call.
i.e. if time() has been called once in namespace Foo, there may not be any further declaration of function time() in namespace Foo.
Unless you uopz-redefine a function at run-time, the function behind a function name shall not be able to be changed once fixated.
@NikiC Or do you know of any benefit of being able to dynamically flip-flop (once!) the meaning of an unqualified name after any first call?
 
11:27 AM
Hi there! I'm trying to compile PHP 8-alpha1 on Mac, and stumble upon this error:

/Library/Developer/CommandLineTools/usr/bin/bison: invalid option -- W
Try `/Library/Developer/CommandLineTools/usr/bin/bison --help' for more information.
make: *** [/Users/brent/dev/php/php-src/Zend/zend_ini_parser.c] Error 1
I'm on bison (GNU Bison) 3.6.4
So I was wondering if anyone had some ideas what might cause this :)
 
Mac obviously ;)
 
Yes :(
Turns out /Library/Developer/CommandLineTools/usr/bin/bison is an older version of bison
And export PATH="/usr/local/opt/bison/bin:$PATH" used to work, but doesn't anymore
oh I got it :) Sorry for disrupting!
 
post your solution for the next user with this issue ;)
 
PATH="/usr/local/opt/bison/bin:$PATH" still works, I messed up :)
And the original error means I was using an outdated version of bison, I believe you need at least bison 3.0.1 ?
 
I am trying to upload an file through curl. The path to file like: "file" => "@/var/www/coc_files/2006091558.pdf" How can I also add the file type.
 
@DaveRandom We have version php 5.4
 
then you need to fix that
 
cmb
+1
 
Not that easy for now
 
not only is it not possible to do specifically what you want in 5.4, it is also outdated to the point of being potentially dangerous
 
11:45 AM
I know but it is realy large project we just went from 5.2 to 5.4
 
wow :-P
 
I need to fix it in 5.4 for now
It was there when I began
 
unfortunately I'm not aware of a way to set the content-type for a file upload in cURL in 5.4, unless you construct the multipart message yourself
it's possible, but it's a pain, you basically have to build the whole thing yourself
 
ok
 
that said, there may be some other way that I don't know about
but I don't think so
sorry :-/
 
11:47 AM
thanks for tryin at least!
 
:-)
 
@luffy Dave expresses fully potential when it comes to WordPress.
Btw, @DaveRandom remember this?
 
that sounds like such a fun game
although maybe "russian wordpress" might be a better name?
 
Hah, quite.
 
cmb
@luffy "file" => "@/var/www/coc_files/2006091558.pdf;type=mimetype"
 
11:59 AM
oh, neat
iirc there was some security issue with that, I seem to recall that was one of the motivations for adding the CURLFile class, so make sure you read the docs thoroughly before using it
(not the mime type, the whole mechanism of @/path/to/file)
 
cmb
I think that was about unvalidated/unsanitized user input for normal POST fields.
 
12:26 PM
finfo::file returns text/plain mime type when JSON contains empty arrays ・ Filesystem function related ・ #79764
 
@bwoebi What I meant is, doing a strlen() call inside a namespace must not trigger an autoloader call.
As long as that constraint is satisfied, an implementation can be viable.
This can happen either by not calling autoloader for unqualified calls at all, or by first performing the global lookup before calling the autoloader for the namespaced function.
 
@NikiC why must it not?
 
@bwoebi Nobody is going to use it if it has performance overhead even for functions that are not autoloaded
 
12:42 PM
@NikiC can't just the autoloader decide (like based on a flag) that it does not want to do anything about it?
Also, obviously, the results should be cached
 
Caching is not sufficient, performing an autoloader call for every unique function call (or worse, every unique function call per namespace) will have unacceptable performance
 
Morning. For functions, if something like strlen was used in 20 different namespaces (not entirely unreasonable) it would call the autoloader 20 different times?
 
Like, Mr. @MarkR here already complains about horrible class autoloading performance for his use-case -- imagine adding a couple thousand calls to a function autoloader on top of that ;)
 
@NikiC I meant like register_autoload() accepting a flag AUTOLOAD_IGNORE_GLOBAL_FALLBACK
 
@bwoebi Sure, just make that the default and don't allow disabling it :)
It takes just one composer package to ruin things for everyone
Basically, autoloader should only be called if not calling it would definitely result in a fatal error
 
12:52 PM
I was under the impression that a userland function call from inside the engine was one of the more expensive operations PHP had. Is that not / no longer the case?
 
@MarkR it's not really more expensive than an userland fcall from userland. But yes, userland fcalls are expensive in general.
 
@StatikStasis correct. In every possible sense.
 
Hey again, could anyone help with Bison's shift/reduce conflicts? Quite honestly, even after StackOverflow I'm still confused as to where the problem lies.
 
@moliata yes.
(i.e. show me the code and the bison output)
 
one second, I'll paste it into pastebin
 
1:01 PM
@cmb So ... what was the last state on burning imap with fire for PHP 8?
 
@bwoebi do you need the full Bison's verbose output or only the part where shift/reduce conflicts are?
the entire output is too large for pastebin
I added the output of shift/reduce conflicts as well as my changes to the parser, if you need anything else, let me know:
 
1:34 PM
@moliata after looking for a minute at it, so you're running into the semi reserved identifiers conflicts?
 
cmb
@NikiC I think I'll have to pass on that.
 
@bwoebi I guess? I'm not sure since type_expr_without_static seems to work while optional_type_without_static does not. The only difference between those is that the latter one is %empty | type_expr_without_static.
 
@cmb ok
 
@NikiC Sorry to ping you again, did you have time to give ?-> another review? github.com/php/php-src/pull/5619 I'd like to move to voting soon but I'd feel better if I got the ok from somebody else.
There's one remaining problem, using ?-> in an argument should disallow the compiler from emitting a SEND_REF instruction.
 
@moliata eek
 
1:41 PM
I don't think we can simplify the implementation without dropping short circuiting... I can create an alternative implementation without it just for comparison.
(Or more specifically, "Short circuiting for method arguments but not chained method calls")
 
@moliata does it work if you make two rules? one without the type_expr_without_static and one with - instead of having optional
 |   method_modifiers T_CONST type_expr_without_static class_const_list ';'
 |   method_modifiers T_CONST class_const_list ';'

basically
 
undefined array index gets set when passed by reference ・ Scripting Engine problem ・ #79765
 
@IluTov I'll take a look now
 
@NikiC Thank you :)
 
@moliata though I don't expect success… bison very much does not like optional terminals sharing tokens with a subsequent recursive terminal
 
1:46 PM
@NikiC As mentioned, I'm not really super happy that the compilation of every expression has to go through zend_compile_expr now (otherwise a chain won't be created or stopped) but I don't see any other way of doing it.
Because it's kind of error prone and could be forgotten easily in the future.
 
@bwoebi welp, that seemed to do something, I guess. Now there is a different yet unrelated shift/reduce conflict ("as (T_AS)" [reduce using rule 81 (namespace_name)]).
 
@moliata what should definitively work though is unrolling the loop:
    |   method_modifiers T_CONST optional_type_without_static class_const_decl ';'
    |   method_modifiers T_CONST optional_type_without_static class_const_decl ',' class_const_list ';'
 
@NikiC is there something I mistaken again, I'm not familiar with Bison much, let me know :)
 
so that bison linearly can discover up to the ; or ,
 
@IluTov I've just realized that the match expression will come very handy for my DI container ^^. Now, the the get method looks like this:

return $this->singletonEntries[$id] ?? $this->{static::$entryPoints[$id] ?? "throwNotFoundException"}($id);

Ugly as hell, but this is the most efficient code I found (Symfony also has something similar). The entryPoints array maps class names to methods to invoke (for instantiation). Now, guess how I'll use match ^^
 
1:55 PM
@moliata nah, it's a common issue
We have a couple places where we list permutations instead of using empty productions for that reason
 
@bwoebi that seemed to work, thanks.
 
@MátéKocsis I mean, you could explicitly list the dependencies if they are known but that's probably not what you're thinking of?
 
@MátéKocsis Not sure I see the relation to match there
 
@IluTov @NikiC I can do this instead:

return $this->singletonEntries[$id] ?? match ($id) {
'Psr\Container\ContainerInterface' => $this->Psr__Container__ContainerInterface(),
default: throw new NotFoundException($id);
};
So that it uses the jumptable optimization + I don't have to call methods dynamically.
Or I shouldn't expect too much gain from this change?
 
Ah, so this is a fixed list. Or a generated one?
 
2:04 PM
@NikiC Yes, sorry, I didn't tell you that it's a generated one. E.g.: github.com/kocsismate/php-di-container-benchmarks/blob/…
 
Okay, that should be fast with match
 
@MátéKocsis Ah I see. The jumptable is just a HashMap under the hood so the performance should be more or less the same there. It would get rid of the dynamic call but lead to more instructions. Probably a tiny bit faster but not sure if it's measurable.
A comparison would be cool once it's merged :)
 
Never mind polymorphism, dynamic method call in general should be fairly expensive
 
@IluTov I'll measure it as soon as it appears in the official docker image :)
 
@bwoebi it seems that I actually forgot to change type_expr_without_static to optional_type_without_static (sorry ;p) so unrolling the loop didn't actually work and resulted in the same 4 shift/reduce conflicts.
 
2:10 PM
@moliata meh, then I have no immediate idea … github.com/php/php-src/pull/5720 should help you there though
 
Also worth noting match doesn't have JIT support ATM, I'll look into that soon.
 
@bwoebi Don't think it does
It doesn't change handling of semi reserved
 
@NikiC yeah, but there is no recursion in namespace_name anymore, so bison can expand that trivially and hop over it
when building the state machine
 
Ah, possibly
By the way, I'm not sure about RFC
 
@IluTov If there was support for blocks then I could also avoid the function call itself (at least in some special case) :D
 
2:13 PM
@MátéKocsis 🤷‍♂️ I hope in half a year that will be more evident to most folks.
 
People are reasonably concerned about being able to declare class List and then not being able to use new List, without qualification. It is an inconsistency and potential gotcha
@MátéKocsis Well, you can use switch, which also uses jump table optimization ;)
Unless you care about the performance of the "not found" case
 
cmb
@moliata have you considered another syntax; maybe trailing :type like for functions, or maybe even type const MY_CONST;?
 
@NikiC Yes, I've already tried that, but perf was worse. I think the reason is that I couldn't use ?? anymore, which is much
 
@cmb making it inconsistent with prop types would be quite weird I think.
 
* faster than a separate condition. I'm talking about this part: $this->singletonEntries[$id] ?? ...
 
2:16 PM
@cmb not really since everywhere in the PHP manual as well as numerous RFCs (e. g. Attribute Amendments) the type is declared after the const keyword.
Doing otherwise, as bwoebi mentioned, would be inconsistent.
 
@MátéKocsis Time will tell, I'm not sure it'll make a huge difference but I'd be very happy to be wrong!
 
cmb
@bwoebi for me, a constant is more like a function than a property. And for consistency I would have preferred type function foobar(), but that ship has sailed. :|
 
@bwoebi I find it odd that the type_without_static/none variant causes an r/r conflict on as
apparently the state for class constants gets merged with the state for trait adaptations
But why would those get merged
 
@NikiC that makes no sense … trait_adaptations all start with T_USE
 
@bwoebi The content of the adaptation list doesn't
The use is before the trait names
 
2:28 PM
@NikiC posted on the list, will see what people think, because that was a WTF to discover
 
I rebased my changes on top of Nikita's namespaces PR and now it seems that there is one less shift/reduce conflict.
Basically, the T_NAMESPACE sr conflict is gone but the other 3 (identifier (T_STRING), array (T_ARRAY) and callable (T_CALLABLE)) still show up.
 
2:51 PM
By the way, would calling zval_update_constant (in case the zval is constant AST and the explicit type is declared) inside zend_compile_class_const_decl be too performance expensive?
 
@NikiC is it normal that array offsets don't accept leading whitespaces for numeric string offsets?
 
@Girgias yes
array offsets don't work on numeric strings, they work on integer strings
 
Okay, maybe we could align the behaviour of string offsets to those of array offsets?
But that would be a BC break... as leading whitespaces are accepts for integer offsets on strings
God I hate this
 
@moliata It's not a question of performance, constants may not be defined yet at that time
 
@NikiC zval_update_constant would be called after zend_declare_class_const_ex. Shouldn't the constant be defined afterwards?
 
2:55 PM
@moliata The constant may use other constants that are not defined yet
 
@NikiC You mentioned at one point a while back the possibility of allowing short-form for functions/methods, like we have for short-lambdas, where the function is just a returning expression. Am I correct that it should be doable just in the AST, like the function concat operator?
 
@Crell yes
 
Excellent. Adds that to his would-like-to-do list
 
@NikiC oh. Now I see what you mean, I'll try to see what I can do with my limited abilities then.
I suppose the only way to implement the type check for class constants is then to emit a type check OPcode in runtime
 
@Girgias The unholy law of flexibility... any flexibility provided for the purposes of silently fixing user-error will inevitably lead to greater loss of time handling special cases than if the flexibility was never provided in the first place.
 
3:04 PM
:(
 
For badge system if we have high number of badges, should we apply for loop while assigning badge to players?? or should we manage this from database?
 
Just consider the massive number of errors introduced by undefined variables defaulting to null when read, and all the countless errors from funky numeric juggling.
 
> Would it be possible to implement the short-circuiting by having a single stack of jmp_null opnums and then remembering (via return value) the current stack depth on entry into an expression, and popping the stack down to the remembered depth on exit?
@NikiC I don't understand that.
Oh I think I get it. I'll try it, sounds logical.
 
3:56 PM
TIL in Java you can implement an interface on enum O_o
I was wondering if a similar can be achieved with userland enum library for PHP
 
Probably. It's something that @IluTov and I have discussed for PHP enums.
@MarkR That really needs to be phrased in a catchier way, because it's so painfully true.
 
@Crell I try to mimick similar feature using MyCLabs\Enum
Just found out that I cannot do new class() extends self {}
nor self nor static
:(
 
If peeps want to contribute to establish an Exception hierarchy for the throw_on_error declare RFC: github.com/Girgias/php-rfc-throw-on-error-declare/issues/4
 
@Girgias It will be specific to each potential extension no?
 
Well yes, but that's the point of the document
Trying to establish that and how they slot in, and I don't have much of an idea how many we will need sooooooooo
 
4:09 PM
Lots... lots and lots :P
With a fair chunk of duplication too
 
You could tag one exception with multiple interfaces
But that needs to be talked about
 
Would cross extension boundaries... let's take GD for example, everything to do with image errors might derive from GdException (or generally <Ext>Exception) so everything runtime it will throw can be caught with a single catch.
 
Lot of work
I just found default interface method implementation to be usefull in implementing interface for enum :/
 
GdUnsupportedFormatException, GdBadFormatException extends GdLoadException,
 
cmb
should be GDUnsupportedFormatException etc. according to wiki.php.net/rfc/class-naming ;)
 
4:17 PM
Looking at it, we're then back to a bunch of general IO errors. I guess catch (GdException|IOException $e) would still be an OK way to do it
@cmb Well if we get namespaces... sometime, it wont even have the G[D|d] :p
 
@IluTov Someone emailed me about the function referencing thread/RFC that @Danack started, asking about partials and if they'd be a sufficient alternative. I want respond with Yes on the list (suggest partials as an alternative to Dan's proposal), but figured I should check with you first since you've done more work on it at this point.
Also, @LeviMorrison, would you be OK with me modifying the RFC to mention that partials also give us a simple function reference mechanism?
 
Sure.
 
4:32 PM
Why the curly braces are required for anonymous classes when doing new class(self::STOPPED) extends TaskState {}; (note TaskState is abstract class thus cannot be instantiated directly)?
 
I'm never clear on this... is assignment (=) technically an expression that evaluates to a value?
I thought it was but there seem to be edge cases.
 
= is an operator; $a = 42; is an expression that evaluates to a value
so that you can do $b = $a = 42;
 
So technically, an assignment as the arm of a match() or body of a short lambda should be a-OK.
 
4:50 PM
just like in "if ($a = 42) " — but should you? Probably not :-)
 
I think I'm a weirdo, cause Today I could even see ['a' => 'b' => true]; usefull for assigning the same value to two keys.
Definitely too much coffee Today I guess.
 
@beberlei In Tideways, do you try to represent the time taken by a curl_multi request as a single point, or just show the pieces? Obviously you don't have to answer ^_^
 
Does that make sense to propose slight syntax change eliminating curly braces from anonymous class syntax if there is extends?
 
@brzuchal The braces are there on the assumption that the anon class is going to have a body of some sort, even if extending. Which is the typical case.
You're essentially proposing making a class body optional in general. Which... is an interesting. concept, but then needs a ;, which gets into the exciting world of expression vs statement.
 
@Crell Yes, but doesn't make sense if you extend abstract class which is abstract only cause you dont wanna allow it's direct instantiation.
Dunno if that makes sense
 
4:57 PM
That seems rather edge casey.
 
That's correct
 
I... guess I don't see how that is better than new TaskState(self::STOPPED);
Normally you have an ABC when you want to force extending classes to "finish" the class, because it is by design incomplete.
 
@LeviMorrison we try to approximate all calls based on add and remove handle and curl_getinfo
 
@Crell in my case TaskState is abstract class which implements default methods like start|stop|pause|resume|complete(): ?TaskState { return null; } the idea was to be able to return new class($someState) extends self { public function start(): ?TaskState { return ....}}... I think I'm dumb and shouldn't do that at all, nvm
 
:-)
You're trying to emulate enums?
 
5:06 PM
Yeah, trying to extend MyCLabs\Enum to have a state machine inside of it
 
@beberlei Ha, how many people don't remove the handles/close?
 
@LeviMorrison hmmmmmmmm I'm interested but not sure I'm qualified :S
 
You're probably better off coding a custom state machine. They're not all that hard.
 
@Crell not sure, only if foo(...?) is supported. But even if, different syntax might be clearer, don't you think? Although the suggested syntax isn't very clear either.
 
Whether or not foo(...?) works will mostly come down to what you can make it do, I think. :-) In practice, though, aren't most uses of referencing a function to use it as a callable?
I want to at least throw it out there, but since the partial RFC is kind of in stealth mode right now I didn't want to out you. :-)
 
5:13 PM
partial(...) would work
 
@Crell did it by adding transition const array and some methods, maybe not super clear but works and is in one class
 
:thumbs up emoji:
 
5:31 PM
Is there a one word name for state machine method name instead of canTransitionTo or allowedDoTransitionInto ?
I try with commutable but this is a new word for me, nvm... looks weird
 
canTransitionTo is what I usually use.
 
convertible ?
Yeah, canTransitionTo is the most clean self descriptive
 
@LeviMorrison probably sone, but no reports of that so far
 
5:46 PM
@beberlei Do you know if any of them are using libraries that do this instead of directly dealing with curl_multi_exec?
 
5:59 PM
@LeviMorrison yes guzzle is using multi exec even when it only does one http call
 
PECL no longer included in published docker build ・ PECL ・ #79766
 
6:25 PM
@Derick confusing, why is docker allowed to use "official" with PHP? isnt that exactly what the php license forbids?
it has to be Official Docker images for PHP
 
/me shrugs
 
but, I don't think the docker image is maintained by people in PHP...
 
I was under the impression the PHP project didn't provide any binaries except the windows ones
 
pretty sure it doesn't...
 
So I for one am thankful someone else is handling the docker images.
Even if it's not officially official
 
6:57 PM
@Tiffany ah right, github.com/docker-library/php also says "Docker Official Image packaging for PHP "
 
Hello
 
Firewall rules on php.net appear to be blocking source port 1024 ・ Website problem ・ #79767
 
7:33 PM
@beberlei I looked into this; if it has the SYNCHRONOUS option then it does regular curl_exec.
eg $guzzle->request('GET', "...");
 
8:06 PM
GOD PHP WHY: 3v4l.org/3JjT1
why is "03" not considered an integer string and thus doesn't become an integer index
 
@Girgias Because "03" and "003" are different
(and just "3")
The only case that actually makes sense is that 3 and "3" return the same value
 
Strings offset behave differently
Which is why I'm exploring how the array offset works
 
@Girgias Well, then strings are wrong :P
 
Obviously
They use the standard numeric string behaviour
 
Actually, I mean strings can't have arbitrary keys so it doesn't really matter all that much
 
8:11 PM
As a string offset can only be an integer
 
Just think of how much easier it could be if we just removed all this utter BS completely \o/ ... you want an integer key, pass it an integer or GTFO.
 
@MarkR I'm all with you :D
 
@Girgias no one can see me snicker in a doctor's office lobby because I have a mask on
 
So much needless confusion because people CBA to type (int)
 
@Tiffany I'm confused
 
8:14 PM
waifu, trash waifu, I'm running out of ideas
 
Oh x)
I'll need to amend that anyway as I need to include it in the RFC
 
Wes
@MarkR i've realized with some people, it is an argument you cannot win, because they defended the wrong idea for so much time that they would appear weak if they changed their mind
publicly
 
@Wes Aye... that's why you just have to try and stack the votes in favour and then keep your fingers crossed. Unfortunately there will always be people who take baths in 100% freshly squeezed pure concentrated sunk cost fallacy.
We desperately need editions... I'd go so far as to say 8.1 should be entirely focused on editions (and generics :P) and everything like this number casting should get ripped out in the first edition and everyone else given notice they've got 10 years to get their houses in order.
 
8:31 PM
Huh PHP doesn't have an octal prefix
(as in 0o, like 0x for hex and 0b for binary)
 
It's usually just 0 isn't it in most languages?
Was that why you were expecting 03 to convert to integer?
 
Well yes and no, but I also just learned that JS has that prefix for octals
@MarkR yes and no, I was expecting the leading 0 to just be dropped as well
I don't usually deal with octal number tbf
@MátéKocsis as you work on error messages a lot, mind tweaking the undefined array notice to have quotes when you use a string index?
 
8:56 PM
@TheodoreBrown the vote ended or not?
 
00:00 - 21:0021:00 - 00:00

« first day (3546 days earlier)      last day (1393 days later) »