@QuolonelQuestions Right, but the other way around. Most languages use these terms, the other ones I've heard is formal and actual arguments.
@QuolonelQuestions It's because of the default case for switch/match. switch ($foo) { default: ... }, where the parser doesn't know if default refers to the expr or case_list non-terminal.
You can fix that by removing the T_DEFAULT case from case_list and match_arm, and then check for the T_DEFAULT ast marker in the compiler, instead of a NULL condition.
That said, this remains ambiguous: foo(match ('foo') { default => 'bar' }). Does default refer to the default argument value, or to the default case? It's not obvious.
But are you sure? The doc says INI_SYSTEM, meaning it has to be set in the INI, no?
I think maybe it's not even built :<
Do you have to build it separately or is there just a configure flag or something to include it in the build?
@IluTov I understood from our previous discussion that that is basically what we would be doing (maybe I could even call it directly?) but I am not even that far yet. Still need to understand how everything else fits together
In particular, I don't really understand how to know when is the correct time to raise an opcode and how state between opcodes works
I'm experiencing very exasperating behaviour, where my breakpoints won't trigger any more in zend_compile.c, or, my opcodes aren't output when running normally. It's literally random because, without changing any settings, it just starts/stops working again
Generally they seem to be mutually exclusive. I either get the opcodes or I get breakpoints
I'm even running with -d opcache.enable_cli=0 in the IDE to make sure opcache isn't skipping the compiler
@IluTov I really can't figure it out at all. zend_compile_args knows what arg index it is because it's looping over them all, but it will eventually call zend_compile_expr passing only the AST for my expression and that contains no information whatsoever about the current arg we're processing (even though zend_compile_args knows, and it's sitting just a few frames up the call stack...)
I did figure out that CG(active_op_array)->T actually has a pointer to it but that doesn't seem like the correct way to do it...
@QuolonelQuestions You likely need to keep track of the param index in zend_compile_args() using something similar to CG(context). CG(active_op_array)->T is not what you're looking for. 1. it doesn't refer to params but temporary variables and 2. it's for the current function, not the called function.