« first day (4230 days earlier)      last day (722 days later) » 

Wes
4:04 AM
folks, what was called that data structure/pattern that holds two elements, one representing a success value, and the other the error? it's like a tuple of 2, but only one of the values is set, never both
i have no idea where i saw this, maybe golang?
 
In Rust it's called Result.
The C++ name is expected.
 
Wes
yes!!
expected, that's it
thank you very much
 
 
5 hours later…
8:36 AM
golang has no name for it, as allows for multiple return values, but does use that as a common pattern
 
@LeviMorrison it may be that SIG globals are freed before zend_signal_deactivate is called, so SIGG(depth) is accessing freed memory here in ZTS. What does the stack trace look like in NTS ?
 
 
4 hours later…
12:20 PM
@PeeHaa Yo! \o/
 
Hey @Tiffany remember couple weeks ago I was so excited about some news? Well..
I am super excited because I'm gonna be joining the Roave team next month! cspray.io/blog/my-next-adventure
 
Congrats
 
12:49 PM
is anywhere out there a openApi 3.0 schema generator with a ui? to click the things together?
 
You mean SwaggerUI?
 
yes, kind of.
but i can just edit the left side right?
i would like to have a generator for openapi 3.0 schema files.
 
1:39 PM
@Wes The generic name is an Either Monad.
 
Why abstract private is not allowed ?
 
cmb
@Mwthreex How would you implement that in a subclass?
 
In abstract class i put this:
abstract private function setData(string $id): void;
phpstorm says: 'Abstract modifier not allowed here'
 
@Mwthreex Because a class cannot implement a private method from its parent.
 
Ok but phpstorm was not clear about that
 
1:55 PM
/shrug, perhaps. I think they were. The IDE should provide hints and advice but what you're describing is a misunderstanding of object-oriented programming. The IDE can't, and shouldn't, be teaching that.
@MarkR Thanks! I'm sure it signifies something wrong with me but I'm actually stoked for getting into PHP again.
 
@CharlesSprayberry Modern PHP is a pretty nice language. Still missing some stuff, but it's pretty nice overall.
 
@Crell Yea, I agree. I'm actually really liking where PHP is heading. I still write a fair amount of PHP in my free time/OSS but now I'm gonna get paid to do it!
 
2:31 PM
do you think that -for security reasons-in every page I should check the type ot the incoming request: if ($_SERVER[’REQUEST_METHOD’] ! == «GET») {
header(‘HTTP/1.0 403 Forbidden’);
echo ‘Access Denied’;
exit;
}
or do the above for specific occasions...and which are these?
 
3:09 PM
Ideally your router will take care of that by matching only against the expected method.
 
@Crell I suppose you mean the hoster's router
 
No, I mean your routing component in your code.
 
can you be more specific please?
 
Most frameworks these days have some registry that maps "path foo/bar/*/baz, with mime type text/html and method GET" to a particular callable. Details and how precise they can be vary widely.
That registry is called a "router", and each of the callables that is registers are "routes".
 
yeah I got it...I do not use a framework though
 
3:15 PM
If you're just using separate discrete PHP scripts, then you're not using a routing component. The lack of this capability is why most modern systems use a routing component and a single entry point rather than discrete files. (Well, one of the many reasons.)
So in answer to your question, yes, filtering by the method is probably a good thing; doing it manually in discrete files is just a lot of wasteful manual work.
 
well...there is no way around it....wasteful or not..it must be done as you suggest
 
At least factor it out to a utility function of some sort.
 
you mean to put the above code in a Fn?
 
Yes. Something you can use in each file like: enforce_method('GET')
 
3:54 PM
'lo all.... qq.... When building an associative array... can I check the value I am assigning right when I assign it so I don't have to make it a variable first? Example. $myArray = array('FirstKey' => "'".$OtherArray['Key']."'");
If $OtherArray['Key'] doesn't exist I want to assign a blank.
I tried the Null Coalescing operator... but that didn't work
 
It should.
$arr2 = [
  'key' => $arr1['something'] ?? 'default',
];
 
@Crell Yeah I basically have that, but I am still getting an error saying undefined index... as the key doesn't exist in $arr1
 
You have the wrapping concatenation? That's probably binding higher than the ?? does. (?? has an annoyingly low priority.)
 
I am trying to assign a value from one array, to another array... but sometimes the keys exist and sometimes they dont. I sort of want to do an isset in the middle of assigning... but I dont think I can.
 
Try throwing () around the $arr['something'] ?? 'default'
 
4:04 PM
@Crell Nailed it! Sweet!
 
thumbs_up.gif
 
@ArnaudLeBlanc I haven't been able to reproduce it in NTS anymore, so I'm guessing it was pebkac somehow.
So, basically, ZTS mod_php with Apache event is broken (again, it's like broken at any given time). I was hoping to use it to test my threading model support since it's similar in architecture to what happens on Windows.
 
4:35 PM
Crell I'm reading now your post "Much ado about null". Very nice, thank you
 
It took a while to write, but the concept has been sitting in the back of my head for weeks. :-)
 
cmb
4:49 PM
@Crell The "billion dollar mistake" is not about null per se, but rather that it is compatible with any class type (i.e. class types are implicitly nullable in these languages).
 
I address that to an extent. (Specifically null pointers.)
 
cmb
ah, should have read further :)
 
5:00 PM
link?
 
"PeakD.com launched in 2020 as a version of SteemPeak.com on the HIVE blockchain centered on integrating Hive and many other blockchains. "
 
The link got corrupted by SO chat.
 
no, it worked fine. I'm copying stuff from their site.
"peakd" --- a shitter version of medium based on BS technology is how I read that.
 
Not entirely wrong.
 
5:12 PM
@CharlesSprayberry Congrats \o/ Awesome that you'll be doing more open-source PHP again.
 
@Trowski Thanks! I'm really excited about the opportunity.
 
Selfishly, I hope that means more async PHP :D
 
@Trowski I can't speak directly for Roave stuff but I know personally I'm excited to get into the v3 work I see y'all releasing. I'm hopeful that over the next few months I can start digging into that stuff.
Right now I'm really focused on my container project, I have a couple key features I need to iron out but after that I plan on shifting my focus more to async stuff.
 
    public function setDisabled($flag)
    {
        if ($flag) {
            $this->disabled = true;
        } else {
            $this->disabled = false;
        }
    }
Submitted without comment.
 
@CharlesSprayberry I still need to take a closer look at that. Something I'll probably do once I begin looking at creating a lightweight framework based on Amp v3.
 
5:26 PM
@Crell It's not wrong.
Which is a good start.
 
@Trowski github.com/cspray/annotated-container/issues/80 supporting amphp's injector is on the list. And if implementing the 2 containers I already support is any indication it should be fairly straightforward
I just have to learn the new API that kelunik came up with :P
 
@Crell Perhaps the author gets paid by LOC written. Or they were inspired by github.com/Herzult/SimplePHPEasyPlus.
 
@CharlesSprayberry I have yet to learn it myself… lol
 
@Trowski I'm also in the middle of an introductory blog post that will explain it a lot more and some ways it might bring value
 
Any framework would depend directly on the container interface (if it even needs to that is)
 
5:29 PM
@Trowski As I dig into it I may start working on documenting it properly. I'd want to coordinate with @kelunik though before I did that
 
@jmikola It's technically a viable way of doing it pre-7.0, before you could just type the parameter. But just casting the argument would have been even better.
 
@CharlesSprayberry That would be awesome if you can find the time.
 
@Crell I'd have used !! perhaps
 
@Crell I'm trying REALLY hard to justify that, maybe due to lack of scalar types, but I just can't. There is DEFINITELY better ways to do that in any version.
 
Yes, many of which are used in other methods in the same class hierarchy.
 
5:34 PM
!!!!
 
21 year old code base, baby!
 
Ah! Okay, it's forgiven then.
That was PHP 3 da.....fuuuuck, that was 4 already....
 
I think it began life on PHP 3.
(This is TYPO3.)
So... yeah, 24 year old code base.
 
Now I'm thinking of the old sessions library, and yikes
Fun fact: ext/sessions used to be userspace code
 
This codebase consists primarily of arrays with missing pieces, wrapped up into methods for convenience.
 
5:41 PM
A dark part of me wants to build fi.3v4l.org for running PHP 2 code. Maybe even a PHP 1 version, because masochism. I don't think I have the GAF for it tho.
 
class SleepTask extends AbstractTask
{
    public $sleepTime = 10;

    public function execute()
    {
        $time = 10;
        if (!empty($this->sleepTime)) {
            $time = $this->sleepTime;
        }
        sleep($time);
        return true;
    }
}
 
morns
 
6:38 PM
There is the ongoing joke about arrays start with 0 or 1. I went to reset the auto_increment setting for a table using phpMyAdmin and if you try to reset it to 0, it will not execute it, but if you reset it to 1 it will. LOL...
 
7:14 PM
 
7:33 PM
@Sara I have a fix for the PHP CLI where the fix for PHP 8.0 and 8.1 are different due to diverged code. How do I do the commit merging for such cases?
 
@LeviMorrison --strategy=ours when you merge PHP-8.0 into PHP-8.1 (and then up to master normally)
and then for the PHP-8.1 fix, do that afterwards and just merge up to master normally
 
Actually, the fix for master will be different from PHP 8.1 as well :facepalm:
 
:-)
 
But, same strategy (ha) applies there.
 
they picked that name well, for once :-)
 
Wes
8:09 PM
@Crell nice. thanks. that is probably a better name than "expected"
 
See the blog post I just posted on Friday for a deep discussion of Either/Result and its alternatives. :-)
 
8:26 PM
@LeviMorrison seen a crash on the observer api like this before? gist.github.com/beberlei/e6a686cd879bbd0717d9027b0ae12431 - this happens when tideways is active, now going for zend-test
it "goes away" when you set error_log to something for example /dev/null
 
Not that I'm aware of. Odd.
 
 
1 hour later…
9:32 PM
throw new CrellIsWrongAboutExceptionsException();
 
@LeviMorrison difficultly, but yeah basically what Derick said.
 
I should have the patches ready soon. Will run tests on all of them, since they are all a bit different, maybe I screwed something up, you know?
The code needs some cleanup on master, but I'm not going to worry about that for existing branches.
Okay, tests are running: 8569, 8570, and 8571.
 
10:25 PM
Maybe it has to be there for macro expansion hell reasons? I can't imagine this being the case but perhaps.
 
cmb
@LeviMorrison Neither should be used (due to expansion issues).
 
Eh, I've made mistakes in "", sizeof "" where the strings weren't the same. Macro expansion issues fail to compile in these cases though, fortunately.
I think it's evidence we should have a string view or slice type that is just a ptr + size pair and we should be passing those around instead.
 
 
1 hour later…
11:48 PM
@Crell I'll see your crappy methods, and raise you with this:
	public function body($value = false)
	{
		if (func_num_args())
		{
			$this->body = $value;
			return $this;
		}

		return $this->body;
	}
 
That... is a method. I will grant that.
 
@Tpojka LOL!
 

« first day (4230 days earlier)      last day (722 days later) »