« first day (3450 days earlier)      last day (1481 days later) » 

12:13 AM
Overall I feel that the compromise of allowing writes outside of the constructor just to accommodate lazy-loading is a mistake. If people really want to circumvent write-once to allow lazy loading, then the "abuses" that the property accessors would allow would actually prove useful ;)
8.0 could also be a good time to disallow explicit calls to __construct.. hmm..
 
But why?
 
what's a legitimate use case of doing it?
 
Well parent::__construct for one.
 
Hmm.. right.. So say they could only be called statically
 
Ohhhhh. I get what you mean now.
Yeah would probably make sense.
Probably wouldn't be too big a deal, add a flag to zend_object and check it during zend_std_get_method if method_name is __construct
 
12:33 AM
Was thinking about that, but it wouldn't prevent the double parent::__construct that they give as an example in that RFC
It's a slightly different problem though, and I'm not even sure if it would really be that bad to call the parent constructor twice
 
@Danack thank you for your reply. I ended posting a question for it, please take a look here if you can:
https://stackoverflow.com/questions/60878092/database-structure-for-categories-one-main-and-then-secondary-ones-no-sub-cate
 
1:05 AM
Is there a nighttime equivalent to English breakfast, other than the non-caffeinated version? A tea that I can add milk and will help me become sleepy.
 
1:20 AM
Yorkshire Gold works for everything.
Because it's just that good
 
Here's my minimal script, patterned after something I found in CakePHP (it makes more sense in CakePHP but I stripped out everything that doesn't seem to matter, such as accepting parameters and return things):
<?php
dd_trace('ShellDispatcher', 'dispatch', function () {
    return dd_trace_forward_call();
});
class ShellDispatcher
{
    // if I add a constructor I get a leak, but no segfault
    // public function __construct() {}
    public function dispatch() {}
}
function run() {
    $dispatcher = new ShellDispatcher();
    $dispatcher->dispatch($dispatcher->dispatch());
}
run();
Debugging this kind of thing is always hard, but on PHP 5.4? Yeah, this is fun.
Can't call the contents of run directly -- that's fine.
 
@Tiffany hot chocolate...
 
@MarkR isn't that caffeinated? trying out twining's "sleepytime" tea with sugar and milk and it's not bad
@Danack can't boil milk in my kettle :(
 
Well, not more than once.
 
Microwaves.
 
1:34 AM
I don't like using my microwave with milk, my microwave sucks and needs replacing
 
 
7 hours later…
8:43 AM
self:: does not refer to the same class name ・ Scripting Engine problem ・ #79419
 
9:21 AM
Happy Friday, roomies. :-)
 
@LeviMorrison That's the poison value if something has been freed
 
9:51 AM
oh no, the operator overloading RFC might pass :p
 
@Andrea why did you vote no? just curious
I somehow thought you would like operator overloading
 
cmb
10:21 AM
Seems github.com/php/doc-en is no longer synced (for a week)
 
Morning guys
can someone point me in the right direction with what is going wrong? Could it be possible that this is a misconfig on the server or am I doing something wrong? pastebin.com/baJgNwwG when trying in 3v4 it succeeds with flying colors
could this be an htaccess problem?
 
10:36 AM
@Naruto if $_GET is mangled, checkout httpd.apache.org/docs/2.4/rewrite/flags.html#flag_ne
 
any idea how can I make this restAPI parameters in PHP syntax?
{
    "patternCode": "545",
    "inputData" :     [
        {
            "smstext": "asdadas"
        }
    ]
}
Actually I stuck on inputData
and this doesn't work: json_encode(["patternCode" => "545", "inputData"=>['smstext'=>'asdadas']])
 
@Shafizadeh because inputData is an array of objects, and you specify a single object
 
Yes, I also tried this but not valid syntax in PHP:
"inputData"=>[{'smstext'=>'asdadas'}]
 
just use [['smstext'=>'asdf']]
 
w8
Oh great .. thank you
 
10:42 AM
np m8 (to keep the sms vibe alive)
 
not sure what you mean by "vibe", but thanks again anyway :-)
 
 
1 hour later…
12:11 PM
@cmb AFAIK only Andreas can help with that
 
cmb
ta! @heiglandreas, it seems that github.com/php/doc-en hasn't been synced for a week. Could you please have a look?
 
12:47 PM
How do I submit this to the Internals group? github.com/php/php-langspec/issues/245 I am a little bit lost on where to send the email
 
12:58 PM
@Sjon that did not do the trick for me
I used the B tag for the htaccess and that changes alot aswel, altought it fails the following: space -> + -> +
 
cmb
@Dharman you can send mail to internals@ (see php.net/mailing-lists.php#internals)
 
1:18 PM
@Dharman but probably be prepared to answer "why don't you do this in userland as a PHP library".
 
1:35 PM
"Native implementation would benefit from: Inheritance, Method chaining, Error reporting as exception" those are not going to be universally agreed.
 
cmb
1:48 PM
I think that we want to change CURL resources to objects anyway. Adding some OO API on top might make sense.
 
I have a strong suspicion that the things most people say are good about OO are wrong, and that IDE autocomplete is the main benefit...
and those three things listed really aren't that great for what curl does. probably.
aka ocramius would mark that class final.
 
The older I get, the more I think OOP is best understood as an alternate syntax for functional programming and closures.
 
@Crell are you me?
 
No, but you may be me.
 
2:03 PM
Why would it not be a good idea to extend curl class?
 
not just closures though....also can represent "separate programs" that can be invoked by a higher level
 
@cmb On my way....
 
@cmb 5 days ago alcaeus made his first commit to the docs. He wasn't the authors file and therefore the conversion broke.... :-(
 
@LeviMorrison do you have a small demo usage of the instrumentation api somewhere?
 
2:15 PM
Now everything's back to normal. For an unknown reason the conversion doesn't use the authors-application to fix that automatically...
 
@Danack I did not find that article helpful or interesting, but thanks. I don't see how one would consider composition and inheritance to be substitutes of each other. Clearly they have different use cases and are completely different mechanisms.
 
@Dharman it might be one of those things that can't be taught, and can only be learned from practice. This wiki article might be more helpful - en.wikipedia.org/wiki/Composition_over_inheritance but also might not.
"Clearly they have different use cases" - yes....one of them has valid use-cases...
 
If it would be the case that inheritance is never useful then we would not be using it at all.
Next time I will come to this room I will laern that programming is not recommended and should be avoided at all cost.
 
2:40 PM
One of the biggest benefits of @NikiC's "delegated object" RFC is that it makes composition cheaper and easier, which in turn makes the incentive balance tip further toward composition rather than inheritance.
@Dharman Inheritance is highly controvercial, in part because its use cases are poorly explained. X is a special case of B is a valid use case, but a much narrower one than people think.

Plus, class inheritance complects two different things: Identity inheritance and code sharing. cf: https://www.garfieldtech.com/blog/beyond-abstract
And yeah, writing code is terrible. Avoid it if you can. Use code that already exists. :-)
 
Jun 17 '19 at 13:50, by NikiC
@Danack I can confirm that computers were a mistake
Or do it without code if you can. Which is a small part of systemantics amazon.co.uk/Systems-Bible-Beginners-Guide-Large/dp/0961825170/…
 
"That doesn't mean class inheritance in general should never be used. "Is a special case of" is still a valid relationship, and does exist. When divorced from "I just want to not have to type this over and over again", though, its use cases shrink considerably. Similarly, interfaces can inherit from each other; that's fine too. It's not inheritance that is a problem; it's using inheritance as a poor-man's code reuse, which is not what it is for."
 
3:02 PM
I think the point I was trying to make was, just saying it can have those things, is not going to be universally guaranteed to be agreed with. In particular, having it be OO and so be inheritable makes it slightly harder to maintain, as now all of the functions that are related to curl are part of a type system which is slightly harder to maintain than a set of functions, as any chance to the class (including adding methods) is a BC break.
Adding a new function that takes a curl handle as one of the parameters is much less of a BC break, and so easier to maintain.
So maybe demonstrating an example of how it would be better, might need to be thought about and included in any RFC to get it done.
 
3:15 PM
@StatikStasis Thanks! cc @cmb
Mornings 11
 
@beberlei Yes! Sammy's observer extension: github.com/SammyK/observer/blob/master/observer.c
@NikiC My this pointer has been freed. Oh dear. Not that the rest of our code is the paragon of code beauty, but this particular bit is very gnarly. It intercepts the original, calls a closure in place of the original, and from the closure it calls the original. Yeah, lots of places to get this wrong. This is why try very hard not to do this in our new APIs...
 
I am hoping we see a lot more functions-closed-with-short-lambdas style code from 7.4 onward.
 
cmb
@heiglandreas thanks a lot!
 
Especially for a lot of these functions like curl that have stupidly fugly signatures to support a bajillion things, being able to effectively dependency inject a function call is kind of a big deal.
 
cmb
@Danack I haven't really thought about these details. My main point is actually autocomplete/structure (and not having to read curl_*($curl)). And e.g. curl_copy_handle() could be replaced by clone. Anyhow, I'd leave the bikeshedding for the RFC process. :)
 
3:25 PM
But the colour is important..... - actually not joking, the thing that needs most improvement (imho) is to wrap setopt with specific functions for each of them, so that the parameter info isn't 10 pages long
 
Oh god do I hate needing to update the translation of that page
such a pain
 
cmb
@Danack that will resolve itself; just wait a few months, and there are 11 pages ;)
 
$dateTime1 = \DateTimeImmutable::createFromFormat('Y-m-d', '2002-10-02');
if ($dateTime1 instanceof \DateTimeImmutable) {
    $dateTime1 = $dateTime1->setTime(0, 0, 0, 0);
}

$dateTime2 = \DateTime::createFromFormat('Y-m-d', '2002-10-02')->setTime(0, 0, 0, 0);

$this->assertEquals($dateTime1, $dateTime2);

Failed asserting that two DateTime objects are equal.
--- Expected
+++ Actual
@@ @@
-2002-10-02T00:00:00.000001+0000
+2002-10-02T00:00:00.000000+0000
Anyone want to play spot the glaring error?
 
ms difference
 
test failed twice in a row.....when it's not failed for many runs before.
but I'm setting the 4th param of setTime for both, right?
 
3:35 PM
You sure do :)
 
@LeviMorrison do you have a reocmmendation for a pattern to keep state between begin and end?
 
@beberlei For now, I recommend using C++ and using a deque as a memory store ahahaha
I'd like to touch up that part if I can manage it.
 
@LeviMorrison did you just tell me to go f*** myself? :p
 
I think we should postpose PHP 8 a bit, honestly. There has been a tremendous surge in activity and interest in it.
If we can keep that momentum going that would be great, and of course it would give me more time to implement more things, like that zend exception API one.
 
@Danack Blame derick? :P
 
3:38 PM
@LeviMorrison yeah, i still have the error cb refactoring
 
I also want to properly fix the way we do inline functions in C, and many other things that make working with PHP easier. I want PHP 8 to be a landslide victory in user experience.
Curl's headers don't get installed to the php directory, that's another one I want to fix.
Delaying a few months only would be great, I think.
 
Yeah I think I'd be for waiting a bit before releasing 8
Or just reduce the QA phase cause not many people test stuff anyway ...
 
@bwoebi @NikiC What do you two think about that? ^
 
@PeeHaa actually might be a phpunit problem....trying to reproduce it outside of phpunit fails for several million goes.
 
@LeviMorrison There's still a lot of time, even until feature freeze
 
3:48 PM
@NikiC By the way, I am curious. How do you decide what to work on?
 
@Danack hmmmmm
 
@SebastianBergmann do you have any insight into why the code above chat.stackoverflow.com/transcript/message/48962721#48962721 might fail in phpunit? I won't open an issue as it only happened twice, and I can't reproduce it. That test has run the previous thousand or so times it has run, then failed twice in a row, and is now working again.
 
@beberlei Any specific ideas for where to store it? Given that we now instrument on first call (which is the place we want it to be, I am pretty sure) we can't situationally append it onto the op_array, as it's already been allocated.
So we'd have to always grow the size somehow, or find another way.
We can't stick it into the handlers struct we already allocate, because they get re-used for every call of the same function, and this needs to be per function call.
@NikiC How sensitive to size changes is zend_execute_data? Could we add a pointer to an array of zvals for each instrument?
 
4:20 PM
@Danack It's certainly odd
 
user201891
Question too dumb to post to SO. I'm not a PHP programmer and I'm reading a chunk of code that says:

```php
if ($user = user_load_by_mail($userinfo['email']) && $account->id() != $user->id()) {
// ...
```

It's Drupal. PHPStorm (the IDE) claims that `$user` is not declared in `$user->id()`, but I suspect that's just because it's not understanding the weird (from a Java perspective) initialization in the conditional . Am I right, or... ?
 
@DavidS You need () around the assignment
 
@DavidS you might want to split it into separate lines to make it easier to read. Which would also make the ordering of what is happening clearer.
 
@LeviMorrison one mechanism could be the reserved space on op array that zend_Extensions only can hook into at the moment
 
user201891
Hmm, @NickC you are right. PhpStorm stops complaining when I add that. Thanks for reading you two @Danack
 
4:29 PM
it has 6 free slots, i'd imagine that its rarely every reached
imho only xdebug and some of joes extensions use it
 
@LeviMorrison Why do you need anything extra in execute data?
 
@NikiC I just need something per call to store things in.
 
Why?
 
Store data for begin to end.
 
It's better to keep a stack in your extension
 
4:32 PM
It's not, because it can get out of sync with the real call stack.
 
Not in any meaningful way
 
zend_bailout is pretty meaningful, yeah?
 
Unless there is a bug in the being/end instrumentation itself
@LeviMorrison Even if zend_bailout is involved, that just leaves you with dead entries on the stack. Any new begin/end will still line up
If the job is just to transfer data from begin to end, bailout is irrelevant
 
if end is guaranteed to be called, then it might work
 
My point is that it doesn't matter if end is guaranteed
That's an unrelated problem
 
4:34 PM
I understand the principle, but experience is screaming that it's going to get out of sync.
 
4:47 PM
The hard part is the guarantee of the end handlers being fired. We haven't quite figured out a proper solution for zend_bailout. If we can figure that out, our own stacks could be like a 90's boy band.
...NSYNC
 
Get Out Of Here
 
i don't care much about zend bailout, as I unroll all open frames then. so i believe this is not a critical issue for me
 
@SammyK Figures the first time I talk to you in months it would be to drop a bad 90s reference...
 
@bwoebi operator overloading is cool but I am worried about people doing weird things with it, I guess
 
People can do weird things with just if and goto
 
4:59 PM
s/can/have/
 
cmb
new Proc('cat /dev/urandom') | new Proc('head -c 8') >> 'rand.txt' ;)
 
@Crell ;)
 
@SammyK Would you have time in the near future to help me get going with a php-src dev env? I... may finally want to try putting in the effort to patch something.
(About to give a webinar, but talk after?)
 
Time off by a microsecond ・ Date/time related ・ #79420
 
5:22 PM
Someone has karma to delete comment from bugs bugs.php.net/bug.php?id=78675 ?
 
will do
 
ty.
 
done
 
asdlkjsdaspidhpaishdpihasd
the bugs back
....or not.....I would go to the pub right now, if it was open or allowed....
 
5:40 PM
@Derick What would you think about adding a DateTimeInterface::setMilliseconds()? It's a bit inconvenient now to zero out only this value.
 
@Danack I live in a pub!
 
We are migrating to 7.4 from a version below PHP 7.1 and I'm having issues with tests where we compare DateTimes to DateTimes created from Y:m:s H:i:s
 
Adding a new function wouldn't improve that, as it can't be introduced before 8
how are you constructing the DateTimes?
 
yeah, I know :) I'm just trying to create a better future :) :D
let me check exactly how we do it
 
Think about the children :)
feature creep: having only a dedicated method to set the microseconds feels inconsistent to me
@StatikStasis new WIP soundcloud.com/user-93315143/takeoff-20 (house)
 
5:48 PM
yes, I agree, but still, it's very tedious to do a $d->setTime($d->format("H"), $d->format("i"), $d->format("s"), 0);
 
@MátéKocsis Why not create the instances with microseconds zeroed?
@Danack what was it (re the bug)?
 
@PeeHaa I haven't thought about hardcoding a time in the test, but with a little rearrangement, I think I can do that
 
Seems a bit nicer to me
 
@PeeHaa So. I have mutation testing with infection. Apparently they changed the parameter from "--log-verbosity=0" to "--log-verbosity=all". On the CLI, this stops the mutation tests from running. From inside PHPStorm, it makes the output look exactly like phpunits output, as it's just copying the output of the failed mutation test.
 
:P
 
5:57 PM
You can also do $d->modify("-" . $d->format("u") . "us");
 
ah, yes! :D Thank you both! I went with @PeeHaa 's version :)
 
That's very brave :P
 
yeah, mine is an absolute hack :D
 
yes :D
 
@Derick When did that ever stop any of us :P
 
6:03 PM
Very true :-)
 
Actually, we are migrating away from Hack, so I'll be very very curious about the performance difference ^^
but there's still lots of tests failing until we can go to prod :D
 
 
1 hour later…
7:06 PM
@Andrea same … I'm a bit torn on whether the disadvantages outweigh the possibility to shoot in the own feet
 
Hi
How can we filter courses Like udemy.com in Laravel. it's append query string in url and filter.

udemy.com/courses/search/…

Please help me in flow, is it ajax or what's flow of route to controller. How Manage append html ajax or controller
ibb.co/h2cr5YY
 
@bwoebi I was the same, but there is plenty of ways people can shoot themselves in the back. Should not be reason why us (sane people) cannot have nice things
 
@PeeHaa
 
@RaheelAslam Please don't ping random people. At best you will be ignored at worst a room owner might kick you
 
@PeeHaa thanks
 
7:31 PM
@LeviMorrison would you imagine the overhead of a begin+end handler that does nothing is higher than zend_execute_ex overwrite doing nothing?
 
7:50 PM
foreach (array_keys($arr) as $k) is slow ・ Performance problem ・ #79421
Feature request - allow to append multiple elements to an array ・ Scripting Engine problem ・ #79422
 
I want a remote Job can any one help. It seems impossible to get when you are from Arica on stackoverlow
email is njovujsh@gmail.com
 
8:11 PM
Stackoverlow indeed
 
@PeeHaa When I heard that ding I thought it might be a new song... then I got busy before checking. Checking it out now.
@PeeHaa It's been removed!!
What happened?
 
9:02 PM
copy command is limited to size of file it can copy ・ Unknown/Other Function ・ #79423
 
 
1 hour later…
10:21 PM
Hi folks. In the ServerRequest RFC thread, there was discussion of the need to pull a function out of the HTTP parsing logic that populates $_POST, and expose it to userspace. I'm trying to find any indication of what the internal code was named for that. I seem to recall it being named somewhere but I can't find it. Can someone point me to where that logic lives?
 
10:32 PM
Not at my PC to look right now, but probably want to be looking in the SAPI source code
 
Oh god, this source code hurts me.
 
Isn't that all of php-src
You'll need to be more specific :D
 
I've rarely even looked at php-src before.
But cgi_main.c.... I have yet to find, um, a function. Just lots and lots of code.
 
I mean even in the normal part it's a lot of macros
 
My previous looks at php-src led me to the statement "PHP isn't written in C; it's written in a macro language written in C."
This is one of the reasons I've avoided it to date.
 
10:37 PM
php-src isnt written in c, it's written in preprocessor
 
Exactly.
 
10:47 PM
huh. sapi_cgi_read_post(), according to my IDE, is never... used. Which I don't believe for a second, but...
 
wouldnt trust your ide at all with php-src
 
Fair.
 
Both CLion and VStudio both just give up and die when it comes to analysis
 
@LeviMorrison omg, this implementation is so geniius waitng for the first zend_function caching. it works even for dynamically registered hooks
 
You're better off using just text search
 
10:49 PM
for php-src vim + ack-grep are your friend
@LeviMorrison have a prototype working with "2 files changed, 75 insertions(+), 9 deletions(-)" <3
 
11:03 PM
@Crell actually the technique Maté does with using PHPStorm is kinda genius
You actually nicely formatted tests
And because code analysis dies anyway you can let the basic auto completion handle it
 
hm?
I'm still just trying to figure out how the parsing happens. :-)
 
I find it usually easiest to work backwards from known effect, then keep searching for things up the chain
 
Using LXR is pretty usefull heap.space
 
Hm, that gets me to the same place that Ctrl-F did. It seems to only be mentioned in a struct definition, in both cgi_main and fpm.main. Which I presume is sort of the API plugin point then?
 
cmb
11:29 PM
@Crell sapi_cgi_read_post is registered as callback: heap.space/xref/PHP-7.4/sapi/cgi/cgi_main.c?r=fd08f062#998
fpm_main.c has its own implementation/hooking
 
Yeah, that's the struct I was talking about. So are the callbacks defined by their order...?
And... if each sapi has its own implementation, how would it be possible to expose to user-space? Does it actually differ between the two?
 
cmb
The callbacks are accessed by their member name (in this case .read_post).
The current SAPI is exposed as the global sapi_module.
 
So that roughly translates to an interface and implementation thereof, I presume. So, if we were to factor out the post data parsing logic to make it user-accessible, that would have to be a function/set of functions somewhere else that the two SAPI functions wrap. For some definition of "somewhere else". Yes?
 

« first day (3450 days earlier)      last day (1481 days later) »