cvs: ZendEngine2 /tests 023.phpt
| From: | Felipe Pena | Date: | Thu, 17 Apr 2008 18:16:34 +0000 |
| Subject: | cvs: ZendEngine2 /tests 023.phpt | ||
| Groups: | php.zend-engine.cvs | ||
| Request: | Send a blank email to php-zend-engine-cvs+get-6627@lists.php.net to get a copy of this message | ||
felipe Thu Apr 17 18:16:34 2008 UTC
Modified files:
/ZendEngine2/tests 023.phpt
Log:
- New test
http://cvs.php.net/viewvc.cgi/ZendEngine2/tests/023.phpt?r1=1.1&r2=1.2&diff_format=u
Index: ZendEngine2/tests/023.phpt
diff -u /dev/null ZendEngine2/tests/023.phpt:1.2
--- /dev/null Thu Apr 17 18:16:34 2008
+++ ZendEngine2/tests/023.phpt Thu Apr 17 18:16:34 2008
@@ -0,0 +1,50 @@
+--TEST--
+Testing variable variables as function name
+--FILE--
+<?php
+
+$a = 'ucfirst';
+$b = 'a';
+print $$b('test');
+print "\n";
+
+
+class bar {
+ public function a() {
+ return "bar!";
+ }
+}
+
+class foo {
+ public function test() {
+ print "foo!\n";
+ return new bar;
+ }
+}
+
+function test() {
+ return new foo;
+}
+
+$a = 'test';
+$b = 'a';
+var_dump($$b()->$$b()->$b());
+
+
+$a = 'strtoupper';
+$b = 'a';
+$c = 'b';
+$d = 'c';
+var_dump($$$$d('foo'));
+
+?>
+--EXPECT--
+Test
+foo!
+string(4) "bar!"
+string(3) "FOO"
+--UEXPECT--
+Test
+foo!
+unicode(4) "bar!"
+unicode(3) "FOO"