« first day (3451 days earlier)      last day (1480 days later) » 

12:08 AM
@Crell if you dig into this, could you make some notes please? I've been meaning to write up why a new sapi might be needed to cleanup some of the exciting stuff that is done in there...
e.g. any and all magic behaviour through header().
 
12:28 AM
Is there any way in PHP to make sure that an object is not instantiated?
in PHPUnit *
Long day lol
 
@Alesana make the constructor private? ....not clear what problem you want to solve tbh.
 
I want to assert that it doesn't get instantiated
Poor wording
In my tests
 
12:53 AM
I don't think there's a way built into phpunit......you normally test on output behaviour, and sometimes on mocks....but there's no way of checking some arbitary code isn't run.
 
@Danack Now, we can talk about the mixed type ^^ I've just created a preliminary implementation
 
Cool....
 
@PeeHaa yeah, that's why I haven't voted no … yet.
 
TBH I quite like the original RFC, probably I'm not sure about the void|mixed return type
this is the original one: wiki.php.net/rfc/mixed-typehint
do you have any concerns about it?
I'm going to sleep now, it's very-very late now here :/
 
yes. sleep good.
 
1:01 AM
👋
 
1:13 AM
s/Mixed means any value is returned./Mixed means that a value is returned, but it can't be described accurately in PHP's type system./
 
1:43 AM
@MarkR I use CLion with decent success. I do a compiledb project with it.
@beberlei Do you mean that you've registered the instrument and hook into all calls with a no-op?
Measuring overhead is something we need to do at some point, but I hope the overhead is small.
> dynamically registered hooks
What do you mean by that?
I'm glad you are liking it so far :)
 
 
4 hours later…
5:59 AM
@Danack All I can say is that there is specialized comparison logic for DateTime objects: github.com/sebastianbergmann/comparator/blob/master/src/…
 
 
2 hours later…
7:33 AM
General question on best pattern. I have a website that's data is specific to Australia (locations, profiles). I'm expanding this to launch in the USA and i've started by adding an additional DB field (locale) to the users and profiles then just selecting those users/profiles based on the locale code. Is this an OK way to do it? Or should it really be a totally separate entity since users in different countries will never be mixed.
 
7:47 AM
@NikiC Remember my question a while ago about what changed with constructors in interfaces in PHP 8? I figured it out: news-web.php.net/php.internals/109377
Hm, looks like I pasted the "wrong" version of the script into my email. 3v4l.org/fMCub has the version that works with dead PHP versions.
 
php_zip_glob uses gl_pathc after call to globfree ・ Zip Related ・ #79424
 
 
2 hours later…
9:30 AM
@SebastianBergmann Interesting. I don't think that change was intentional, but it doesn't look unreasonable
@MátéKocsis Wow, someone actually using Hack. How is it?
 
10:01 AM
@NikiC Like I wrote, I think the new behaviour is correct. We should just document it.
 
Function mb_str_split is not documented yet ・ Documentation problem ・ #79425
 
@NikiC What would your opinion be on an RFC deprecate/remove support for __construct() in interfaces?
 
10:42 AM
is there another good alternative to XAMPP if i want to run php on windows?
 
11:16 AM
I've posted my solution to the Multiple Choice Knapsack Problem (MCKP) that i've been asking about for a few days in case anyone is interested in giving the code a look: stackoverflow.com/a/60884027/1178523
 
ThW
@qd0r I use PHPs built-in webserver for development
 
I've been doing that more and more too, in the cases I need to reproduce Xdebug bugs. No nonsense having to setup Apache, or Nginx, or ...
 
11:37 AM
@SebastianBergmann -1 on that, it's a legitimate feature
Sometimes you do want to ensure that constructors have compatible signatures. Making it abstract is the only way to do that right now
 
12:05 PM
@qd0r I strongly recommend docker.....and also not using windows tbh..
 
 
1 hour later…
1:16 PM
Johannes's last email to PHP internals makes a good point about the operator overloading RFC in its current form, something I was concerned about but had forgotten: https://news-web.php.net/php.internals/109376

I think it is the most compelling reason to vote against the RFC even if you like the feature.
 
@Andrea I think the example is wrong. If A implements adding with integers and doesn't know about B, it should return null in which case, the B overload will be called
 
@pmmaga hopefully yeah, but someone will end up throwing an exception because it's strict and type-safe or something
 
"it should return null in which case," - the error handling is another area which we might regret the proposed solution.
Still haven't gotten round to thinking deeply about it yet.
 
yeah, I hate the null return as well. What swayed my opinion is that the door isn't really closed to someone proposing a specific Exception later down the road. Some OperandUnhandledException or something that could allow the RHS to be called and only actually throw if both sides do it. Not cheap, but it may be better for readability/clarity.
 
@pmmaga again, haven't thought this through (will try to) but my instinct is that this is where returning a tuple of [$error, $result] rather than just $result would be a lot better.
The problem with exceptions is that they take more time to write, and make the code that throws them harder to read, just due to the amount of text.
 
1:30 PM
I don't like returning null, because it seems like an arbitrary constraint on what operator overloading can do
 
aka the current proposed solution would make it easier to write shitty code that silently ate errors, than to write code than declared its errors.
 
(if we are to allow using operator overloading for arbitrary purposes, not just number-like objects, then of course there will be situations where producing NULL as the result of an operation is reasonable)
also now I realise that the thing I suggested before about registering what types you support, could be implemented more elegantly with union types
 
I am drafting my RFC for changing the default PDO error mode. Is there anything obvious / amjor you think I'm missing? gist.github.com/AllenJB/270d301e5be376fcd0f6d54e67f6d6d6
 
> The argument must not specify any argument typehints (an error is thrown otherwise), as typehints and occuring type errors would break operator evaluation (see discussion).
wait why can't we use type declarations. they are one way to avoid overloading hell
 
@AllenJB I think getting @Ocramius opinion on it, and if there are any other similar shitty things that should be cleaned up would be good before going to the list.
 
1:45 PM
.
 
@NikiC someone linked me to a github repo where work is being done on how to approach generics in PHP. Is it cool to mention that repo on internals, or would you prefer that I didn't. Context is - I'd like to suggest to Ilija that doing something similar for switch statements would be more productive than having an email thread.
 
cmb
@NikiC FWIW, behavior changed due to this "refactoring"
 
good morning
 
@Andrea Does it? Reads to me like he replied based on some preconceived notions and did not read the actual proposal
That else error should be a else return not_supported, in which case his whole argument goes right out the window
 
1:49 PM
I already have some other RFC ideas - but they'd require me to actually do some C coding. Last time I spent the best part of a week of evenings with my head in C code first, submitted a PR then never got rfc karma on my wiki account (then someone else got the jump on me so the change got implemented anyway). I thought I'd (re)start with something simpler this time. =D
 
@NikiC in the simple case, and if we can trust people to do that, yes
 
@Andrea If people write bad code they write bad code :)
You are of course aware that the proposed implementation is the same as in Python (modulo details)
 
Also, from my time helping people, I think changing the default error mode would have a fairly big positive effect and hopefully won't be too contentious.
 
I gave a better example in one of the replies to it
@NikiC yes! I don't like Python's decisions :p
 
So we know of at least one programming language that makes major use of operator overloading (the entire data science / ML space is based on that language) and seems to deal with this issue quite successfully
@Danack Sure, fine to link it. Not sure if that's worthwhile for switch expression though?
 
1:52 PM
I think I am just stubborn about creating new edge cases
 
@NikiC imo, the details of what he is proposing are crap and need a lot of work. Can point that out on list but too much messages needed for an email list.
 
@Andrea I don't think this is adding edge cases. It provides a well-defined mechanism how types with partial knowledge of each other can interact. Now, adding some kind of pseudo method overloading mechanism just for operators (as the RFC actually did originally suggest, in case you missed that), that's adding edge cases...
I do think the details require some more work, but the basic approach seems sound (to me)
@Danack Ah, I haven't looked at that proposal at all yet :) Just read something something switch expressions
Oh my god. $x switch {} what is this :(
 
it didn't cover the type coercion that happens.....which is the main thing I care about (vs fallthrough)
Stop_go_no_further.jpg
 
2:32 PM
I just learnt a hard lesson in array_unshift isn't as quick as I thought it was
2 hours trying to track down why a process was timing out, ended up narrowing it down to array_unshift... and then realised it was re-creating the array each time to re-index them all. Errr. whoops.
Less Big-O, more Big-O-s***
Glad I finally found that. Serves me right for not fully comprehending what the docs said about re-keying
 
@StatikStasis I still see it?
My bad. Wrong link @StatikStasis :)
 
2:53 PM
@Derick I think that might be a good solution, ta.
 
3:08 PM
Is there a difference between 'session end' and session expire ??
 
3:21 PM
@user123456789 what is the context of 'session end'? Is it a reference to the manual - as the answer to your question might depend on that.
 
-1
Q: Session end VS Session expire

user123456789According to Munarch's PHP and MySQL: As your application runs, PHP stores the $_SESSION array in memory. When the session ends, PHP saves the contents of the $_SESSION array in a file on the web server. Finally, PHP deletes this session data when the session expires. By default, a sess...

 
fyi - "My doubt" is not a phrase used by most native English speakers. either "my question is", or "The thing I'm unsure about is" ...
2 days ago, by Danack
@user123456789 Think of it as "read session data from storage/create new session -> do stuff -> close session data and write to storage" then separately "When session expires -> delete data"
 
At what point does PHP saves the $_SESSION array (as a file) on the web server ?
 
@user123456789 it looks like that quote is using 'end session' when the php manual uses 'close session' i.e. the current session data in memory is shutdown, and the updated data is written back to storage.
 
@Derick Good call. Thanks. I'm not seeing any way to reference the spl_ptr_llist_element for operations so might still get stung when searching for updates, but this should do for now.
 
3:27 PM
@user123456789 when either the request ends, or the session is explicitly closed through php.net/manual/en/function.session-write-close.php
 
What does 'request end' means ?
 
@user123456789 when a browser makes a request to a web server, that is the 'request'. When your scripts starts processing that is the 'request start'. When your code finishes and the response has been sent to the browser, that is the end of the request.
details skipped over...e.g. you can end a request, while still leaving the script running - php.net/manual/en/function.fastcgi-finish-request.php
 
@NikiC I think Hack was essential back then when LastPass became popular, but it's ecosystem sucks, and PHPStorm used to show errors everywhere... Ah, not even mentioning XHP... So overall, it's a really bad experience.
 
array_unique bad results ・ Arrays related ・ #79426
 
@Jeeves sure sure
 
3:37 PM
Now, that PHP matured a lot, we'll be much better with it... hopefully its performance is comparable indeed. :)
 
4:28 PM
@Danack I think I'm going to need a tour guide to dig in further... :-)
 
@Crell I try to avoid volunteering other people for work......but at the same time, joewatkins knows a lot about the sapis....and the horrors contained within.
 
If he's willing to mentor me, I will give it a go. Here I was thinking that "just" exposing the post parsing logic to user space would be an easier first start before I try to look into a function pipe operator, but... jokes on me I guess. :)
 
4:56 PM
Morning
 
 
2 hours later…
6:38 PM
If I want to add the <stdbool.h> header as we are now using C99 in php-src, in which file should I include it?
 
@Andrea i find it a benefit of the proposal that you cannot arbitrarily add operators for any types like C++ can. if you have a type B and allow opreatings with a third party type A, that is subject to the exact same rules of BC breaks when their public API changes, don't do that or guard against it
 
 
1 hour later…
8:09 PM
class A {
public function bar() : void {}
}

class B extends A {
public function bar() : int {}
}

Fatal error: Declaration of B::bar(): int must be compatible with A::bar(): void
anyone know why that's the case?
 
8:22 PM
@Danack are you on 7.4?
 
moving to it....but was checking 3v4l.org/O0qhT
 
maybe something to do with void type? does covariance work with void?
(that is to say, the lack of a type)
 
@Tiffany I don't know the reason. the type check for return values normally allows 'Covariance aka type narrowing' - but that is to conform to LSP checks (which says if your program is going to 'work' or not) rather than a strict inheritance system.
e.g. this code is flaky: 3v4l.org/WaOiP
As if you are expecting a Cat to be returned, but an Animal is returned instead, your code will break if you try to meow a non-Cat animal. (that's quite the sentence tbh).
But......i can't imagine any code that would break that when a function was called, it returned a value rather than not returning a value.
 
head is still a bit hurty, I have a response, but it hurts right now to think through it :/
I think I have caffeine withdrawals, but woke up nauseous and dehydrated... quite the combination
 
@Tiffany sounds nasty.....I find adding lemon juice to water, or other types of citrus can help with those types of headaches....
 
8:35 PM
I'll try that, thanks for the tip
 
btw there is one use-case that's currently not possible, but could be used.
interface foo1 {
    function bar(): void;
}

interface foo2 {
    function bar(): int;
}

class BarImpl implements foo1, foo2
{
    function bar(): /* what should go here. */
    {

    }
}
 
8:59 PM
@Crell Sure! Just let me know when works well for you. :)
 
 
1 hour later…
10:11 PM
I wonder if RFCs should have two votes:

1) That the RFC be accepted and included in version X.Y
2) If the RFC is rejected, that the RFC should continue to be discussed
again I am thinking about the problem of things that are rejected over details, even if in broad strokes it is acceptable
 
10:54 PM
@Andrea it’s tricky sometimes thst the deep discussion only begins when the RFC is already in voting
 
@beberlei yeah…
 
11:24 PM
I think that's something Joe intended to happen when he passed the voting changes RFC a while back
 
11:50 PM
What's a polite way of saying "Your email is so stupid it reveals how ignorant you are."
 
The contents of your previous message suggest it may be prudent for you to invest additional time in educating yourself about <x>
 
is there a way to sync apcu across servers?
 
So that was a more complicated change than anticipated ... github.com/php/php-src/pull/5317
 

« first day (3451 days earlier)      last day (1480 days later) »