Skip to content

Conversation

hikari-no-yume
Copy link
Contributor

The pull request of the RFC: https://wiki.php.net/rfc/closure_apply

@@ -32,14 +32,16 @@ $cas->bindTo($a, 'A');

?>
--EXPECTF--
Notice: Array to string conversion in %s on line %d
Notice: Array to string conversion in %s on line 24
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why you change %d here? by accident?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Initially yes, but I don't think you should use %d with line numbers as they're not going to change.

zend_function my_function;

if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "o*", &newthis, &my_params, &my_param_count) == FAILURE) {
RETURN_NULL();
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

simply return; here is enough(it's a tradition :)

@php-pulls php-pulls merged commit 2cdd5ba into php:master Aug 27, 2014
@hikari-no-yume
Copy link
Contributor Author

@laruence zend_stdint.h doesn't exist, and we're supposed to use php_stdint.h for uint32_t.

@hikari-no-yume
Copy link
Contributor Author

Also, uint32_t is the type of param_count. Why should I use int?

@datibbaw
Copy link
Contributor

@TazeTSchnitzel Because of the this ;-)

@hikari-no-yume
Copy link
Contributor Author

@datibbaw zpp is wrong though, you're almost always calling it with &fci.param_count, which is a uint32_t. We should fix zpp, not my code.

@laruence
Copy link
Member

@TazeTSchnitzel in that case, I would like make fci.param_count as int instead of include a php/stdint.h into Zend...

@laruence
Copy link
Member

or , maybe use zend_long.h here. (it depends on stdint.h now, I will definitely ask welting to re-think about it)

@laruence
Copy link
Member

anyway, please, use int for now... and do not include "dependence out of Zend"

@nikic
Copy link
Member

nikic commented Aug 27, 2014

zend.h already includes the stdint header. You can use uint32_t here without any additional includes.

@hikari-no-yume
Copy link
Contributor Author

@nikic Shouldn't I explicitly include what I use, rather than relying on zend.h happening to include a billion headers?

@nikic
Copy link
Member

nikic commented Aug 27, 2014

zend_closure.c already includes zend.h. Source files should pretty much always include it.

@hikari-no-yume
Copy link
Contributor Author

@nikic That's not my point. Surely I should still include it explicitly rather than relying on zend.h happening to include it?

@nikic
Copy link
Member

nikic commented Aug 27, 2014

No, you should not include it explicitly. Only include the files that are not present in zend.h.

@hikari-no-yume
Copy link
Contributor Author

@nikic Ah, fair enough.

@laruence
Copy link
Member

great, then problem gone..

@hikari-no-yume
Copy link
Contributor Author

Fixed incorrect names in NEWS and UPGRADING identified by @thekid: 87c28cc

@thekid
Copy link
Contributor

thekid commented Oct 25, 2014

Fixed incorrect names in NEWS and UPGRADING

👍

@@ -9,6 +9,7 @@ PHP NEWS

- Core:
. Added PHP_INT_MIN constant. (Andrea)
. Added Closure::apply() method. (Andrea)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The code says Closure:call(). Following JavaScript it should be called apply() and a varargs version should be calles call().

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No, it's called call for consistency with JS. JS's call isn't varargs. JS's apply is.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah, misunderstood the implementation. Still, the NEWS file needs fixing. Do you plan on adding apply as well?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The NEWS file was already fixed. And there's no need for apply, given we have splats.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants