cvs: ZendEngine2 /tests 023.phpt
[email protected] ("Felipe Pena")
| Newsgroups | php.zend-engine.cvs |
|---|---|
| Message-ID | <cvsfelipe1208456194@cvsserver> |
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"