« first day (3927 days earlier)      last day (1245 days later) » 

00:00
@Fiido93 this sounds as-if you have two competing queries, so that the error actually highlights something more harsh.
That's basically what "match is" is for. is means "do a pattern match instead of an identity check". And the degenerate case of a pattern match is instanceof.
@Crell have you tried on an implementation already? I wonder only for my earlier example if it's sane to implement already, this rfc looks to go even further ...
I mean I won't stop you, it's not that.
So far the implementation that Ilija was working on doesn't touch match. And we disagree on exactly what its syntax should be. :-)
yeah, and in mind mind I would also think that syntax is the hardest part, not only for design but implementation first of all.
*mind mind = my mind
00:33
@hakre I was a tiny bit facetious.
@Tiffany Charming.
But I'm sometimes biased. Hungarian notation is often frowned upon, but from time to time I fall into it somehow.
00:53
I haven't used it before my current job. I find code to be uglier with hungarian notation, but just personal opinion.
snake_case_variables_with_no_hungarian_ftw
01:22
@MarkR also I sometimes fall into those.
and actually more often than hungarian notation.
My personal coding style requires snakey case for anything that's case sensitive, in PHP at least.
Hm, there's a web software design guide that is like a set of concentric circles, im trying to remember it's name and im drawing a blank, any ideas?
02:19
I don't know it (unfortunately). would also be interested in code-styles that adhere more to ASCII-art than standard C lang look-alikes.
    # stage 2 # :: populate with files ::

    ( ( ( ( (

      # multiple population strategies:
      #
      #  copy files to transpose early modifications into test
      #   copy HEAD tree to commit test
      #    get remote master archive to test
      #

        git ls-files -z --cached | sed -z '/\.git/d;/^run\.sh/d' | tar c -z --transform='s/^/tar-pipe-'"$(git describe --tags --always --first-parent --dirty=-dirty)"'\//' --null -T - \
         || git archive --worktree-attributes --format tar.gz --prefix "$(git describe --tags --always --first-parent)"/ HEAD \
 
7 hours later…
09:07
Would it make sense to introduce multiple return values similar to go but with optional arguments? I was thinking of immutability but also am aware that multiple return values make sense in other cases like returning error codes (there are still places and use cases where these are used)
Imagine immutable object where instead of withers you can modify object property get the value but also catch the new object reference:
class Foo { public $bar; } // assume it's immutable
$original = $foo = new Foo();
$bar, $foo = $foo->bar = 'baz';
var_dump($bar); // 'baz'
var_dump($foo === $original); // false
Or maybe it's stupid
09:47
Morngins
10:09
C++ now has const, constexpr, consteval and constinit modifiers, wtf
O.o
What do they do????
Or a better question, is why are all of these needed
 
1 hour later…
11:16
Morning
bonjour
Le chat
 
3 hours later…
14:06
I'm looking at the proc_open code, and I'm wondering, is it really a stream resource? It seems not to be
cmb
cmb
@Girgias the return value is a "process" resource
Okay, that's what I thought, so it should be possible to convert it to an opaque object without converting streams first
cmb
cmb
yes, I think so
14:43
I am confused. The manual states "Array dereferencing a scalar value which is not a string yields null. Prior to PHP 7.4.0, that did not issue an error message. As of PHP 7.4.0, this issues E_NOTICE; as of PHP 8.0.0, this issues E_WARNING.". What would be an example of that?
cmb
cmb
@Dharman see 3v4l.org/jqZ6S
No, I was talking about array derefencing
i.e. [$var] = 1
That's destructuring, not dereferencing :)
Sorry, you're right
I was confused by manual
Although...
function a(){
return 1;
}
list($baz) = a();
var_dump($baz);
this still does not produce any warnings
15:04
@Dharman The behavior of destructuring is different in this regard
explain please
Some people thought it was a good idea to write while (list($x, $y) = getNext())
Where getNext() returns null to indicate end. And they don't want a warning for that case
Maybe we should consider deprecating it in PHP 8.2 to match what the manual says
I don't think many people are still using such a confusing syntax
cmb
cmb
@Dharman that destructuring (list) should be remove from the dereferencing example
@NikiC I've read the descriptions for constinit/consteval and I'm still not clear. I expect I'll hit some super rare corner case eventually, but I totes get constexpr vs const.
constinit seems to allow a constexpr-ish expression to still have non-constexpr behavior, and return a result that is contextually valid, which is cool.
@Crell I have a problem. I think I need to vote no on pipes.
Much as I love it, I have to acknowledge that first-class callables and a userland pipe() function solve the problem.
Proper PFA would help more, but... eh....
That's honestly orthogonal
15:40
A userland pipe is still inferior to a native solution. At this point it doesn't much matter, though. It's not going to pass. I am debating bringing it back at some point in the future with a revised references approach, but I don't know.

The fact that there are like 3-4 ugly user space implementations that are incompatible with each other, and still all ugly, tells me we still need it in core.

Also, I have a still-very-vague idea of extending pipes in the future to be part of a reactive-friendly stream API. But that definitely requires some more thought.
16:11
@Sara A pipe "solves" it, but without type safety and a larger performance penalty. Not exactly an awesome state.
16:30
Hello,

I have a nicely working basic install of Laravel JetStream and Spatie's laravel-permission in Laravel 8.

I can assign a role to the user during registration via

$user->assignRole('visitor');
return $user;

(in CreateNewUser.php)

Can also restrict the available menu items on the user's dashboard through the permissions I have assigned to the role in my seeder files run method:

Permission::create(['name' => 'access profile']);
Permission::create(['name' => 'access logout']);

$visitor = Role::create(['name' => 'visitor']);
@Crell Ugly? it's 4 or 5 lines of code.
i'd be curious to see their incompatibilities, it seems like there's only 1 proper way to do them
 
4 hours later…
20:10
Am I correct in that pathinfo doesn't check if the argument is a file, it just parses the string literal into parts? (github.com/php/doc-en/issues/798) (3v4l.org/4tTB8)
Resolve, that's the word I was looking for. It doesn't try to resolve the argument to a file, it just accepts a string literal and parses it into parts.
 
1 hour later…
21:12
@Tiffany yes, I think so. However it does resolve some other file-system semantics like directory separator.
so you can not use it for windows paths on a linux system - even it does not resolve the concrete path.

« first day (3927 days earlier)      last day (1245 days later) »