« first day (4033 days earlier)      last day (1140 days later) » 

05:05
Happy Halloween everyone!!!!
06:02
@NikiC I don't know exactly what has to be done to make this happen ... if there's anything I can do to help, holla ...
 
3 hours later…
08:46
@NikiC Tell me to stop thinking crazy things, but wouldn't a project-wide change in process like that need an RFC?
@salathe Stop thinking crazy things :P
But going by precedent, no, it does not seem like infrastructure changes go though RFCs
At least I can't find an RFC for the git migration...
Oh nice
Heh that was a decade ago, feels like yesterday. :-)
 
4 hours later…
13:04
Hi all!
hoi Jasper
I installed phpunit using composer on Windows, but whenever I run phpunit I get a "strict_types must be first statement" error. Does anybody have an idea on in what direction to look in order to fix this?
the error log should tell you in which file that error originates
@Sjon vendor\phpunit\phpunit\phpunit
you can open up the file in an editor and see where the strict_types statement is, is it the first in the file as required?
13:12
there's a shebang and a newline before it, but nothing else
#!/usr/bin/env php
<?php declare(strict_types=1);
Since I have done nothing too special, I expected the combination of the error and phpunit would give me good google results, but the only php-unit related results I'm getting are old (fixed or won't fix) issues which do not apply to my situation.
I see nothing wrong with that but unfortunately I'm not on Windows so cant help any further
@Jasper Does the file have a BOM?
13:28
@PeeHaa It doesn't
I think I found the problem, though
PEBKAC
:-)
not quite pebkac ;)
What was the problem?
I was running it from the git bash, and that seems to have caused the problem
If I run it from cmd or from git bash, but specifically tell it to use the .bat file, it works as expected
Weird I run everything from git bash without issues
Does ./vendor/bin/phpunit not work for you?
13:31
reddit.com/r/PHP/comments/qjp9qh/… this might be something benefiting from @NikiC @JoeWatkins or @bwoebi
@PeeHaa nope
Yep
Yeah, I just realized that the question didn't make sense in context
Time for a new machine is all advice I have :D
13:42
@PeeHaa :D I might not do that, considering it's only about a year old and has a mythical current-gen gpu ;)
cmb
cmb
14:06
@Jasper would dos2unix vendor\phpunit\phpunit\phpunit help?
@cmb Nope. It was properly using only linefeeds, and adding carriage returns was one of the first things I tried
(and for good measure, I just also used that exact command just now)
14:44
@Jasper try: composer exec phpunit
composer normally figures out how to call the bin-stub of phpunit.
That look like it more or less works :S
I mean, without any arguments, it seems to give the right output
kind of wired as normally within git bash ./vendor/bin/phpunit has always worked for me, was also a mingw user of git. but not any longer ;)
But it also ends with this message: Script phpunit handling the __exec_command event returned with error code 2
with arguments it's with all the ~~love~~ hate of symfony console. use -- for some extra power but you will find --help never working.
symfony refused to patch ages ago even the patch was trivial.
composer help exec should give some hints.
otherwise use php directly and call it from the vendor dir: php -f vendor/phpunit/phpunit/phpunit.php -- --version
that works across all platforms unless php is not working.
@Jasper I sometimes experience this, and I use git bash almost exclusively. I sometimes have to open a powershell window though
@hakre --- <- surround in that for strikehthrough
\-\-\-hmmm\-\-\-
lol
14:50
@Tiffany thanks for all the fish
nice!
Thanks for the help!
On a completely different matter: is there a good way to check if php itself is treating something differently from older versions when include is involved?
my first guess would be that this should not happen with include.
what kind of problem/quirk are you concerned about?
and what is the old and what the new version?
I'm including a file from a function in a class. The included file uses $this, which gives an "Using $this when not in object context" error
I think this code ran fine in at least one other version of php, but I'm not sure, so that's why I'm trying to find out
is the function static or called statically?
@Jasper 3v4l.org put an example on there, and select "include eol".
14:56
@Danack But I cannot use include on there as far as I know
@hakre Let me check, I'm running the tests of an old project I haven't touched in quite some time, so I'd have to dive a bit deeper to answer that
You can, but the error is almost certainly not related to include.
I just realized that I can (probably) use include there if I include over http
@sjon what is the correct way to include files on 3v4l please .... I have forgotten.
@hakre it is not
@Jasper me neither, but this is possible on 3v4l.org: 3v4l.org/nlCuU
15:07
Ah, good point!
And this is an "Using $this when not in object context" example 3v4l.org/FKdPF
$this makes a difference between 7.0 and 7.1. so perhaps the old PHP version is 7.0 or below?
How would you call/name such access-chains?: $var->response->items[0]->attachments[0]->photo->sizes[5]->type
any jargon for that?
@hakre Well, then that theory was wrong. I'll have to see if I can make it happen without phpunit and then reduce it down to where the problem is
but it's not related to a data-provider method in phpunit, is it?
No, I'm not using any data-provider methods
@hakre going by the usage in the "optional chaining operator" in js (developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/…) chaining seems to be the best term there is
oh, no usage problem with, looking for a name. Is that a "variable path" and "arrow line", is it "arrowing down" what is a common description for something like that. Variable accessing chain?
(the example is stupid to have in ones code, just an exaggerated example)
15:19
That's what I meant: the operator is meant for such chains, and if the entire MDN article doesn't use anything better than chaining, there's probably no better terminology
@Jasper wrap the function in a class?
object and array access chain.
or: a fully qualified object and array access chain.
now I get it thx @Jasper.
15:37
@Tiffany It is in a class. It's part of a large and complicated project, though, and as the other 3v4l showed: I have not yet been able to reproduce it
In fact, I now think it's related to phpunit (and in particular the @runTestsInSeparateProcesses annotation I'm using)
15:49
@Jasper is this include within a test method that then runs in the separate process context?
@Jasper: This might be interesting info for you: github.com/sebastianbergmann/phpunit/issues/…
@hakre Yes, that's it, thanks!
It also hooks right in with a work-around that I had in place in the past
I removed it earlier because it was broken (as should be expected for a work-around that uses reflection to edit some internal blacklist) and I thought it wasn't a problem to remove it because it worked for the other test class without the work-around
I probably either had the work-around in more places than it was needed or their include-tracking changed over the years to no longer track includes that were done by includes
(and the work-around probably didn't work anymore because it's called an ExcludeList now)
16:54
we need a workaround for the workaround of the previous workaround workaround that should have never stayed in the code-base ;)
 
4 hours later…
21:19
Without writing my own parser, is there a way to dump the functions that are in a C file, that aren't listed in a particular header file?
21:54
HAPPY HALLOWEEN r11. If Halloween is something you celebrate.
22:05
\o/ haphpy halloween 11ers
@Tiffany I did it yesterday :D
23:02
How does one create a FCI/FCC for an internal Zend function?
No idea, but ZEND_INTERNAL_FUNCTION and ZEND_ACC_CALL_VIA_TRAMPOLINE might be clues.
Is less likely to be a clue.
23:22
I mean, I need to pass spl_autoload() to the new autoloading implementation I'm working on
Seems to be mostly working for classes, minus that, a mem leak steaming from zend_closures.c and spl_autoload_functions() which I need to migrate
I have no idea....push a branch and pretty sure Joe will be able to answer in not so many hours.
btw, did you split the callbacks for the different types?
23:40
@Danack Yeah, I haven't worked on the function one yet
But made prep for it
The problem I ran into with the autoload_classmap was that it necessarily ignored order as otherwise I would have had to have turned the function callback into a union and made a much larger change... If you're re-writing it, consider making it a possibility =)
I'm just reworking it to the point of being able to add function autoloading (and other sorts) as an easy extension
So you'll need me to tell what autoload_classmap is meant to do
Rather than invoking the chain of autoload handlers, it accepted a precompiled list of class names => paths and just loaded them directly. github.com/php/php-src/pull/6776
if you want to have a look at one point
23:49
/we're not good at halloween, it's just too damp, and we like to set fires on Nov 5th.
Well I went out in a costume yesterday, so I don't know what you're talking about :p
The thing was it always checked the precompiled list first, if I had changed SPL_G(autoload_functions) to have a type + array union I could have ordered them, but that would have broken spl_autoload_functions (unless they were skipped entirely)
@MarkR How is that different from an autoloader which is prepended?
@Girgias Small micro-optimization on one of the most frequently called functions. Performance gain of gain ~5 - 7% vs invoking the function list (in terms exclusively of autoloading)
@Girgias what costume?
23:54
@Tiffany A witch :D
@MarkR Have you tried using the approach of spl_autoload() ? i.e. an internal function which can be registered like a normal autoloader function
awwwwwww
@Girgias I hadn't, but as the performance bump was minimal I didn't want to add any extra overhead of the new stack frames at all. I'm not sure where I would have kept the pointer to the array either.
@Girgias awesome
I would think once you're storing a zval to the array, it might as well go in the spl_perform_autoload in the first place
23:58
@MarkR I would imagine the performance is mainly because you're remaining in C land and not handling back to the VM
spl_autoload() is (according to user notes) faster than a custom autoloader because it is an internal fonction
@Girgias Right, that was the premise behind it. As composer is building the classmaps anyway I convinced them to register a classmap if it made it into PHP, it would have in effect been transparent free performance.
@MarkR Well storing a pointer to an HashTable compared to a zval drops one indirection

« first day (4033 days earlier)      last day (1140 days later) »