« first day (4276 days earlier)      last day (658 days later) » 

12:02 AM
@ircmaxell after quite a break I've finished up switch & jump statement support in FFIMe. It now happily transforms php.h into a monster PHP file of nearly 100k lines (about 5 MB worth of code) - all types of expressions and statements used in PHPs header surface are supported now.
(on my mac at least … maybe there are still some weird linux things left)
 
 
6 hours later…
5:47 AM
posted on July 01, 2022

 
6:34 AM
Given the Raspberry Pi Pico has 16MB flash memory and standard PHP binary is 14MB would that be possible to compile embedded SAPI using the Pico SDK to replace glib calls, reduce some extensions, compile everything and still having some free space for PHP code?
 
 
2 hours later…
cmb
8:45 AM
@Crell that error isn't triggered by ./configure, but rather by another QA script (I think scripts/qa/section-order.php). I left a comment on how to resolve this on the PR.
 
9:35 AM
I read some time ago a way to assign array to variables in the definition of a foreach
having array<array{string, string}> doing something like foreach ($arr as [$one, $two])
do you recall the name of that?
 
cmb
 
9:51 AM
thanks! :D
 
 
4 hours later…
1:34 PM
Does anyone know of a PHPStan, Psalm or CodeSniffer rule that forbids extending a class, unless it has a certain word ("exception") in the class name?
 
Does anybody remember when we got "array" and "ClassName" type-"hints" ?
was that 7.0?
must be earlier... 5.4 added the "callable" typehint
 
@Derick 5.1? 3v4l.org/jSEDU
for array
 
ah, of course I could have tried 3v4l myself!
 
but I forgot to actually use it - 3v4l.org/Lr4GM but still 5.1
 
and classname hints were added in 5.0
 
1:43 PM
> hints
(╯°□°)╯︵ ┻━┻
 
cmb
ACK
 
they were called hints then!
(and that's why I used "hints" in my first question :-þ)
(and I am making it a specific point in my talk, so shut up :-þ)
 
The reason I think it matters is that a _lot_ of PHP developers seem to have trouble thinking in types, quite notably the Symfony core developers, and don't value how type systems can make your code be easier to reason about.
Obviously for a talk about ancient history then using the time appropriate phrase might be better. But getting current PHP devs to actually understand types better and be able to communicate better with non-PHP devs is probably a good thing.
 
that's literally what my talk is about :D
 
cool.
Are you going to 'subtly' work in a few lines about how changes to the type system require more than a couple of weeks of discussion?
 
1:53 PM
yeah, but starting that scalar "hints" took 5 tries, and nearly a decade
 
2:11 PM
New PHP In Voting Phase RFC: Short Closures 2.0 wiki.php.net/rfc/auto-capture-closure
 
@Mwthreex Hours since the last changes in implementation details for that RFC: 2.
 
cmb
"When discussion ends, and a minimum period of two weeks has passed since you mailed internals@lists.php.net in step 4, consider one day heads up mail on the mailing list and then you can move your RFC to “Voting” status."
 
I'm going for a walk before I say something more than this. Although I think that RFC is a good idea, some of the words in the RFC are still "pulling a fast one" by saying stuff that is untrue before doing the "except for objects bit" a few hundred words later. Also, the details do matter, the inconsistency between arrow functions and short closures is "not obviously correct".
 
@beberlei This looks odd: php-rfc-watch.beberlei.de/rfc/auto-capture-closure — it's not seeing the 8.1/8.2 differences
 
@Danack Also the "However the comparison stops here." piece in the "Using variables from the parent block" section.
To me that reads like "this behaves like a loop, except it doesn't".
 
2:29 PM
Oh does that introduce support for block functions?
Me is lazy
What is the reason => is dropped as a requirement?
 
I don't know...
Conversely, the => token is followed by an expression in all circumstances. (Arrow Functions, arrays, and match().)


apparently
 
2:45 PM
Maybe I am just weird and see this as yet another syntax because it is missing instead :)
Just seems inconsistent :(
 
3:04 PM
@cmb @Derick Re strtotime, The description of the parsing logic seems too "large" to relegate to an example or a note. I would almost say it sounds like it belongs in description, but that puts it before the arg list et al which also seems wrong. I'm not sure of the right place for it.
 
yeah, it's hard. The full grammar does exist in an appendix though: php.net/manual/en/datetime.formats.date.php
 
Ooo! I'll include a link to that, thanks.
(Doesn't answer the immediate question, though.)
 
I didn't understand the immediate question, then
 
IMO, Example is fine... but I also think you shouldn't document it there at all, as it would be duplicating waht's in the more extensive grammar.
 
3:13 PM
There were like a half-dozen comments talking about it, and the current page already documents it, just incorrectly. :-)
Also, I'm good with whatever alternative to US/European labels you prefer.
 
I object to calling it "European"
Not to the "US" label
 
Pick a name then. :-)
 
"normal"
 
Except that. :-P
 
but it is accurate
FWIW, I don't think that the existing description is wrong either.
Perhaps not the best written, but it's not wrong.
 
3:19 PM
The current text doesn't differentiate between 2 and 4 digit years, which parse differently for dashes.
As I said, there were numerous comments very confused by it and pointing out issues. (I deleted them on the assumption that the PR would address it, as I generally do.)
 
If, however, the year is given in a two digit format and the separator is a
dash (<literal>-</literal>), the date string is parsed as
<literal>y-m-d</literal>.
instead of "two" it should say "four", though
but beyond that, it does talk about it :-)
 
Evidence says it was still confusing. :-)
 
That's why that section also said:
To avoid potential ambiguity, it's best to use ISO 8601
(<literal>YYYY-MM-DD</literal>) dates or
<methodname>DateTime::createFromFormat</methodname> when possible.
(which I think you might have removed)
 
I think I did, because if you're using a well-standard format already, I don't know why you'd be using strtotime in the first place.
 
oh, because people do.
I probably put that in due to an earlier note :-)
 
3:25 PM
People do lots of silly things.
 
cmb
… some even use PHP :p
 
3:41 PM
Silly people.
Oh <censored> <censored>. guilliamxavier's latest comment.
@Derick OK, I'm starting to come around to the "say nothing, just prominently link to the format rules because it's just too bloody complicated" position. :-(
 
:D
 
cmb
^ might indeed be best
 
date/time is hard
 
Fact.
 
I've been going over all the "diff" bugs and reports. .. and it's a mine field
 
3:45 PM
OK, I'll switch to that approach.
 
4:07 PM
@Crell Why do you put two spaces after a sentence closing period?
 
Because that is the correct format, and what my muscle memory has been trained on for 40 years.
 
It's just annoying to me.
When I search for this on the internet, it basically tells me you're only doing that because you're old :-þ
 
cmb
HTML spoiled this.
 
no, it fixed it.
 
Correct on a monospace typewriter. Incorrect when automatic kerning is a thing.
 
4:15 PM
FWIW, the Chicago Manual of Style also disagrees with two spaces now: chicagomanualofstyle.org/qanda/data/faq/topics/OneSpaceorTwo/…
 
o/
It's Friday again my dudes!
 
o/!
 
@Derick The Internet is demonstrably wrong about this.
 
My physical copy agrees with the online version.
 
4:22 PM
It's been a battle between space-styles for a long time; the urban legend about it being "just" for typewriters is just that, an urban legend.
 
you were right, were this the 1990s. It's 3 decades later, and you're now demonstratively wrong.
But in any case, the PHP docs have their own guidelines (doc.php.net/tutorial/style.php), which say: "Sentences need not have two spaces between them."
 
cmb
"need not" != "must not" :)
Okay, I've reconsidered. In the future, I'll use a single space. That is easier to read, less annoying to most readers, and I can safe a keystroke. :-þ
 
4:41 PM
Retraining my muscle memory is more work than hitting space twice. :-)
 
 
1 hour later…
5:52 PM
@Crell did you reuse the RFC url? wiki.php.net/rfc/auto-capture-closure its broken on php rfc watch somehow
 
I don't adhere to the 80 or 120 character line limit in PHP code... I'm a monster.
It happens most of the time... but I hate breaking up code with an _ just to go to the next line.
 
6:09 PM
@beberlei Yes, it was the same one as last year. I asked in here before we did that and the consensus was to reuse it, but then on the list people complained that we'd reused it. Can't win. :-)
 
@Crell not sure it was ever done to reuse one, but ok :D
 
The previous one never went to a complete vote. It started but was then pulled.
 
6:37 PM
That counts as vote. People pointed out that the problems they said needed addresseing, hadn't been addressed and that they are going to vote against it.
 
JRL
were those problems brought up or expressed during discussion?
 
yes.
 
JRL
if voters want to wait until voting to actually engage with the RFC, this sort of thing is the inevitable result
ah
 
My recollection is Nuno said he was going to work on them. But then it just went to vote without them being touched.
 
Well, blame the people here who told me to just reuse the existing page. (I don't remember who it was.)
 
6:45 PM
Actually @Crell I should probably ask clearly. In both this vote, and the previous premature opening of the vote with Nuno's implementation, I don't understand if you're unaware of the remaining issues, or just don't think they are important. Is either of those the case, or is it something else?
 
For the one last year, I was mostly ignoring the implementation and going by Nuno's statements to me. For this one, if you're referring to the "objects capture by handle so it's not as safe as you think" question... it's a mix of "didn't remember when talking to @ArnaudLeBlanc" and "PHP devs already know about that because it's the same for function args, so I don't think it's a big deal either way."
 
JRL
wait, it was suggested to have short captures not capture objects by handle? how would that work? a clone?
 
No. Danack dislikes that the RFC says that by-value capture means we don't have the spooky-action-at-a-distance issue, when technically the way objects work means it's still there, sort of, if you capture an object.
My point is "every word of that is also true of function arguments, and everyone at this point really ought to know that, so, meh".
 
@Derick This is what I've got so far. I've been through a number of iterations at this point, but something isn't linking properly. When it gets to the build step for `tests/cpputest/cpputest`, it errors out with:

Undefined symbols for architecture x86_64:
"icuToBcp47LanguageTag(char const*, char*)", referenced from:
TEST_UnicodeBcp47_FirstTest_Test::testBody() in bcp47_test.o
ld: symbol(s) not found for architecture x86_64

https://github.com/ramsey/ext-ecma_intl/compare/unit-tests
 
JRL
that behavior of "by-value" object arguments was one of my core PHP questions for senior level developers in interviews
 
6:54 PM
@cmb Anything more on switch, str_split, or mkdir? I think strtotime is also ready to go give or take @Derick's approval.
 
@Crell Technically, two spaces after the period at the end of a sentence is not the correct format. That was an artifact of old typesetting processes that required the extra space in order for typesetters to more easily find the end of a sentence. All style guides I know of (MLA, Chicago, APA, etc.) use a single period at the end of a sentence in published works.
Our high school teachers were wrong :-)
 
@ramsey See a bit further down where I note that the typewriter story is an urban legend. :-)
 
possibly an urban legend... it's unclear ;-)
what I do know is that style guides request a single period at the end of sentences for published works
depending on submission guidelines, an editor may require two spaces after the period, but it's rare these days
 
> everyone at this point really ought to know that, so, meh.
The words in the RFC say "this is safe" when that's not true. If you think "meh" about being accurate in RFCs......then it's going to result in a 'not great' RFC.
 
It's as safe as anything else in PHP.
As I said, in part I just didn't think about it when talking to Arnaud if there was anything left to tweak. So, apologies for that. But I don't see it as the major inaccuracy you seem to.
 
7:17 PM
In unrelated news, this is a fun comment from the json_encode page:

This is very useful to know when you are parsing the JSON using regular expressions to manually insert portions of data, as is the case with my current use-case (working with JSON exports of over several gigabytes requires sub-operations and insertion of data).
 
JRL
over several gigabytes....
 
"I came across the "bug" where running json_encode() over a SimpleXML object was ignoring the CDATA." - Why would you even...
 
7:34 PM
O.O
 
@Tpojka =D
 
Yup. :D
 
8:03 PM
Man, people really want to use the docs as a repository of random slug generator regex code...
I don't know if I have the stomach to try hitting comments on curl...
 
8:51 PM
@ramsey looks like you're not linking against libicu
 
9:15 PM
BTW, I voted no on auto-capture-closure. The by-value binding is more likely to cause issues for statement bodies, especially multi-statement ones, which is one reason arrow functions are a single expression.
I'd like to see & allowed at the call-site of function calls when that position is taken by reference. Nikita did not push forward with that, but he brought it up for discussion at one point. But anyway, if we had this sort of thing, then a user can get a by-reference binding simply by using it by-reference.
I don't know if it was every made into an RFC. I didn't find one with a quick search, anyway.
Maybe he wanted to keep the design space open for out/inout parameters instead?
 
9:47 PM
@LeviMorrison Can you elaborate a bit on this? Issues as in confusion, or?
 
10:21 PM
Is there anything more efficient than ReflectionReference::fromArrayElement() to determine whether a key is a reference?
Not sure whether I'm too happy allocating an object on each step here
 
10:57 PM
@Derick I am. The error is for a function in my own code. The test can’t find the function it’s trying to test.
 
11:29 PM
if function() is manual-capturing and fn { } is going to be auto-capturing, the logical progression is to make => just be "single expression function body" and allow function() =>
or even function () use (&$foo) => doSomethingWithFoo($foo);
 
@MarkR Yes.
 

« first day (4276 days earlier)      last day (658 days later) »