]> granicus.if.org Git - php/commitdiff
- New test
authorFelipe Pena <felipe@php.net>
Thu, 17 Apr 2008 18:16:34 +0000 (18:16 +0000)
committerFelipe Pena <felipe@php.net>
Thu, 17 Apr 2008 18:16:34 +0000 (18:16 +0000)
Zend/tests/023.phpt [new file with mode: 0644]

diff --git a/Zend/tests/023.phpt b/Zend/tests/023.phpt
new file mode 100644 (file)
index 0000000..8912ad1
--- /dev/null
@@ -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"