« first day (3443 days earlier)      last day (1502 days later) » 
00:00 - 21:0021:00 - 00:00

9:01 PM
Could anyone help me about how to export a constant AST to a string that contains fully resolved named constants? It's in connection with github.com/php/php-src/pull/4832#discussion_r377507198
I want to store the string representation of default parameters of internal functions in the arg info but I have zero clue how to continue :/
 
as opposed to caching them?
 
they are needed as reflection information (just like param types or names) e.g. to display then in error messages
 
The defaults in internal functions are provided in the stub files aren't they?
 
@MátéKocsis my attributes PR does this
 
@beberlei Thank you very much! I'll have a look at it!
 
9:09 PM
maybe i am wrong and misunderstood, but it works with constant asts
 
Although I have to look at my PR again because I forgot what I actually wanted to do :D
I have to double check my implementation - I forgot what I exactly did there ^^ but will look at yours as well!
@MarkR yes, they are! So actually, we'd generate the default value in the arg info based on the stubs.
(so my initial description was wrong)
because it's not a problem at all. however Nikita suggested to do the same with userland functions
 
openssl.c:1182:24: error: no member 'req_config' (and 'global_config') ・ Compile Failure ・ #79401
 
that's why I have to retrieve fully qualified constants from the default param AST
 
Isn't that what zend_ast_evaluate is for?
 
@MátéKocsis retrieve their value or their fully qualified representation?
 
9:22 PM
@beberlei the latter. we want to show them in error messages like
Declaration of Foo::bar(int $x = My\Class::CONST) must be compatible with ..
and it's nicer when the original value is shown :) Currently, we can't exactly do so in case of e.g. 24 * 60 * 60 (it displays 86400 currently)
@MarkR I don't know :/ But will check
@MarkR Ah no, it seems that it really evaluates the expression which is what I have to avoid :)
 
There's also some zend_ast_export functions in there
Might want to check ZEND_METHOD(reflection_parameter, getDefaultValueConstantName)
 
yes, that's what I currently use, but we have to take namespaces into account :/
 
and this is just for internal functions?
or user functions too
 
this is one of the methods that will change if my PR gets merged :) It curently retrieves the constant name from the RECV_INIT opcode for userland functions. Default params of internal functions can't be retrieved since PHP has zero reflection info about them :)
 
9:37 PM
@MátéKocsis should/could do but I'm sensing the complaints already. >-<
But then I don't know what to add more to it so
 
internal functions are pretty much ok because they are generated from the stubs. My problem is only with userland functions where I should know more about how to handle AST
@Girgias yeah, I opened the editor to start extending it... but then I realized I can't :'D
 
I don't know how you'd handle namespaces unless you looked up the AST constant name in the local namespace and then the global
I'm certainly not sure how you could then store it in the immutable zend arg info
 
@Girgias Oh, probably the WTF float to string and string to float example from Christoph should be added
 
please say that's eliminating locales xD
 
9:45 PM
Hurrar!
 
If I had to choose 1 RFC to pass between readonly properties and this one... I'd choose this one :D Not because readonly properties has 0 chance to pass now :D, but because the float to string stuff can be fixed once in 5 years...
 
mhmm
 
@MátéKocsis ah yes, currently in bed cause my gastroenteritis started acting up again so I'll try to add that tmr (or you could) will try to write a draft email to get proof read
 
@Girgias that sounds good! Get well!
 
10:07 PM
I'm getting downvoted on Reddit for saying why I voted against the req/resp rfc... i'm now even more confident in my vote
 
@MarkR Seems like you still in the positive. That's a bad sign
Change your vote quick
 
cmb
10:29 PM
@Girgias maybe point out that float to string conversion can't be optimized statically (bugs.php.net/bug.php?id=79317)
And I would acknowledge the BC break as more than minimal (but still …)
 
@beberlei just out of pure curiosity, any chance you have the data available where your rfc watch could break down votes by karma?
 
11:08 PM
@MarkR you mean to say, that explaining your vote doesn't actually make a productive conversation? And instead is a quite annoying experience? mild_shock.gif
 
@Danack As you probably saw, I posted to give a brief explanation of why on the newsgroups. I'm talking about Reddit where most people have never participated in an RFC
 
11:22 PM
@MátéKocsis whats the link to the RFC again? You didn't put it in the draft section so I can't find it :(
found it using SO chat search ...
 
11:51 PM
Edited it: wiki.php.net/rfc/locale_independent_float_to_string still need to add an example demonstrating the behaviour but don't have the head to do it now
Proof reading it would be great :)
 
"Do you want to make the float to string cast always locale-independent?"
 
(And also added to the draft section on the main RFC page so it's easier to find again)
 
drop the do you want to...
 
Could possibly be reduceed to "Make float to string casts always locale-independent?" too
Also is there a way to link to a PHP class in the docs in DokuWiki? Cause the <php> formatting doesn't do it :(
 
This is another one where I suspect making it easy to migrate away from the current behaviour might make it easier to get the RFC passed, and would make upgrading from the current behaviour be less likely break apps.
 
11:58 PM
I don't really see how that could be done tho
It something pretty fundamental
 
00:00 - 21:0021:00 - 00:00

« first day (3443 days earlier)      last day (1502 days later) »