« first day (4124 days earlier)      last day (817 days later) » 

12:33 AM
@IluTov thanks, yes I was asking for server only
 
Rocky is the open-source successor to CentOS
 
 
5 hours later…
JRL
5:17 AM
i can't believe that there isn't an ext-math
that the name isn't taken
 
6:08 AM
Going to stick your flag in it?
 
JRL
possibly
i think i can bring rounding to core as an RFC
maybe some of the combinotronics stuff
and maybe a native tuple
but that's probably it
the rest of it i simply don't want to have to listen to the opinions of people who don't know what they're talking about on
on language design lots of expertise, but i can't get into a situation where bits and pieces get picked apart. math is math, can't decide you only want parts of it, there's so much inter-dependence
but providing a full rounding mode library is something i could do in core
 
@JRL combinatorics?
 
JRL
yeah, permutation stuff
ah, misspelled it
combinatronics
 
You've one extra n, and the r is in the wrong place :P
 
JRL
lol
you are correct
i promise im better at math than spelling :P
 
6:18 AM
XD though, honestly, combinatronics sounds pretty cool
 
6:45 AM
I'm sorry, but all I can think of is knowyourmeme.com/memes/math-is-math
 
JRL
lol, that's a mood
 
I bought skyrim anniversary edition at some point last night... and now it's 7am
 
 
5 hours later…
11:55 AM
Hey guys, I am trying to do a function which creates profile unique slugs using the users names, but the select I am using sometimes bring me duplicates entries =/ could someone help me?
 
 
1 hour later…
12:55 PM
@Sophie You basically have three options: 1. Disallow duplicate titles/slugs, 2. Use slugs only for SEO purposes but keep an ID in the URL (like https://stackoverflow.com/questions/{id}/{title}), 3. disambiguate by adding some additional identifier to the slug (like title-{counter} or title-{hash(id)}).
 
Hey
could you take a look in my question?
0
Q: Unique Profile Slug with PHP and PDO

SophieI am using a class to generate a string name profile to slug and next use an SQL command to tell me whats the unique value to use in insert command, the problem is the command isn't working properly, sometimes it is possible to return a value which already exist... Thats the class I am using to g...

 
@Sophie If you're looking for a single entry you shouldn't use slug_perfil LIKE %slug%. %foo% means any value containing foo, you're probably just looking for slug_perfil = :slug
 
the slugs column are unique in DB, but I need to create a mysql command to verify if there is a value quals in db
my command fails sometimes, and says to me to insert a existing value
I need to improve the select command
the command use %slug% because he counts all the values to add a number in the end
john-doe
john-doe-1
john-doe-2
I am breaking my mind with this.. all the others functions in my register system depends this user slug... =/ creating a folder with their slug, insert the pictures of avatar, ....
 
1:13 PM
@Crell Maybe you would like to bring up the additional arguments passed to a function behaviour in the error promotion discussion? Or rather removing the error for them, but if you didn't want to wait for 9.0 id get it
 
In theory it is easy, just search for the slug and add a number in the end if it already exists, but it's not working as it should haha
 
Your slug column should have a UNIQUE index on it, that way you can insert whatever you like and if you do try to add the same one twice, you can retry the query with a new one
Or let AUTO INCREMENT handle it
 
the column alterady have an unique index
already
 
1:32 PM
You may also wish to consider deletions, imagine having bob-ross-1, bob-ross-2 and then you delete bob-ross-1. Using count() means it will next try to create bob-ross-2 because it's count + 1, and you'll get a duplicate key error
 
using this cenario I generated the duplicated
well, I really dont know how make it works... and the content in internet about this its really poor
the most of content is about laravel plugin, but I need to do it directly with php and mysql
 
@Sophie If you're using a newer mysql vendor you could try something like this. db-fiddle.com/f/gN8VyUfj1ky2Vr9BMDfe9n/1 Maybe there's a way to get rid of the regex duplication. If you want to support unsuffixed slugs you'll need to cover that too.
And of course make sure to escape the user provided part of the regex properly.
 
hm, the problem is I need to create an php function with tells me the available slug before I do the insert, because I need to create a directory with the slug name
I am using MySQL 8
 
Why do you need to know before the insert?
 
@Sophie That's the point of the query, to know the next free index.
 
1:44 PM
I am running another function with cropp the uploaded image and save
 
That is to say, can you not do the insert first, get the auto increment ID, and then save the file to that after?
 
@IluTov I think I have understood your command now
It shows me the next number to make the insert, did you inserted the "foo-bar-1" value was just for show it doesn't make difference?
@MarkR yea it is possible
 
I would recommend that path. It solves a lot of problems. As would generating something like a UUID to use as your file storage.
 
I think the @ilu
commands can solve
just need to do some tests here
@IluTov Could you help me to write this with a prepared statment?
 
@Sophie Nope, that's all I can do for now, sorry.
 
1:54 PM
Its the first time I use the REGEX inside the query
 
2:13 PM
right, thx anyway
 
2:40 PM
dam didn't worked
 
 
3 hours later…
cmb
5:15 PM
@JRL while there technically isn't, the name is occupied by the PHP manual: php.net/math
 
5:34 PM
@Dharman I don't understand you email reply to Nikita on the list
 
6:17 PM
I'm trying to work out if Nikita's comments imply that to fully remove the complexity of added the VM by the userland error handler interrupting operations, if the error reporting system needs to be removed in its entirety.
 
6:56 PM
@MarkR No, that's not what he means
The issue with engine level diagnostics is that you need to guard the VM for when they happen
So that you bail out ASAP, which adds a bunch of checks
I needed to add some for the float to int deprecations
For example:
		zend_error(E_WARNING, "foreach() argument must be of type array|object, %s given", zend_zval_type_name(array));
		if (UNEXPECTED(EG(exception))) {
			UNDEF_RESULT();
			HANDLE_EXCEPTION();
		}
 
@Girgias it seems like the most viable use of undefined variables is when when you do++$array[$keymaynotexist] right? For all other cases you can simply define a default value.
 
I mean the rest is already a Warning
Which is probably why you email is so confusing
 
So for all other cases an exception would be suitable.
 
But I wonder if introducing syntax $array?[$keymaynotexist] might make sense
We already have it for object props with ?->
 
That would work too
 
7:10 PM
Man that reddit thread is so useless
People asking for new features instead of actually answering the question
But why am I even having any hope in the first place
 
I held a glimmer of hope, and that was my error
It looks like about 60 warnings and 75 notices in Zend/
 
A bunch of warnings should be type errors (like the one I just posted)
 
@MarkR Not sure how extensive your list is, but adding such type errors would meet little resistance I think.
 
@Trowski I've only got two on it at the moment, both primarily justified by better safe and sane behaviour. But I'd be more than happy for people to contribute others, then maybe a month or two from now we can look at how we need to create / divide up RFCs to accomplish it.
 
7:33 PM
Honestly the foreach ones with type errors and reading undefined props should be pretty uncontroversial
 
There are some in here I'm unsure of, for example the warnings issued by the compiler with regards to break behaviour. It seems like those would need continue forbidding.

Everything in zend closures looks reasonable to promote with a combination of errors / TypeErrors / ValueErrors.
I'm wondering what would happen if something like reading an undefined property was combined with null coalesce. e.g. $foo->missing ?? null would that now throw
 
I think ?? is treated as syntactic sugar.
 
it should be named "isset coalesce" :p
 
7:49 PM
ah yeah the implicit isset, I forgot about that, good call.
 
 
1 hour later…
JRL
8:50 PM
@cmb true, though i wasn't really planning on the documentation making it onto php.net
i suppose it's something that i should consider as a long term possibility though
 
JRL
9:41 PM
out of curiosity, what sort of cost would adding a new zval type entail? it would add at least a few bytes to every allocated zval, right?
it's not something i am looking at doing, but i am curious
 
I don't imagine so as long as it fits within the existing union
 
@JRL The cost is handling the new type everywhere :)
 
JRL
hmmm. i don't really understand the structure of the zval union.
ah, all the Z_TYPE_P checks and things of that nature?
 
@JRL yes
 
@JRL One of the reasons enums are objects was to avoid exactly that.
 
9:45 PM
If you do find out how much it'll take, let me know, I want to make undefined a proper type that can be initialized =)
 
JRL
but there isn't an inherent performance cost in simply having an additional type in the union? that's... really neat actually
i suppose that havign both unions and intersections now means that there's much less case for additional scalar types
 
@MarkR Undefined already is a zval type. But I really don't know why we'd want another null-ish type in the language. That's a huge pain-point in JavaScript.
 
@IluTov Uff yeah, we absolutely do not want that
 
JRL
with both unions and intersections, it probably makes more sense in most cases to add a new class than to add a new type
 
And we already kind of treat false as a null-ish type, so 3 really.
 
9:47 PM
@JRL Yeah, no inherent cost. Concerns about new types are always in terms of implementation and language complexity
 
@IluTov I keep on running into situations where I want to represent something like JSON, where data is missing. Null often has specific meaning in those cases too. If I used something like false, then that'd make a mess of if it were trying to map a boolean.
 
you're doing it wrong™
3
 
JRL
@MarkR i really wish null was a lot less kind in PHP
it really is frustrating to run into places where null is used as part of a control structure
 
Dumb thought I had, but [{ }] could be a possible syntax for sets (or lists, or whatever)
 
JRL
because often you don't want to just know that its null, you want to know if its null and the program state is A or B
 
9:50 PM
Except if I missed something, but I don't think braces can occur within array brackets
 
JRL
so null doesn't usually actually reduce code complexity, because oyu still need to check program state
 
A value to indicate the absence of something, cannot itself be a valid value for that something.
 
JRL
so whatever the null represents should be part of that state
right, that's totally true @MarkR and null has a purpose, i just see it misused so much
in part because the PHP standard library uses null that way
so devs have been trained to do that
 
@MarkR Wait until you need to use "undefined" as a valid value ;)
 
@JRL arguably false has been more misused than null :(
 
9:52 PM
If I could initialize them all with a singleton object I would, but I can't. At least not without a bunch of boilerplate (although <3 new in initializers)
 
JRL
that was what really got me abotu the nullable intersection types discussion. intersections can only be used with class types, so in that particular case people should just use nullable classes
the object should contain the state information that the null represents
 
shivers in PTSD
 
@JRL Was just going to make that point. Cases were null is a valid value for something probably means a NullObject should be used instead, and null can be treated like undefined.
 
That would be a heck of a lot easier if it was Nullable<X>
 
JRL
another brave hero dies at the base of Mt. Generics
 
9:57 PM
@MarkR that's basically Option<T>, right?
 
One does not simply use Typescript without wanting almost everything in PHP to support generics :P
 
i mean, you refereed to it using generics :p
 
@MarkR Very much this. Psalm's generic support is awesome, but usually feels like a tease for what I really want.
 
but i, for one, have never used typescript enough to actually know about it's type system, mostly familiar with generics from Hack, Java, and C#
 
It's very, very nice. Incredibly powerful.
 
JRL
10:01 PM
@Girgias were you the person who messaged that at some point you might be interested in helping with a mathematics extension?
i know someone did and i showed them ball numbers
 
@JRL That's me
 
JRL
i thought so
i'll be slowly compiling my design work and research work on this repo: github.com/JordanRL/ext-math
 
I saw you creating it
I'm however barely coping with uni
 
JRL
im not working on it for months im sure
 
Especially this stupid theorem prover course .-.
 
JRL
10:06 PM
going back to my zval question, i vaguely think that having a tuple structure as part of zval might actually be useful
sort of a write-once array or list structure is really all that would be needed
but it could be very useful if it had slightly more powerful type awareness than other situations
i think it would be much easier to make just tuples work like generics (could be completely wrong about that), but i'm not sure i would want to, since then people would start using it where tuples aren't the right structure just to get generics
 
Hello everyone

Passing a non valid date to createFromFormat weirdly works, is this expected behaviour?

https://3v4l.org/secg9
 
JRL
the 20th month of the year 123 is the 8th month of year 124 i think is how it interpreted that
 
Hmm, thanks @JRL for the answer, any idea if this is the expected behavior?
 
JRL
@Spoody i believe so
0123 is absolutely a valid year
and the +1 month rolling the year over is also documented behavior
 
No I mean the month, shouldn't it validate that the month is between 01 and 12?
I see
 
JRL
10:13 PM
it's a little strange in the createFromFormat case yeah
i agree it's unexpected from a dev perspective
but it's not really surprising to me knowing how the feature works in general
 
It is used in Symfony's validator that's why it surprised me as it is used to validate the user's input
 
 
1 hour later…
11:38 PM
twitter.com/freezydorito/status/1487484249477464065 UK government site is getting meta
 

« first day (4124 days earlier)      last day (817 days later) »