« first day (4439 days earlier)      last day (509 days later) » 

3:11 AM
@OlleHärstedt Fun fact: If you pass 1 as chunk_size in ob_start, callback will be called for every output separately. You could filter what is shown 3v4l.org/ir1lr
 
 
6 hours later…
9:34 AM
@Krzysiek Now this is the kind of hacky magic I'm talking about :D
 
 
2 hours later…
11:06 AM
The word "int" can be parsed both as a type and as a constant depending on where it appears?
This is fine: 3v4l.org/CaIMZ
 
@OlleHärstedt Just like class names. int isn't actually a keyword in PHP.
 
@OlleHärstedt Type names are "only" reserved, so you can use them in names of constants and functions. Though I have mixed feelings if anyone should use them that way :)
 
11:21 AM
@Krzysiek Probably not, the primary reason we don't make new things keywords (when it can be avoided) is to mitigate the BC break. But it gets confusing quickly where they are allowed and where they aren't.
 
 
2 hours later…
1:29 PM
Alright, nice, thanks
This is again for polyglot code, so I don't care much if it looks weird as long as it plays well with C macros :d
 
 
3 hours later…
4:03 PM
@Sjon Attempting to run against 8.2 fails with a 404 on 3v4l in case you're not aware.
 
4:30 PM
@Trowski can confirm from yesterday. /cc @Sjon
if it's important he once wrote we're allowed to mail him ^^.
which reminds me we had no snowball something for quite some months.
 
5:00 PM
Why wouldn't this work? Comment between ampersand and argument name
Newline and whitespace works fine as long as it's NOT a comment in there T_T
 
5:12 PM
Crap this works in php 7.4
So a regression for the intersection types??
because of*
But PHP 7.4 does not accept parenthesis around new(Point) :/
 
6:12 PM
I particularly have no diff between PHP 8.0 and 8.1 tokens, but the changeset likely reveals by what that is affected.
Interesting find.
 
6:41 PM
github.com/php/php-src/issues/10083 described here in more detail, actually works in php 8.0 too but not in 8.1
Related to the intersection type lookahead regexp that only eats whitespace, not comments
 
user image
3
 
chokes
... was not expecting that from Danack
 
7:00 PM
Well, I didn't expect Mark to be into choking, and yet here we are.
 
7:49 PM
Unrelated, the writers of this show are running out of ideas and are blatantly re-hashing last seasons plotlines:
 
o////
YO
 
It's an impressive way to waste 44 billion dollars
 
I was wondering.. is php mcrypt deprecated? Should I migrate to openssl functions?
I know there were plans many years ago to remove mcrypt in php 7.2
 
mcrypt was removed in PHP 7(.1?). Yes, you should migrate to openssl or libsodium
 
though its functions are still usable in php 8.1
 
8:03 PM
It's not bundled. Someone may be maintaining the extension (or a fork) outside of core, but the underlying library was already unmaintained for a number of years as I recall.
 
oohhh okay I got it
yeah now everything makes sense
thx
 
@Danack Is that the moment where on should say that stuff that happens in the bedroom (or elsewhere) stays there :p
 
9:03 PM
undefined reference to `convert_libmagic_pattern
Missing dev lib?
Trying libmagic-dev
Is there a simple way to turn off all extensions during compilation...?
./configure --core-only
Hm, same error :d
 
9:22 PM
--disable-all
 
Testing
 
9:35 PM
Works fine, thanks!
 
@Danack I JUST SWITCHED TABS AND THOUGHT I WAS IN THE WRONG WEBSITE
2
 
Hmm, what's the tool used in Zend/zend_language_scanner.l for the regexp things?
 
9:53 PM
@SaifEddinGmati ... which website did you think it was?
 
re2c it seems
 
@MarkR we don't talk about those
 
:D
 
10:24 PM
is `__get` supposed to be allowed, or disallowed for enums? this comment (
https://github.com/php/php-src/blob/a83923044c48982c80804ae1b45e761c271966d3/Zend/zend_enum.c#L77 ) says to allow it, but the code just under the comment disallows it ( https://github.com/php/php-src/blob/a83923044c48982c80804ae1b45e761c271966d3/Zend/zend_enum.c#L82 ).
 
@Girgias You're right, I should have posted it on github.com/php/php-src/issues/10083 I regret the timidity.
 
@Danack it this enough to replace bison? :P
 
10:42 PM
@SaifEddinGmati is that your rusty replacement of the PHP parser?
 
yea, it does really well parsing types, it can actually support things that PHP parser currently can't
 
two features I currently love most with make in unspecific order: 1.) incremental build 2.) parallel build
 
now I'm wondering, if PHP errors for that code, should our parser also error?, but the thing is, our token stream takes comments outs ( they are collected and can be fetched ), so not sure how to even error.
 
@SaifEddinGmati tokenization =/= parsing, tokenizer works with PHP that does not parse just fine (must not even lint).
 
@SaifEddinGmati To be clear, I don't understand Bison or that bit of PHP core at all, but I do keep hearing that the parser is reaching the limits of what it can do.
 
10:47 PM
@hakre i don't understand what you mean by "tokenizer works with PHP that does not parse just fine"
 
@SaifEddinGmati you can tokenize php code, that does not even parse. and you can parse php code that does not run.
0 token errors, 1 parse error, not run.
0 token errors, 0 parse errors, 1 runtime error.
 
@hakre oh i know that, but in our parser, we try to error for things that we know won't work in PHP, for example, we error for readonly props with default value, as we are not building a fault tolerant parser, see: github.com/php-rust-tools/parser/blob/main/src/parser/internal/…
 
@SaifEddinGmati ah, if you want to make it strict, do so :) then you can "use the parser" (a.k.a. "use the compiler" [to find errors early]).
 
well, that's the goal, error for stuff as soon as possible, we are not planning on use it for a LSP or something like that, so there's no need to tolerate mistakes.
 
I suggest to not fully hide comments then from the token stream (if that is done), to speed up parsing token streams I found it beneficial to "shadow" comments/whitespace tokens behind their leading "not of those types" tokens. so for parsing they don't exist, but still they are in the stream.
 
10:54 PM
yea, that's what we do, we have a token stream, then whenever you try to peek/get a token, it skips comments ( and stores them in a vec ), and you can later call stream.comments() to retrieve comments that were stored.
 
I do that with simplexmlelement, they just become children of their leading token. same for whitespace. xpath operations on the sibling axis then don't see them, but with children its in the standard form. have the code not published yet, maybe around new-year.
it's not for building an ast, but just a token-tree.
and you get xml serialization for free and any parsing you apply on the tree can be re-entrant safe quite easily.
 
btw, currently we don't do anything with the comments in our parser, they just sit there in the stream, we are leaving it as the last thing in our todo list, first we need to parser everything else, then we will just slap the comments on the next statement/expression we come across.
 
@SaifEddinGmati Bison could parse this by generating a GLR parser but it just wasn't worth it for this case. Probably would've been for others (like arrow functions :( )
 
@SaifEddinGmati perhaps similar to the reason I wanted to have them out of sight, too. then had the shadowing idea and especially with the token-tree that was already there turned out very well.
 
@IluTov i think generics too would require that for stuff like foo < bar >()?
 
11:06 PM
whitespace and comment tokens work quite as separators for the other tokens by feeling.
 
@SaifEddinGmati Yeah standard generic syntax would require more lookahead as well.
 
@SaifEddinGmati while here, can you tell me if this is a bug or not? :D
 
11:26 PM
@SaifEddinGmati Assuming you wanted to ping me, __get and __set are not allowed according to the RFC, the comment is probably just wrong.
Call and invoke were considered harmless, I suppose. Although I don't see a good use-case for invoke.
 
yea, thanks!
 
11:49 PM
 
@IluTov does PHP consider /* ... / and /* ... */ the same?
 
@IluTov That will be painful to implement in highlighting for vscode lol
 

« first day (4439 days earlier)      last day (509 days later) »