1
0
mirror of https://github.com/php/php-src.git synced 2026-04-20 22:41:20 +02:00

Rename ::apply to ::call for the sake of JS consistency

This commit is contained in:
Andrea Faulds
2014-07-30 01:26:53 +01:00
parent d67ec70a4c
commit f65bdda469
2 changed files with 9 additions and 9 deletions

View File

@@ -1,5 +1,5 @@
--TEST--
Closure::apply
Closure::call
--FILE--
<?php
@@ -19,8 +19,8 @@ $foobar = new Foo;
$foobar->x = 3;
var_dump($qux());
var_dump($qux->apply($foo));
var_dump($qux->apply($foobar));
var_dump($qux->call($foo));
var_dump($qux->call($foobar));
$bar = function () {
@@ -30,14 +30,14 @@ $bar = function () {
$elePHPant = new StdClass;
$elePHPant->x = 7;
var_dump($bar->apply($elePHPant));
var_dump($bar->call($elePHPant));
$beta = function ($z) {
return $this->x * $z;
};
var_dump($beta->apply($elePHPant, 3));
var_dump($beta->call($elePHPant, 3));
?>
--EXPECT--

View File

@@ -70,9 +70,9 @@ ZEND_METHOD(Closure, __invoke) /* {{{ */
}
/* }}} */
/* {{{ proto mixed Closure::apply(object $to [, mixed $parameter] [, mixed $...] )
/* {{{ proto mixed Closure::call(object $to [, mixed $parameter] [, mixed $...] )
Call closure, binding to a given object */
ZEND_METHOD(Closure, apply) /* {{{ */
ZEND_METHOD(Closure, call) /* {{{ */
{
zval *zclosure, *newthis, *closure_result_ptr = NULL;
zend_closure *closure;
@@ -457,7 +457,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_closure_bind, 0, 0, 2)
ZEND_ARG_INFO(0, unbound_scoped)
ZEND_END_ARG_INFO()
ZEND_BEGIN_ARG_INFO_EX(arginfo_closure_apply, 0, 0, 1)
ZEND_BEGIN_ARG_INFO_EX(arginfo_closure_call, 0, 0, 1)
ZEND_ARG_INFO(0, newthis)
ZEND_ARG_VARIADIC_INFO(0, parameters)
ZEND_END_ARG_INFO()
@@ -466,7 +466,7 @@ static const zend_function_entry closure_functions[] = {
ZEND_ME(Closure, __construct, NULL, ZEND_ACC_PRIVATE)
ZEND_ME(Closure, bind, arginfo_closure_bind, ZEND_ACC_PUBLIC|ZEND_ACC_STATIC)
ZEND_MALIAS(Closure, bindTo, bind, arginfo_closure_bindto, ZEND_ACC_PUBLIC)
ZEND_ME(Closure, apply, arginfo_closure_apply, ZEND_ACC_PUBLIC)
ZEND_ME(Closure, call, arginfo_closure_call, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
};