« first day (3598 days earlier)      last day (1574 days later) » 

00:27
Spent the last little bit trying to create an algorithms library that's been designed with named parameters to try to create things that are more English-like.
$numbers = filter_values(of: $input, isIncludedIf: 'is_numeric');
for_each_value(of: $numbers, do: 'var_dump');
I think it's great for small examples; wonder how tedious it might be for production?
00:46
s/isIncludedIf/includeIf/g
 
5 hours later…
06:00
morns
 
1 hour later…
07:16
reddit.com/r/netsec/comments/iee13c/… something we need to keep an eye on?
 
1 hour later…
08:18
hi; lets say I create an OOP blog / forum / tube, or anything else; is object creation (how I create objects / divide a script into objects) based on the MVC (model-view-controller)?
@brzuchal would you know?
 
1 hour later…
09:41
Hi guys
Is anybody active in the rooom?
10:02
Potential type confusion in unixtojd() parameter parsing ・ Calendar related ・ #80007
$eraser -->delete([`id`=>2],[`limit' => 1]);
Can someone tell me something about this line please
@ILoveStackoverflow ($eraser--) > delete(['id'=>2], ['limit' => 1]);
Where do you even find code like this? -.-
Is it some type of quiz? Did I just help you cheat? :D
Actually this was a question in one technical interview quiz
10:10
@ILoveStackoverflow I hate questions like that. Knowing operator precedence tells you exactly 0 about your qualifications.
10:29
hey, can you answer my question above, please
10:57
Morning
11:16
Good morning.
@MarkR From what I see they are all fixed, (except Zip because it's intended behaviour which was not documented) and it seems more to be a repo as to how he went about finding those vulnerabilities
@AndyRogers I would if I understood the question. MVC is a way to structure your code, you can certainly build a blog with OOP without following the MVC pattern.
Huh I'm surprised my educated guess as to what was making the JIT segfault on CI was actually correct lol
@Girgias Good to know, in my company there's a running gag that anybody who touches a system is the new specialist ^^ Can you help me with my JIT problem please? :D
@IluTov Don't think so lol, it was just that casts to boolean where segfaulting so I basically reverted the change which made the return value of a function from int to bool, so I didn't actually do anything on the JIT :p
11:28
@Girgias Don't down-play your abilities, I know you can do it xD
@IluTov I can have a look at it
Don't expect anything tho
@Girgias I'm just joking :) I'm one of the oldest (as in the longest employed) employees in the company and my boss just claims I know stuff that I've literally touched once 5 years ago :D
@IluTov Haha, I mean I've got a good memory for stuff I've seen/done. Always disturbed my friends when I could tell them how to get a weird Vista point in GW2 just by looking at where they are on the world map even if I'm nowhere near them xD
@AndyRogers don't ping random people, it's not cool
11:45
@Derick (and @Andrea as she participated on the Reddit thread). Re: ISO8601 DateTime constant it seems the constant is not up to spec anymore because of the mix of Basic and Extended format notation (seehttps://www.reddit.com/r/lolphp/comments/idui3p/breakingtofix_in_array_for_php8_ok_breakingtofix/g2cjz2g for context)
12:02
Yes. We're still not changing it due to BC reasons
 
1 hour later…
13:13
Was more thinking about putting it back on the deprecation list
deprecate it and then what?
13:49
@LeviMorrison Yeah, but I should say that this is pretty much a purely technical limitation, which can be lifted in the future. It's forbidden for similar reasons as positional arguments are not allowed after unpacks.
Maybe the rule should be positional, named, variadic?
14:08
@Derick Recommend using DateTimeInterface::ATOM?
@Derick Type: boolean, default value: 2 :D reddit.com/r/lolphp/comments/7pvj3j/type_boolean
14:26
hey, where can I learn about object creation when I write an OOP script (how do I divide that into objects)?
blog / forum / tube script, or anything else; OOP; so this will be objects; where can I learn about how do I divide these (any script) into objects; I dont understand it yet
I think that I have read it
I am not sure
like 8 years ago :)
I was doing websites, like seo, social media marketing, linux admin, google analytics, ads
for like 8 years
I've been learning php for like 20 months but since like over 3 years (as I had to take some breaks)
@cmb Yes. In fact I personally have branches sitting in standby waiting for the fork.
I still dont get that object creation (how do I divide into that) part; I was thinking that this is related to MVC but it is not, somebody told me
@Derick Just become corrupt, then the pay issue will sort itself out.
14:36
but I will look into this book, thanks
cmb
cmb
@Sara okay, postponed PR #5987 to 8.1 as well.
:+1:
Give it 24 days and the gates will open. :)
cmb
cmb
:)
I ended up not finishing my streams conversion because I don't want all that work to rot on the branch. But it signposted a few good ideas for when I pick it back up.
@AndyRogers just start building something. Don't worry so much about the theory, and stop thinking that you have to fully understand something before you can make something useful.
And because it's been a problem in the past, speaking as a room owner, you're not allowed to ask rambling open ended questions in here. Just go build something, and you can ask specific questions, not "what is object creation".
14:40
@Danack How is babby formed?
I know it is bothersome; I need to know how to make something before I can make it
I still need to learn, I will be doing a Symfony course
@AndyRogers no. And I think I've said this to you before. Go and talk to your doctor about your massive OCD problem.
ok, thanks a lot! again, I will look into this book as you have suggested this, so probably the info is there; thanks
It has been going on for years, and is stopping you from being able to do anything.
I have made a good progress recently
in php edu
so not that bad overall
I have narrowed it down to a good extent
14:42
@AndyRogers go and see your doctor. Until then you are not welcome here.
@AndyRogers You'll learn the most building things and looking at what other people have built. If you wanna understand how to structure code, look at how everybody else does it. Look at good Symfony/Laravel projects. There's no book that will teach you everything. You'll need to get your hands dirty and be willing to make mistakes eventually.
Jun 3 '18 at 18:49, by Danack
We've got a new rule; no-one is allowed to indulge your OCD behaviour. Everyone is going to just tell you to get and talk to your doctor about your OCD.
The initial votes on attributes looked like a slam dunk, but current returns are becoming MUCH more interesting.
@ilutov please don't break that rule, that you almost certainly weren't aware of...
I mean, still pretty slam-dunky, but takes a few more STV rounds to get there
14:47
....my brain interprets ST as sexually transmitted 90% of the time when I read that TLA.
@Danack in fairness, OCD is a diagnosis. We're not licensed to diagnose. However, the behavior is obsessive and should be treated.
googles dud
Damn. Grabbed the wrong image.
it did come up with this rather entertaining video though: youtube.com/watch?v=QVaBK0CMI9A
After all that careful searching :(
@Sara lol
14:55
@StatikStasis you've seen this? youtube.com/watch?v=EShUeudtaFg
anyone know how to print bit representation of float in PHP off top of head?
As in zend_printf specifiers? %g iirc
Oh, BIT
in userland
Uh.... ergh.... no?
@Tiffany I think I am dumber for watching that. =P
15:00
^^ The dud
@Sara I think from clay and spit, not sure though :D
15:16
Thought it had something to do with cranes.
cmb
cmb
@Danack maybe something like $float = FFI::new('double'); $float->cdata = $number; $chars = FFI::cast('char[8]', $float); may serve as a start?
15:33
@StatikStasis that's a lie, and you know it :p
@IluTov That's not what it says now: xdebug.org/docs/all_settings#overload_var_dump ;-)
@Sara Again, I'm not a tory.
Oh good, we now have one vote for $input and one for $array. Any RMs want to break the tie so I can update the PRs? :-)
I vote for $array
15:38
What are we talking about?
which is certainly voodoo.
cmb
cmb
oh, indeed, (un)pack to the rescue :)
@Derick Many of the array*() functions right now have utterly absurd param names that don't make any sense with named params. I'm trying to clean those up (because it is low hanging fruit I can actually reach). Commence naming things discussion!
right, I did a bunch for the date/time extension
which function are you talking about?
See github.com/php/php-tasks/issues/16#issuecomment-678366120 and following for minimal discussion.
15:42
Should the new string interpolation work with backticks? $result = $`echo "#{Foo::bar()}"`; For consistency I'm guessing yes.
array_diff*() uses $array1, $array2, ...$rest. Which is no good at all. cf: github.com/php/php-src/pull/6027
I'd like to make sure there is a consensus before I do any others.
array_diff is fine with $array1..., but $rest should maybe be $arrayN ?
Disagree. s/$rest/$arrayN/ I don't know about, but just trying to read the docs $array1/$array2 is not helpful. array/exclude makes much more sense from a user POV, both for docs and for named params.
cmb
cmb
shouldn't that be $minuend and $subtrahend? ;)
?
Unrelated: @Derick From the attribute syntax RFC, which I'm finally looking at in detail:

An attribute syntax with ending delimiter means that the declaration of attributes is “always” enclosed in a start and an ending symbol

Don't you mean italics instead of quotes there? Quotes implies "not really" or "sarcasm", not emphasis.
16:00
Talking about arginfo, why did this change happen?
In 7.4:
 0 category               6
 1 locales                'ro_RO.UTF-8'
 2 rest                 V 'de_DE.UTF-8'
 3 ---                    'de_DE'
 4 ---                    'de'
 5 ---                    'german'
 6 ---                    'ge'
 7 ---                    'de_DE.ISO-8859-1'
In 8.0:
 0 category               6
 1 locales              V 'ro_RO.UTF-8'
 2 ---                    'de_DE.UTF-8'
 3 ---                    'de_DE'
 4 ---                    'de'
 5 ---                    'german'
 6 ---                    'ge'
 7 ---                    'de_DE.ISO-8859-1'
sorry, got them the wrong way around - why is in PHP 8 the variadic only on "rest" and not on "locales" ?
Furthermore, should we even require interpolation to be prefixed by #? If we already have a string-wide prefix, having to prefix every interpolation could be annoying. ($"#{Foo::bar()}" vs $"{Foo::bar()}"). Question is which are more common, string interpolations or literal braces {?
... var_dump (And I guess other similar variadics) have the same problem. In PHP 8:
function var_dump(mixed $value, mixed ...$value): void {}
(that's in the stub, and that doesn't look right, as it uses "value" twice.
@NikiC Can you shed a light on this?
cmb
cmb
Variadics can be empty, but these params are required, aren't they?
double $value looks wrong, though
It's a way to express at least one value, but yeah, they probably shouldn't be named identially
16:22
Why wasn't that the case for PHP 7.4 then though?
16:38
IMO the combination of variadics and named args need more work. Some discussion that I started on the initial PR here: github.com/php/php-src/pull/5357#discussion_r474386969. (discussion started just yesterday)
You also can't use both variadics and named parameters at the call site, which I think we should permit. Roughly, the order should be all positional parameters, then all named parameters, then any variadics. I think.
So far I like named parameters; the combo of variadics and named args was the only thing I was concerned about during RFC window, and so far it's still my only complaint.
16:52
I haven't looked at the implementation itself, though, so don't know how feasible it is.
@Crell $first and $rest seems fine, though it's kind of moot at the moment because named args and variadics don't play well.
The 90% use case in these functions is not using variadics, so having sensible names for the common case still makes sense to me.
If they worked together, something like array_diff(first: $a, rest: [$b, $c]).
array/exclude, input/exclude, etc. make the most sense.
In practice, I frankly don't think variadics and named params will be used together often to begin with.
Well, they don't work together at all at the call site :)
Then they definitely won't be used often. :-)
16:57
I want them to be usable, though. Have to work out how.
That's above my pay grade at this point. I'm just focused on naming things.
@LeviMorrison In the array diff case it makes sense, because you substract from the first arg, when you merge though…
merge should just be totally variadic, no required params, I think? (Yep)
yeah you're right
[$others, $numbers] = partition_values(of: $mixed, by: 'is_numeric');
if ($debug_mode) {
    error_log("Not all values were numbers! [" . join(pieces: $others, glue: ',') . "]\n");
}
Trying to write all code with named parameters with > 1 arg is theoretically pretty nice from a comprehension point of view.
Still, most of my examples are contrived :)
Most functions and parameters were not named with the feature in mind, so few functions + named args form prose.
If so, it might be join(together: $others, separatedBy: ',') or something.
17:20
Prose doesn't really make it easier…
I expect most invocations will not need or use named named parameters.
But attributes will benefit from them greatly.
17:54
@bwoebi It does for some things.
How many people know what partition does? or join when starting out?
@LeviMorrison I know what partition does because sql, and join because other languages but yeah…
> implode() can, for historical reasons, accept its parameters in either order. For consistency with explode(), however, it is deprecated not to use the documented order of arguments.
I wonder if implode/join can even use named ags! Time to find out.
Fatal Error is not caught with Throwable ・ Compile Failure ・ #80009
If we can agree on what to do I'm OK doing the leg work, but I don't want to just flail if we're not sure what names to use. :-)
18:58
@Derick Now I have #3/#2/#5/#4/#1/#6, can you check it, please? Thanks!
@Derick Report this comment to GitHub :)
 
1 hour later…
20:11
Hey, weird question, is there a way to unload a class from memory? I've created a script to generate random classes on the fly, with random names and random properties. I'm generating about 10k at a time, but I'm running into namespace collisions. Any thoughts on how to avoid that? I don't care if they have the same name. They aren't meant to be used for anything, and this is a single script to generate data.
@TangoBravo No, there's no way to unload classes. That design sounds pretty funky, why exactly do you need to generate so many classes?
Doing some security research.
On deserialization attacks and whatnot. So they're literally just there to create samples of what serialized data can look like.
@TangoBravo just use longer names? "Random_" . bin2hex(random_bytes(256)); might not have many collisions...
Duh... yeah, that's the simple answer. Thanks!
php random.php 2>/dev/null was my final solution. Should have tried that first.. Thanks again, much appreciated!!
cmb
cmb
20:40
@LeviMorrison that comes at a price, though: 3v4l.org/ZYOuV (IOW, the docs are not up to date for PHP 8 yet)
@Derick because nobody cared to fix these bugs?
@Crell maybe start with some trivial cases first :p
21:05
Yeah, nearly all extension should be revised. I think Nikita's list in the task could highlight where to look at first.
cmb
cmb
That should be done very quick, then. I don't think that we can change parameter names after 8.0.0beta3 on a larger scale (and even now is pretty late) :(
> "bootstrap/cache/routes.php" generated by Laravel has a very big base64 string which is 800k long in our case and encounters this bug.
@Danack issue opened on imagick?
No, that was for php. My question is, why does a routes cache involve a 800kB base64 encoded string. Or rather, do I dare even consider why it would involve that? Could I bear the answer?
21:22
Unsolved mysteries of the universe
cmb
cmb
… said Jean-Luc Picard, sat down in his comfortable chair, and read "Twelfth Night, or What You Will" …
21:43
@cmb funny you say, in the middle of watching TNG :D
21:59
@cmb Hmm, I think we can (and should :D). There is no BC break if a feature is not yet released. :D :D
@cmb BTW do you know how to migrate a zend_parse_method_parameters() to fast ZPP? Or can I use them interchangeably?
cmb
cmb
@MateKocsis I wouldn't know (may just not be supported?), but I wouldn't want to convert them in the first place, because it's preferable to remove these dual APIs in the long run, IMHO.
@cmb I'm currently fixing mysqli_options()'s ZPP so that string|int is enforced in ZPP. That's the only reason of the conversion. :)
And big +1 for removing dual APIs :)

« first day (3598 days earlier)      last day (1574 days later) »