-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
I saw public function map(array! data)
in closures.md but as far as I can tell that exclamation mark is not explained elsewhere: https://github.com/search?q=repo%3Azephir-lang%2Fdocumentation%20!&type=code
I believe it's declared here: https://github.com/zephir-lang/php-zephir-parser/blob/ac23688ea0283b713295950d57b23f08c8637cc0/parser/zephir.lemon#L776 comparing it to a normal one and the C function signature:
xx_ret_parameter(zval *ret, int const_param, zval *type, zval *cast, xx_parser_token *N, zval *default_value, int mandatory, int reference, xx_scanner_state *state)
// type a
xx_parameter(R) ::= xx_parameter_type(T) IDENTIFIER(I) . {
xx_ret_parameter(&R, 0, &T, NULL, I, NULL, 0, 0, status->scanner_state);
}
// type! a
xx_parameter(R) ::= xx_parameter_type(T) NOT IDENTIFIER(I) . {
xx_ret_parameter(&R, 0, &T, NULL, I, NULL, 1, 0, status->scanner_state);
}
So does this all mean public function map(array data)
has an optional argument and public function map(array! data)
has a required argument?
Metadata
Metadata
Assignees
Labels
No labels