]> granicus.if.org Git - php/commitdiff
test to function forward_static_call_array();
authormarcosptf <marcosptf@yahoo.com.br>
Sun, 13 Mar 2016 06:12:23 +0000 (03:12 -0300)
committerJoe Watkins <krakjoe@php.net>
Thu, 1 Jun 2017 07:19:26 +0000 (08:19 +0100)
was added new test to standard function;

ext/standard/tests/forward_static_call_array.phpt [new file with mode: 0644]

diff --git a/ext/standard/tests/forward_static_call_array.phpt b/ext/standard/tests/forward_static_call_array.phpt
new file mode 100644 (file)
index 0000000..a135a71
--- /dev/null
@@ -0,0 +1,47 @@
+--TEST--
+mixed forward_static_call_array ( callable $function , array $parameters );
+--CREDITS--
+marcosptf - <marcosptf@yahoo.com.br> - @phpsp - sao paulo - br
+--SKIPIF--
+<?php
+if (phpversion() < "5.3.0") {
+    die('SKIP php version so lower.');
+}
+?>
+--FILE--
+<?php
+
+function test() {
+    $args = func_get_args();
+    echo "C " . join(',', $args) . " \n";
+}
+
+class A {
+
+    const NAME = 'A';
+
+    public static function test() {
+        $args = func_get_args();
+        echo static::NAME, " " . join(',', $args) . " \n";
+    }
+
+}
+
+class B extends A {
+
+    const NAME = 'B';
+
+    public static function test() {
+        echo self::NAME, "\n";
+        forward_static_call_array(array('A', 'test'), array('more', 'args'));
+        forward_static_call_array('test', array('other', 'args'));
+    }
+
+}
+
+B::test('foo');
+?>
+--EXPECT--
+B
+B more,args 
+C other,args