PHP

Support group for those afflicted with PHP. Don't ask to ask, ...
Oct 31, 2021 16:02
(and the work-around probably didn't work anymore because it's called an ExcludeList now)
Oct 31, 2021 15:59
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
Oct 31, 2021 15:59
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
Oct 31, 2021 15:57
It also hooks right in with a work-around that I had in place in the past
Oct 31, 2021 15:56
@hakre Yes, that's it, thanks!
Oct 31, 2021 15:38
In fact, I now think it's related to phpunit (and in particular the @runTestsInSeparateProcesses annotation I'm using)
Oct 31, 2021 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
Oct 31, 2021 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
Oct 31, 2021 15:15
@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
Oct 31, 2021 15:14
No, I'm not using any data-provider methods
Oct 31, 2021 15:11
@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
Oct 31, 2021 15:07
Ah, good point!
Oct 31, 2021 15:03
@hakre it is not
Oct 31, 2021 15:00
I just realized that I can (probably) use include there if I include over http
Oct 31, 2021 14:57
@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
Oct 31, 2021 14:56
@Danack But I cannot use include on there as far as I know
Oct 31, 2021 14:55
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
Oct 31, 2021 14:55
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
Oct 31, 2021 14:52
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?
Oct 31, 2021 14:50
Thanks for the help!
Oct 31, 2021 14:46
But it also ends with this message: Script phpunit handling the __exec_command event returned with error code 2
Oct 31, 2021 14:46
I mean, without any arguments, it seems to give the right output
Oct 31, 2021 14:45
That look like it more or less works :S
Oct 31, 2021 14:09
(and for good measure, I just also used that exact command just now)
Oct 31, 2021 14:08
@cmb Nope. It was properly using only linefeeds, and adding carriage returns was one of the first things I tried
Oct 31, 2021 13:42
@PeeHaa :D I might not do that, considering it's only about a year old and has a mythical current-gen gpu ;)
Oct 31, 2021 13:35
Yeah, I just realized that the question didn't make sense in context
Oct 31, 2021 13:34
@PeeHaa nope
Oct 31, 2021 13:34
Oct 31, 2021 13:30
If I run it from cmd or from git bash, but specifically tell it to use the .bat file, it works as expected
Oct 31, 2021 13:29
I was running it from the git bash, and that seems to have caused the problem
Oct 31, 2021 13:29
not quite pebkac ;)
Oct 31, 2021 13:29
I think I found the problem, though
Oct 31, 2021 13:28
@PeeHaa It doesn't
Oct 31, 2021 13:17
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.
Oct 31, 2021 13:12
#!/usr/bin/env php
<?php declare(strict_types=1);
Oct 31, 2021 13:12
there's a shebang and a newline before it, but nothing else
Oct 31, 2021 13:09
@Sjon vendor\phpunit\phpunit\phpunit
Oct 31, 2021 13:06
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?
Oct 31, 2021 13:04
Hi all!
Apr 2, 2014 00:31
I won't pretend I've never used pirated software (quite the contrary), but the mindset that involves you must pirate software is really rather tiresome (and a good one?)
Apr 2, 2014 00:28
sigh
 

Python

Room rules: sopython.com/chatroom Code formatting guide: tinyu...
Mar 14, 2020 13:45
@AndrasDeak Based on that name, I was expecting Tau to be a constant between 2 and 3 (like euler's number, for example)
Mar 14, 2020 13:32
Anyway, thanks for your input, guys (m/f/o)!
Mar 14, 2020 13:31
@MisterMiyagi We're talking 500+ upvotes (on the one answer) here and 12 answers with a positive score. My guess would be that it would take longer for it to correct itself than for python 4 to be released
Mar 14, 2020 13:30
The stated reasoning was basically keeping it for historical significance (so people can see how the language evolved)
Mar 14, 2020 13:25
@Aran-Fey Yep, the solution was exactly that adding parentheses to a print. I'm going to keep it as is for now because multiple people agreed in the comments on not changing it, and I said that I wouldn't change things as long as that remained the unanimous sentiment in the comments (excluding me, obviously) and I would like to stick with that. But it's good to know what to do in the future.
Mar 14, 2020 13:20
@MisterMiyagi it's a bit of an open-ended question, with a ton of answers that suggest different approaches to the problem. There is no answer suggesting this approach that is python3 compatible and I'm pretty sure a new answer would be buried under far too many answers to ever climb highly.
Mar 14, 2020 13:11
Now here's the problem: I suggested that modification in the comments because I wasn't completely sure (and because I can't make an edit suggestion because of non-python rep) and the author of the question - who is a user with very high rep - responded in no uncertain terms: he wants to keep the answer as is, despite it not working for newcomers to the question
Mar 14, 2020 13:08
What is the policy you guys maintain on python2/3? I came across a highly upvoted answer that is python2 only (on a highly upvoted question) without any mention of this. I believe a simple modification could make the answer compatible with both python 2 and 3.