« first day (4521 days earlier)      last day (652 days later) » 

10:19
what a strange issue github.com/php/php-src/pull/10756 ...
looks like a compiler bug / undefined behavior
10:49
\o
 
4 hours later…
14:46
@Danack Sorry I'm late to the party @Danack. "exactly what problem is this solving?" I've got some typical examples at the top of the RFC, wiki.php.net/rfc/literal_string - libraries expect certain sensitive strings to be written as a LiteralString today, but developers incorrectly concatenate unsafe user values into them (it's why libraries have reduced injection vulnerabilities, but not stopped them); also LiteralString works for developers who write their SQL manually, e.g.
The LiteralString type is simple, works well, and is now in Python 3.11 (PEP 675 was written without my input, and they came to the same solution). It's available in Psalm and PHPStan as the literal-string type, it's being used, and Psalm notes how it avoid the limitations in taint-analysis.
I've spent a lot of time looking at Tagged Templates in JS (with isTemplateObject in Node, and Procedural Macros in Rust), They are quite nice, and some libraries do use them (e.g. sql-tagged-template-literal).
But, while changing " to ``` is kinda easy, it is time-consuming; a lot of SQL/HTML strings use concatenation (e.g. conditionally, or for readability), escaping functions must be removed either way, libraries don't really work like this today (see most ORMs), context can be tricky (e.g. field vs value), and they cannot be used until PHP 8.X is min supported version.
 
1 hour later…
16:16
@IluTov Should the branch be deleted here: github.com/php/php-src/pull/10689?
I just noticed it popped up in my local repository when fetching the upstream remote.
 
1 hour later…
17:43
o/
@TimWolla Oops, yes. I didn't think about the fact that GitHub creates the branch on the main repository instead of my fork. I deleted the branch.
 
3 hours later…
20:28
The Parameter Type Widening RFC makes it so you can add types to methods in a parent class without breaking child classes that don't define types in the overridden methods. Is it intentional that this doesn't work for class properties?
It cannot work for properties, because properties are both "write" (like parameters) and "read" (like return values).
Thus they must be invariant, because they might violate constraints otherwise.
20:48
Ah right, the RFC I linked to is just allowing contravariance with parameters
For 7.2
For some reason I had in my mind that there was an RFC that would have child methods with widened return types just inherit the return type from the parent as a way to make the upgrade path easier for parent classes without having to upgrade child classes (eg. for libraries that might not control child classes). But now I think I just misinterpreted an RFC as that since what I'm saying also throws a fatal error with methods.
It was improved in 7.4
oh yeah that makes sense, that's when contravariance and covariance were both introduced
Yes
I think what you're suggesting would violate LSP
20:54
Yes it would
I suppose it is much better if methods don't implicitly inherit the parent constraints to allow for easier updating of parent classes but for some reason I just had thought it was something that was implemented. I have no idea where half my thoughts come from :P
 
1 hour later…
22:12

We aren't the thankless bunch we've been made out to be.

Oct 26, 2014 at 16:42, 3 minutes total – 6 messages, 6 users, 0 stars

Bookmarked Oct 26, 2014 at 16:47 by Dan Lugg

I miss you guys :')
22:55
Hello guys.
Long time

« first day (4521 days earlier)      last day (652 days later) »