Hello, I'm a programmer you may know me from my greatest hits
"Fuckkkkk"
"Pushed"
"It works in my environement"
"What the fuckkkkkk"
"No way this is broken"
"God im an idiottt"
"How did this ever work"
Saying that weak types is considered semi-legacy and that you really ought to be using strict types, and that new type features will only work there, is also a valid strategy
Although I've no idea how easy that would be to pass through internals.
The problem with weak types is that your algorithm for where to draw the line is arbitrary. Whereas for strong types your line is "the most type-safe I can make it".
@NikiC My main problem is that we need to revisit the semantics and edge cases to propose something to internals. Porting the code to current master is something I could do myself
@Shafizadeh not really, squash is the name of that operation. In general terms it means that you'll rewrite your git history to combine a certain number of commits into one. Squashing them together. further reading
@PeeHaa Finally got some time yesterday to work on some music. Nothing of interest- hopefully I can get some more time this week to mess around. I need a vacation. I am tempted to take a week off and do nothing but work on music.
I know that there are some web hosting services who don't allow you to create folders outside the www directory, in that case how do you prevent the view files being accessed? using the web server configurations or by changing the views with something like if(!is_defined(...)) etc. ?
alternatively, just because they don't give you access to anything else, I guess that doesn't mean you can't define the docroot. So, even if you only have access to www/, you can use www/public/ as the server's docroot, and you get folders which are not publicly accessible.
@rtheunissen I was considering adding a Ds\PriorityQueue::remove($value) method to DS that removes the first occurrence of $value. Something you'd accept?
I made one in user code that's faster for removing values than foreach'ing over an SplPriorityQueue, but of course it's slower for insert/extract.
I simply looped through the data array to remove the watcher, but that probably wouldn't work if there could be multiple entries with the same value and only the highest priority should be removed.
Random Question about IP/Subnetting, incase someone happens to be around that understands it by chance: If i have been assigned the IP-Adress xxx.xxx.128.0 / 22, do I then also own the IP-Adresses xxx.xxx.129-131.0 /22? Because these have the same netID, right? I dont get this lol, it makes no sense
Right, I think it is that way - if you are given an adress with /22 prefix you actually own 2^10 adresses, because there are 10 bits left that you can play with. God this topic is so confused lol
I used to only need one sumatriptan for a migraine and that was it, so I'd be taking the pill like once a month. Now I'm needing two or more each migraine, and I can't take more than two a week.
Does PDO use mysqlnd under the hood? Getting MySQL auth errors with MySQL 8, surely down to caching_sha2_password auth type, but I've verified that my build has mysqlnd extended SSL support enabled
@LeviMorrison I'm not sure your email reached the list. The last one I can see from you was about your intent to close the vote in 'a day or two', and then CMB was asking for an update: news.php.net/php.internals/103750
I'm writing a regex to not-validate if an input field ends with a /. This is what I've tried and it kind of works... but it's matching the last test string and it shouldn't. Or I'm completely misunderstanding how [^] is supposed to work.
@bwoebi I think that's a solvable problem with conversion order, or just a flat statement that for unions types must match exactly (no conversion rule)
or a rule that conversion only happens if it is lossless
(hence 1.5 -> int|string would only work as "string")
@Tiffany I don't use that tool much, and I'm not sure I understand what you meant for the cases - but isn't that input box a single input string? Wouldn't using the separate tests be appropriate here?
@Leigh no misunderstanding, I didn't specify it 😛. I have one input field that must start and end with /, and another input field that must start with a /, but must not end with a /.
(talking outloud) trying to understand what I did wrong. Because I had (.*), it sees it as one capture group, so it sees the entire string after / as a capture group, including the end-of-string /, so if the [^\/] is included in the (.*) capture group, it will exclude these strings as matches?
I may use capture groups more often than I should; I tend to use them to help make a regular expression easier to read for me. Ultimately, is this a bad practice? Like, could I run into instances where I think a regex should work (or not work), but because I've added parentheses to make it easier for me to read, the regex doesn't work correctly/as intended?
I just can't accept getting it wrong, pcov and phpdbg are getting it wrong, no two ways about it ... it must be improved ... this is my first attempt, I expect it's wrong ... happily, it generates very very close to xdebug, I don't know how xdebug is handling switches, but that appears to be the only difference on the simple test suites I've run this one so far ... still I'm not confident I thought of everything ...
namespace {
final class BidirectionalArrayIterator
implements Countable, Iterator
{
function __construct(array $input);
function rewind(): void;
function end(): void;
function next(): void;
function prev(): void;
function key();
function current();
function valid(): bool;
function count(): int;
}
}
@Tiffany overkill commenting, but just for an example, with the x modifier you can do:
preg_match('~
/ # Must start with a backslash
( # Start capturing
.* # Match any number of characters
[^/] # Match any character that is NOT a backslash
)$ # End capturing at the end of the subject
~x', $subject, $matches);
Lol... why'd I have to add more complexity to it. So user types ///admissions/index.html by accident, / // is captured once, / // is captured in the second group. I tried (\/{1})([^\/].*[^\/])$ which feels a bit overkill, but is still matching ///admissions/index.html
the bit in phpdbg/pcov where it checks for return with extended_value -1, and certain sequence of opcodes, that causes them both to misdetect that the end path in this function is not travelled
function () {
if (condition_is_true()) {
return true;
}
}
@JoeWatkins I'm not sure which cases exactly this misses, but it's definitely not robust. The "proper" way to do this is to build a CFG and propagate reachability. This is what opcache does in github.com/php/php-src/blob/master/ext/opcache/Optimizer/….
@Leigh What is the correct way of explaining [^/]+? In effect, I see that it means "don't match a string with an ending /" but I know that isn't the exact explanation.
@Tiffany It breaks if it encounters a / in the middle, but because the group has a +, it goes back to the start of the group to try and repeat it one or more times. And the group starts with a /
@NikiC if finding the cases this doesn't work for and fixing them is a crappy idea ... would you write the cfg, or leave it as it is ? I hate it being wrong ...
I always was, actually, but didn't let the gay out ... it made a sneeky appearance in a pair of doc martin boots that were bright pink .... now it's all out :)
it's funny, every time I tweet something a bit gay, wearing pink, or tattoos, or whatever, or just anything that directly mentions non-heterosexuality, people unfollow me on twitter ... I didn't keep the list of names ... probably worth avoiding though ...
yeah, don't you get sad looking down at darkness all the time ? I'm absolutely sure that being dressed in bright colours has an effect on my mood, I won't say it makes me happier, but it gives me a reason to grin when draped in fluffyness ...
still I do like the odd black hoodie ... my dogs got hold of one github one, and the other one fell apart, replaced them with 2x wes's ..
@tereško I think your current relationship status with Wes resulted from a comment a few weeks ago when you told him to stop pinging you. Probably just a misunderstanding of you were busy and being short at the time- but came off harsh, iirc.
Which reminds me I need to recheck prices on my rig build to see if anything has dropped. If it hasn't I will put off building a new rig for a while and buy the parts to finish my racing drone instead.
@NikiC Tests are re-running on Travis. It's expected to pass. Some of your feedback items still stand though, such as this one. The contents has changed and you didn't use the permanent link. Do you remember what function you linked to?
@Shafizadeh if you get a job as a developer and do not aim for London, then it might be OK
but you would have to do some research regarding the town you want to move to - for example, there are towns, that have a large ... emm ... "immigrant population". You would not like to end up in a town with 80% Pakistani (they are Sunni)
@Leigh I just realized the input field I was trying to invalidate against a string that ends in a / may start with [http|https] ... facepalm starting to think I shouldn't bother with regex for this field because I may not be able to account for all of the potential allowable differences. ... Though maybe at least check to make sure it doesn't end with a / ...
I love JetBrains. My annual renewal is coming up. If I knew I would do more coding in Python again soon I would buy the whole package for the next year in order to get a perpetual license for it.
@Trowski I guess "Ctrl-Y" was know as "Delete Line" in some very, very old IDEs, and Jetbrains carried it over.
I guess, in fairness, IntelliJ has been around for quite some time, so it made sense when it first came out. However, now, having it set to "Delete Line" is detrimental.