« first day (3787 days earlier)      last day (1144 days later) » 

1:09 AM
> Arguments with a default value that resolves to null at runtime will no longer implicitly mark the argument type as nullable. Either an explicit nullable type, or an explicit null default value has to be used instead.
is there intention to deprecate null assignment via method parameter value in a later version? e.g. public function methodName (Type $variable = null)
trying to find the RFC that specifies this, only seeing it in the backwards incompatible changes from 8.0, but manual assignment is still supported
ahhh, it's part of constructor property promotion
 
user14716889
1:30 AM
@Danack Hi danack! Thanks for the answer yes I figured it out already while searching for other related answers yesterday :)
 
user14716889
I used unique indexes. Made my life easier instead of doing hardcode.
 
what would be the preferred technique for making a parameter optional to work with 7.3 and 8.0?
currently doing null assignment, without ?, it was suggested I include ?, which I'm not against including, but the reason I didn't include it isn't for nullability.
 
@Tiffany 7.1 introduced nullable types, so you can use ? in 7.3.
 
right, but nullability isn't what I'm after, making the parameter optional is
 
Now I'm confused. An optional parameter simply has a default value given, which isn't at all a new feature.
 
1:45 AM
@Tiffany At the moment, if it's a user type and optional then it needs to nullable as well.
 
Slowly migrating to make a class dependent on another class. Currently, the class that requires the dependency, B, accepts the dependency, A, through B's constructor, but the parameter is A $a = null, since changing it from optional would break BC in a lot of places. (Hence, slow migration :P)
so better to explicitly say ?A $a = null regardless?
 
Assuming then B makes an instance of A if it's null, but your goal is to remove that and require an instance of A?
 
currently, the constructor checks if the parameter is an instanceof A, then assigns it to a property. But eventually, yes, the goal is to remove nullability altogether and require the instance of A.
if ($a instanceof A) {
    $this->a = $a;
}
 
So $this->a is effectively nullable? Does the object later make an instance of A, or just handle it being null?
 
handle it being null
 
1:53 AM
Overall I think you're over-thinking this, as omitting the ? doesn't convey intention to remove the nullability IMO.
 
...which will also be changed, I've added many TODO comments to the class as part of my change :P
 
I think a @TODO in the docblock will do a lot more vs. whether or not you omit the ?.
 
coworker responded on PR suggesting that the type be made nullable with ?, but I disagree since my intention isn't to make the parameter nullable, but to continue with it being optional, until we can change it from being optional
and hopefully the migration would be complete before we upgrade to 8...
 
Well, it's nullable whether you use the ? or not. :-)
 
yar
 
1:56 AM
Now it's about your company's coding style.
If your company is adding ? to all nullable types, then it probably should be added while it's still nullable.
If A is an interface and you could move the handling of a null A instance to an "empty" implementation, that may make migration easier later.
$this->a = $a ?? new EmptyA; can drop the null coalescing once an instance of A is required.
 
user14716889
Hi guys I have trouble migrating myself from PHP 5 (Procedural Style) to laravel, I heard it is easy using laravel framework, problem is I am still learning PHP, Should I migrate to it? or stick with PHP 5?
 
@ERROR401 I would gain familiarity with OOP before migrating to a framework
 
user14716889
Ohhh~ I will take your advice :)
 
TL;DR of it: by jumping straight into a framework, you're more likely to encapsulate your procedural code into classes, rather than follow object-oriented principles. Just because you're using classes, doesn't mean you're using object-oriented programming.
also, learn SOLID
 
user14716889
2:14 AM
Ow wow! all details to study thank you very much @Tiffany. I am now reading the links :)
 
 
1 hour later…
3:43 AM
printf does not properly align columns when extended ascii characters like µ ・ Unknown/Other Function ・ #80806
 
 
2 hours later…
5:51 AM
Release APE format cross-platform php binary ・ *Compile Issues ・ #80807
 
 
2 hours later…
user14716889
7:52 AM
Hi I have a question regarding to the mail() function in PHP, I am confused. What I did was I send the data to the database and then I emailed the saved data from the database to myself, The problem is this, when the data is emailed it displays the "before" data and did not display the "current" data that I submitted. Is it a bug? or am I missing something in my code? :/
 
user14716889
It's my first time doing this hehe
 
9:34 AM
@ERROR401 Without seeing your code (or a minimal version of it that reproduces the issue) it's impossible to say for sure, but that sounds like an issue with your code - not a bug in PHP.
 
9:57 AM
morns
 
10:45 AM
PDO returns ZEROFILL integers without leading zeros ・ PDO MySQL ・ #80808
 
 
1 hour later…
12:12 PM
Good morning, does anyone know of documentation on how to use PHPUnit 9+ Code Coverage programmatically? I have a Code Coverage Service Provider for Laravel Dusk (Browser UX) Tests simply by creating a \SebastianBergmann\CodeCoverage\CodeCoverage instance, storing and later merging the generated coverage info.
It was working with PHPUnit 8, but it needs a driver and filter argument now and I can't find any documentation about it (like.. the first 3 Google Pages are Tutorials from 2012 up to 2017.. yay).
 
12:26 PM
Happy weekend all!
 
nvm.. obviously I was searching at the wrong place.. github.com/sebastianbergmann/php-code-coverage even has a basic example..
 
12:46 PM
@PeeHaa :D are we ever going to do Among Us again?
 
I sure hope so :(
Time management is a bit of an issue lately
 
Or we could do league again, I haven't played that in awhile 😬
 
All the same
The last few weeks has been: long days at work, quick hour of zelda and bed (besides the vacation without any decent internet) :D
 
Eep
 
1:06 PM
I got myself hyrule warriors, lot different than zelda, but also awesome
Like diablo and zelda combined maybe ;)
 
I have yet to find anything as infuriating as HELM for managing kubernetes. Whitespace-aware plain text templating that's incapable of printing out a proper debug message
 
@beberlei check out Hades on Switch
@MarkR yaml?
 
Yaml + Golang Templates, a worse combination there never was
 
😬
 
I'm about | | yay far from converting all my templates into sodding JSON in PHP
 
1:12 PM
@Tiffany i dont atively seek out hacknslay, its not my fav genre
Saw the videos but wasnt convinced its fun for me
 
Maybe Transistor then @beberlei? (heven't played it yet, but its from the same studio as Hades but it's quite different IIRC)
 
@beberlei I saw that too. But we got the witcher now for the next upcoming game which should probably keep us busy for a while
 
@beberlei ah. I really enjoy hack and slash, and that game dev is known for making great games, but the combat system in Bastion was clunky for me. Hades vastly improved it.
The story, character development, music and using the roguelike concept to advance the story is pretty awesome
@Girgias still need to play through Transistor...
 
Same same :p
 
Bravely Default 2 came out yesterday, sooooo psyched for that
 
1:18 PM
Still haven't finished FE:3H so
 
:P do you want Bravely Default 2, by chance?
 
Helm: Error on line 7
Me: Adds a bunch of empty lines at the top
Helm: Error on line 7
Me: ....
 
@MarkR make sure you're editing the right file on the right server?
 
Yes, I'm not you :P
 
@Tiffany Actually no :p Don't really know what it's about and I've too many things in my Steam library
 
1:21 PM
@Girgias it's a JRPG from Square Enix, sequel to Bravely Default on 3DS. Similar to FF style games but gameplay has a twist
 
My steam library is like my bucket list, it's where things I once wanted to do go to die.
 
Right, might try it in, checks agenda, 5 years :p
 
I was going to suggest I could gift it to you, assuming I can figure out a way around regions ¯\_(ツ)_/¯
 
Nah it's fine :p
Can someone have a look at github.com/Girgias/float-int-warning before I convert it to DokuWiki and post it on the list?
 
1:39 PM
@MarkR 🙄
 
It looks alright for weak mode.
 
1:55 PM
@Girgias can you add "this targets weak mode only", if that's appropriate, near the start.
 
@Danack I mean, it also targets operators which are affected in both weak and strict typing mode
 
> Strict Type behaviour is unaffected.
then that is confusing.
 
Well yes because strict type behaviour is just about argument values to functions and affecting values to typed properties
And float -> int conversions in those cases already throw a TypeError in strict_type
 
admittedly, I am still processing coffee, but I find it kind of hard to grok. Maybe move the section "Backward Incompatible Changes" to be next to proposal, and change it to "Details of changes", with a before and after for each...
 
Right, seems like a good idea
 
2:03 PM
btw, I'm guessing the modulo operator will be the one that causes most suprises to people...
 
Could be indeed
 
user4717133
2:32 PM
hello good day for all
 
6:02 PM
Btw can people review/merge my PRs on php/karma? github.com/php/karma/pulls :D
 
@Girgias don't know, there has been normal usages of non-release branches on php-src
but maybe we can prefix them
 
> $weKnowWhatWeAreDoing
lol
 
like dev/somebranch
then you definitely don't do it un-intentionally
 
@bwoebi Right, I mean a prefix could make sense in that case, mind commenting on it to leave a trace so that I can amend it?
@Tiffany I'm in the camp of $weDontKnowWhatWeAreDoing
 
me as well :P
 
6:10 PM
@NikiC did you publish you Edition RFC somewhere? I can't seem to find it anymore
 
Thanks need it for reference :)
 
as far as I know, it was never refined into an actual RFC
 
6:38 PM
Right
Anyway... more draft for my whack RFC for extending @ to suppress exceptions: github.com/Girgias/error-control-operator-exceptions-rfc
Feels rather short :|
 
7:18 PM
@Girgias my take on this, support "multiple" return values gostyle as in one real return value, and one error/warning etc one. i.e. $fh, $err = fopen("foo.txt", "r"); in that case errors don't get displayed or logged, since they are "handled". same could work for exteptions?
 
I imagine it could, no clue how I'd save the warnings tho, and it would still imply people to rewrite code
 
yes your RFC would also be needed and then we could switch errors/warnings to exceptions, but people could still write error handling without exceptions for these functions (which personally i think is better for low level code)
 
I'll put the idea on my notebook
But yeah trying to figure stuff on how to perform such a migration is a PITA :(
 
7:35 PM
yeah, it requires a bunch of things
and a lot of discussion :D
 
8:10 PM
array spread and destructions assignment are not in the documentaio ・ Documentation problem ・ #80809
 
 
2 hours later…
10:03 PM
Problem to create account (register) on Wiki ・ Website problem ・ #80810
 

« first day (3787 days earlier)      last day (1144 days later) »