ant             Fri Nov 28 10:42:21 2008 UTC

  Modified files:              
    /php-src/tests/lang passByReference_008.phpt 
                        passByReference_002.phpt short_tags.004.phpt 
                        func_get_args.001.phpt short_tags.002.phpt 
                        func_get_arg.002.phpt passByReference_003.phpt 
                        passByReference_005.phpt static_basic_001.phpt 
                        func_num_args.001.phpt short_tags.001.phpt 
                        static_variation_002.phpt 
                        passByReference_004.phpt func_num_args.004.phpt 
                        passByReference_010.phpt func_get_arg.003.phpt 
                        passByReference_006.phpt short_tags.003.phpt 
                        passByReference_009.phpt 
                        static_variation_001.phpt 
                        func_get_args.003.phpt static_basic_002.phpt 
                        func_get_arg.005.phpt func_get_arg.001.phpt 
                        func_num_args.002.phpt func_num_args.003.phpt 
                        func_get_args.002.phpt passByReference_007.phpt 
                        func_get_args.004.phpt passByReference_001.phpt 
                        func_get_arg_variation.phpt 
                        func_get_arg.004.phpt 
  Log:
  Language tests: checked on PHP 5.2.6, 5.3 and 6.0 (Windows, Linux and Linux 
64 bit).
  
  
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/passByReference_008.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/passByReference_008.phpt
diff -u /dev/null php-src/tests/lang/passByReference_008.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/passByReference_008.phpt Fri Nov 28 10:42:20 2008
@@ -0,0 +1,39 @@
+--TEST--
+Pass same variable by ref and by value. 
+--FILE--
+<?php
+function valRef($x, &$y) {
+       var_dump($x, $y);
+       $x = 'changed.x';
+       $y = 'changed.y';
+}
+
+function refVal(&$x, $y) {
+       var_dump($x, $y);
+       $x = 'changed.x';
+       $y = 'changed.y';
+}
+
+
+echo "\n\n-- Val, Ref --\n";
+$a = 'original.a';
+valRef($a, $a);
+var_dump($a);
+
+echo "\n\n-- Ref, Val --\n";
+$b = 'original.b';
+refVal($b, $b);
+var_dump($b);
+?>
+--EXPECTF--
+-- Val, Ref --
+unicode(10) "original.a"
+unicode(10) "original.a"
+unicode(9) "changed.y"
+
+
+-- Ref, Val --
+unicode(10) "original.b"
+unicode(10) "original.b"
+unicode(9) "changed.x"
+
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/passByReference_002.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/passByReference_002.phpt
diff -u /dev/null php-src/tests/lang/passByReference_002.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/passByReference_002.phpt Fri Nov 28 10:42:20 2008
@@ -0,0 +1,15 @@
+--TEST--
+Attempt to pass a constant by reference
+--FILE--
+<?php
+
+function f(&$arg1)
+{
+       var_dump($arg1++);
+}
+
+f(2);
+
+?>
+--EXPECTF--
+Fatal error: Only variables can be passed by reference in %s on line 8
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/short_tags.004.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/short_tags.004.phpt
diff -u /dev/null php-src/tests/lang/short_tags.004.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/short_tags.004.phpt      Fri Nov 28 10:42:20 2008
@@ -0,0 +1,37 @@
+--TEST--
+tags
+--INI--
+short_open_tag=off
+asp_tags=off
+--FILE--
+<?='this should get echoed'?>
+
+<%= 'so should this' %>
+
+<?php
+$a = 'This gets echoed twice';
+?>
+
+<?= $a?>
+
+<%= $a%>
+
+<? $b=3; ?>
+
+<?php
+   echo "{$b}";
+?>
+--EXPECTF--
+<?='this should get echoed'?>
+
+<%= 'so should this' %>
+
+
+<?= $a?>
+
+<%= $a%>
+
+<? $b=3; ?>
+
+
+Notice: Undefined variable: b in %s on line %d
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/func_get_args.001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/func_get_args.001.phpt
diff -u /dev/null php-src/tests/lang/func_get_args.001.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/func_get_args.001.phpt   Fri Nov 28 10:42:20 2008
@@ -0,0 +1,15 @@
+--TEST--
+func_get_args with no args
+--FILE--
+<?php
+
+function foo()
+{
+       var_dump(func_get_args());      
+}
+foo();
+
+?>
+--EXPECT--
+array(0) {
+}
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/short_tags.002.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/short_tags.002.phpt
diff -u /dev/null php-src/tests/lang/short_tags.002.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/short_tags.002.phpt      Fri Nov 28 10:42:20 2008
@@ -0,0 +1,12 @@
+--TEST--
+short tags
+--INI--
+short_tags=off
+--FILE--
+<?
+echo "Used a short tag\n";
+?>
+Finished
+--EXPECT--
+Used a short tag
+Finished
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/func_get_arg.002.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/func_get_arg.002.phpt
diff -u /dev/null php-src/tests/lang/func_get_arg.002.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/func_get_arg.002.phpt    Fri Nov 28 10:42:20 2008
@@ -0,0 +1,19 @@
+--TEST--
+func_get_arg with variable number of args
+--FILE--
+<?php
+
+function foo($a)
+{
+       $b = func_get_arg(1);
+       var_dump($b);
+       $b++;
+       var_dump(func_get_arg(1));
+       
+}
+foo(2, 3);
+echo "\n";
+?>
+--EXPECT--
+int(3)
+int(3)
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/passByReference_003.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/passByReference_003.phpt
diff -u /dev/null php-src/tests/lang/passByReference_003.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/passByReference_003.phpt Fri Nov 28 10:42:20 2008
@@ -0,0 +1,48 @@
+--TEST--
+Implicit initialisation when passing by reference 
+--FILE--
+<?php
+function passbyVal($val) {
+       echo "\nInside passbyVal call:\n";
+       var_dump($val);
+}
+
+function passbyRef(&$ref) {
+       echo "\nInside passbyRef call:\n";
+       var_dump($ref);
+}
+
+echo "\nPassing undefined by value\n";
+passbyVal($undef1[0]);
+echo "\nAfter call\n";
+var_dump($undef1);
+
+echo "\nPassing undefined by reference\n";
+passbyRef($undef2[0]);
+echo "\nAfter call\n";
+var_dump($undef2)
+?>
+--EXPECTF--
+
+Passing undefined by value
+
+Notice: Undefined variable: undef1 in %s on line 13
+
+Inside passbyVal call:
+NULL
+
+After call
+
+Notice: Undefined variable: undef1 in %s on line 15
+NULL
+
+Passing undefined by reference
+
+Inside passbyRef call:
+NULL
+
+After call
+array(1) {
+  [0]=>
+  NULL
+}
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/passByReference_005.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/passByReference_005.phpt
diff -u /dev/null php-src/tests/lang/passByReference_005.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/passByReference_005.phpt Fri Nov 28 10:42:20 2008
@@ -0,0 +1,261 @@
+--TEST--
+Pass uninitialised variables by reference and by value to test implicit 
initialisation.
+--FILE--
+<?php
+
+function v($val) {
+  $val = "Val changed";
+}
+
+function r(&$ref) {
+  $ref = "Ref changed";
+}
+
+
+function vv($val1, $val2) {
+  $val1 = "Val1 changed";
+  $val2 = "Val2 changed";
+}
+
+function vr($val, &$ref) {
+  $val = "Val changed";
+  $ref = "Ref changed";
+}
+
+function rv(&$ref, $val) {
+  $val = "Val changed";
+  $ref = "Ref changed";
+}
+
+function rr(&$ref1, &$ref2) {
+  $ref1 = "Ref1 changed";
+  $ref2 = "Ref2 changed";
+}
+
+
+class C {
+
+       function __construct($val, &$ref) {
+         $val = "Val changed";
+         $ref = "Ref changed";
+       }
+
+       function v($val) {
+         $val = "Val changed";
+       }
+       
+       function r(&$ref) {
+         $ref = "Ref changed";
+       }
+       
+       function vv($val1, $val2) {
+         $val1 = "Val1 changed";
+         $val2 = "Val2 changed";
+       }
+       
+       function vr($val, &$ref) {
+         $val = "Val changed";
+         $ref = "Ref changed";
+       }
+       
+       function rv(&$ref, $val) {
+         $val = "Val changed";
+         $ref = "Ref changed";
+       }
+       
+       function rr(&$ref1, &$ref2) {
+         $ref1 = "Ref1 changed";
+         $ref2 = "Ref2 changed";
+       }
+
+} 
+
+echo "\n ---- Pass by ref / pass by val: functions ----\n";
+unset($u1, $u2);
+v($u1);
+r($u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+vv($u1, $u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+vr($u1, $u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+rv($u1, $u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+rr($u1, $u2);
+var_dump($u1, $u2);
+
+
+echo "\n\n ---- Pass by ref / pass by val: static method calls ----\n";
+unset($u1, $u2);
+C::v($u1);
+C::r($u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+C::vv($u1, $u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+C::vr($u1, $u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+C::rv($u1, $u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+C::rr($u1, $u2);
+var_dump($u1, $u2);
+
+echo "\n\n ---- Pass by ref / pass by val: instance method calls ----\n";
+unset($u1, $u2);
+$c = new C($u1, $u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+$c->v($u1);
+$c->r($u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+$c->vv($u1, $u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+$c->vr($u1, $u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+$c->rv($u1, $u2);
+var_dump($u1, $u2);
+
+unset($u1, $u2);
+$c->rr($u1, $u2);
+var_dump($u1, $u2);
+
+?>
+--EXPECTF--
+---- Pass by ref / pass by val: functions ----
+
+Notice: Undefined variable: u1 in %s on line %d
+
+Notice: Undefined variable: u1 in %s on line %d
+NULL
+unicode(11) "Ref changed"
+
+Notice: Undefined variable: u1 in %s on line %d
+
+Notice: Undefined variable: u2 in %s on line %d
+
+Notice: Undefined variable: u1 in %s on line %d
+
+Notice: Undefined variable: u2 in %s on line %d
+NULL
+NULL
+
+Notice: Undefined variable: u1 in %s on line %d
+
+Notice: Undefined variable: u1 in %s on line %d
+NULL
+unicode(11) "Ref changed"
+
+Notice: Undefined variable: u2 in %s on line %d
+
+Notice: Undefined variable: u2 in %s on line %d
+unicode(11) "Ref changed"
+NULL
+unicode(12) "Ref1 changed"
+unicode(12) "Ref2 changed"
+
+
+ ---- Pass by ref / pass by val: static method calls ----
+
+Notice: Undefined variable: u1 in %s on line %d
+
+Strict Standards: Non-static method C::v() should not be called statically in 
%s on line %d
+
+Strict Standards: Non-static method C::r() should not be called statically in 
%s on line %d
+
+Notice: Undefined variable: u1 in %s on line %d
+NULL
+unicode(11) "Ref changed"
+
+Notice: Undefined variable: u1 in %s on line %d
+
+Notice: Undefined variable: u2 in %s on line %d
+
+Strict Standards: Non-static method C::vv() should not be called statically in 
%s on line %d
+
+Notice: Undefined variable: u1 in %s on line %d
+
+Notice: Undefined variable: u2 in %s on line %d
+NULL
+NULL
+
+Notice: Undefined variable: u1 in %s on line %d
+
+Strict Standards: Non-static method C::vr() should not be called statically in 
%s on line %d
+
+Notice: Undefined variable: u1 in %s on line %d
+NULL
+unicode(11) "Ref changed"
+
+Notice: Undefined variable: u2 in %s on line %d
+
+Strict Standards: Non-static method C::rv() should not be called statically in 
%s on line %d
+
+Notice: Undefined variable: u2 in %s on line %d
+unicode(11) "Ref changed"
+NULL
+
+Strict Standards: Non-static method C::rr() should not be called statically in 
%s on line %d
+unicode(12) "Ref1 changed"
+unicode(12) "Ref2 changed"
+
+
+ ---- Pass by ref / pass by val: instance method calls ----
+
+Notice: Undefined variable: u1 in %s on line %d
+
+Notice: Undefined variable: u1 in %s on line %d
+NULL
+unicode(11) "Ref changed"
+
+Notice: Undefined variable: u1 in %s on line %d
+
+Notice: Undefined variable: u1 in %s on line %d
+NULL
+unicode(11) "Ref changed"
+
+Notice: Undefined variable: u1 in %s on line %d
+
+Notice: Undefined variable: u2 in %s on line %d
+
+Notice: Undefined variable: u1 in %s on line %d
+
+Notice: Undefined variable: u2 in %s on line %d
+NULL
+NULL
+
+Notice: Undefined variable: u1 in %s on line %d
+
+Notice: Undefined variable: u1 in %s on line %d
+NULL
+unicode(11) "Ref changed"
+
+Notice: Undefined variable: u2 in %s on line %d
+
+Notice: Undefined variable: u2 in %s on line %d
+unicode(11) "Ref changed"
+NULL
+unicode(12) "Ref1 changed"
+unicode(12) "Ref2 changed"
+
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/static_basic_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/static_basic_001.phpt
diff -u /dev/null php-src/tests/lang/static_basic_001.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/static_basic_001.phpt    Fri Nov 28 10:42:20 2008
@@ -0,0 +1,84 @@
+--TEST--
+Static keyword - basic tests
+--FILE--
+<?php
+
+echo "\nSame variable used as static and non static.\n";
+function staticNonStatic() {
+       echo "---------\n";     
+       $a=0;
+       echo "$a\n";    
+       static $a=10;
+       echo "$a\n";
+       $a++;   
+}
+staticNonStatic();
+staticNonStatic();
+staticNonStatic();
+
+echo "\nLots of initialisations in the same statement.\n";
+function manyInits() {
+       static $counter=0;
+       echo "------------- Call $counter --------------\n";
+       static $a, $b=10, $c=20, $d, $e=30;
+       echo "Unitialised      : $a\n";
+       echo "Initialised to 10: $b\n";
+       echo "Initialised to 20: $c\n";
+       echo "Unitialised      : $d\n";
+       echo "Initialised to 30: $e\n";
+       $a++;
+       $b++;
+       $c++;
+       $d++;
+       $e++;
+       $counter++;
+}
+manyInits();
+manyInits();
+manyInits();
+
+echo "\nUsing static keyword at global scope\n";
+for ($i=0; $i<3; $i++) {
+   static $s, $k=10;
+   echo "$s $k\n";
+   $s++;
+   $k++;
+}
+?>
+--EXPECT--
+
+Same variable used as static and non static.
+---------
+0
+10
+---------
+0
+11
+---------
+0
+12
+
+Lots of initialisations in the same statement.
+------------- Call 0 --------------
+Unitialised      : 
+Initialised to 10: 10
+Initialised to 20: 20
+Unitialised      : 
+Initialised to 30: 30
+------------- Call 1 --------------
+Unitialised      : 1
+Initialised to 10: 11
+Initialised to 20: 21
+Unitialised      : 1
+Initialised to 30: 31
+------------- Call 2 --------------
+Unitialised      : 2
+Initialised to 10: 12
+Initialised to 20: 22
+Unitialised      : 2
+Initialised to 30: 32
+
+Using static keyword at global scope
+ 10
+1 11
+2 12
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/func_num_args.001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/func_num_args.001.phpt
diff -u /dev/null php-src/tests/lang/func_num_args.001.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/func_num_args.001.phpt   Fri Nov 28 10:42:20 2008
@@ -0,0 +1,14 @@
+--TEST--
+func_num_args with no args
+--FILE--
+<?php
+
+function foo()
+{
+       var_dump(func_num_args());      
+}
+foo();
+
+?>
+--EXPECT--
+int(0)
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/short_tags.001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/short_tags.001.phpt
diff -u /dev/null php-src/tests/lang/short_tags.001.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/short_tags.001.phpt      Fri Nov 28 10:42:20 2008
@@ -0,0 +1,12 @@
+--TEST--
+short tags
+--INI--
+short_open_tag=on
+--FILE--
+<?
+echo "Used a short tag\n";
+?>
+Finished
+--EXPECT--
+Used a short tag
+Finished
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/static_variation_002.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/static_variation_002.phpt
diff -u /dev/null php-src/tests/lang/static_variation_002.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/static_variation_002.phpt        Fri Nov 28 10:42:20 2008
@@ -0,0 +1,84 @@
+--TEST--
+Static variables in methods & nested functions & evals.
+--FILE--
+<?php
+
+Class C {
+       function f() {
+               static $a = array(1,2,3);
+               eval(' static $k = array(4,5,6); ');
+               
+               function cfg() {
+                       static $a = array(7,8,9);
+                       eval(' static $k = array(10,11,12); ');
+                       var_dump($a, $k);
+               }
+               var_dump($a, $k);
+       }
+}
+$c = new C;
+$c->f();
+cfg();
+
+Class D {
+       static function f() {
+               eval('function dfg() { static $b = array(1,2,3); var_dump($b); 
} ');
+       }
+}
+D::f();
+dfg();
+
+eval(' Class E { function f() { static $c = array(1,2,3); var_dump($c); } }');
+$e = new E;
+$e->f();
+
+?>
+--EXPECTF--
+array(3) {
+  [0]=>
+  int(1)
+  [1]=>
+  int(2)
+  [2]=>
+  int(3)
+}
+array(3) {
+  [0]=>
+  int(4)
+  [1]=>
+  int(5)
+  [2]=>
+  int(6)
+}
+array(3) {
+  [0]=>
+  int(7)
+  [1]=>
+  int(8)
+  [2]=>
+  int(9)
+}
+array(3) {
+  [0]=>
+  int(10)
+  [1]=>
+  int(11)
+  [2]=>
+  int(12)
+}
+array(3) {
+  [0]=>
+  int(1)
+  [1]=>
+  int(2)
+  [2]=>
+  int(3)
+}
+array(3) {
+  [0]=>
+  int(1)
+  [1]=>
+  int(2)
+  [2]=>
+  int(3)
+}
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/passByReference_004.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/passByReference_004.phpt
diff -u /dev/null php-src/tests/lang/passByReference_004.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/passByReference_004.phpt Fri Nov 28 10:42:20 2008
@@ -0,0 +1,21 @@
+--TEST--
+passing the return value from a function by reference
+--FILE--
+<?php
+
+function foo(&$ref)
+{
+       var_dump($ref);
+}
+
+function bar($value)
+{
+       return $value;
+}
+
+foo(bar(5));
+
+?>
+--EXPECTF--
+Strict Standards: Only variables should be passed by reference in %s on line 13
+int(5)
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/func_num_args.004.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/func_num_args.004.phpt
diff -u /dev/null php-src/tests/lang/func_num_args.004.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/func_num_args.004.phpt   Fri Nov 28 10:42:20 2008
@@ -0,0 +1,47 @@
+--TEST--
+Pass same variable by ref and by value. 
+--FILE--
+<?php
+function valRef($x, &$y) {
+       var_dump($x, $y);
+       var_dump(func_num_args());
+       $x = 'changed.x';
+       $y = 'changed.y';
+       var_dump(func_num_args());
+}
+
+function refVal(&$x, $y) {
+       var_dump($x, $y);
+       var_dump(func_num_args());
+       $x = 'changed.x';
+       $y = 'changed.y';
+       var_dump(func_num_args());
+}
+
+
+echo "\n\n-- Val, Ref --\n";
+$a = 'original.a';
+valRef($a, $a);
+var_dump($a);
+
+echo "\n\n-- Ref, Val --\n";
+$b = 'original.b';
+refVal($b, $b);
+var_dump($b);
+?>
+--EXPECTF--
+-- Val, Ref --
+unicode(10) "original.a"
+unicode(10) "original.a"
+int(2)
+int(2)
+unicode(9) "changed.y"
+
+
+-- Ref, Val --
+unicode(10) "original.b"
+unicode(10) "original.b"
+int(2)
+int(2)
+unicode(9) "changed.x"
+
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/passByReference_010.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/passByReference_010.phpt
diff -u /dev/null php-src/tests/lang/passByReference_010.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/passByReference_010.phpt Fri Nov 28 10:42:20 2008
@@ -0,0 +1,60 @@
+--TEST--
+Passing assignments by reference
+--FILE--
+<?php
+
+function f(&$a) {
+  var_dump($a);
+  $a = "a.changed";
+} 
+
+echo "\n\n---> Pass constant assignment by reference:\n";
+f($a="a.original");
+var_dump($a); 
+
+echo "\n\n---> Pass variable assignment by reference:\n";
+unset($a);
+$a = "a.original";
+f($b = $a);
+var_dump($a); 
+
+echo "\n\n---> Pass reference assignment by reference:\n";
+unset($a, $b);
+$a = "a.original";
+f($b =& $a);
+var_dump($a); 
+
+echo "\n\n---> Pass concat assignment by reference:\n";
+unset($a, $b);
+$b = "b.original";
+$a = "a.original";
+f($b .= $a);
+var_dump($a); 
+
+?>
+--EXPECTF--
+---> Pass constant assignment by reference:
+
+Strict Standards: Only variables should be passed by reference in %s on line %d
+unicode(10) "a.original"
+unicode(10) "a.original"
+
+
+---> Pass variable assignment by reference:
+
+Strict Standards: Only variables should be passed by reference in %s on line %d
+unicode(10) "a.original"
+unicode(10) "a.original"
+
+
+---> Pass reference assignment by reference:
+unicode(10) "a.original"
+unicode(9) "a.changed"
+
+
+---> Pass concat assignment by reference:
+
+Strict Standards: Only variables should be passed by reference in %s on line %d
+unicode(20) "b.originala.original"
+unicode(10) "a.original"
+
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/func_get_arg.003.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/func_get_arg.003.phpt
diff -u /dev/null php-src/tests/lang/func_get_arg.003.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/func_get_arg.003.phpt    Fri Nov 28 10:42:20 2008
@@ -0,0 +1,11 @@
+--TEST--
+func_get_arg outside of a function declaration
+--FILE--
+<?php
+
+var_dump (func_get_arg(0));
+
+?>
+--EXPECTF--
+Warning: func_get_arg():  Called from the global scope - no function context 
in %s on line %d
+bool(false)
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/passByReference_006.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/passByReference_006.phpt
diff -u /dev/null php-src/tests/lang/passByReference_006.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/passByReference_006.phpt Fri Nov 28 10:42:20 2008
@@ -0,0 +1,243 @@
+--TEST--
+Pass uninitialised objects and arrays by reference to test implicit 
initialisation.
+--FILE--
+<?php
+
+function refs(&$ref1, &$ref2, &$ref3, &$ref4, &$ref5) {
+  $ref1 = "Ref1 changed";
+  $ref2 = "Ref2 changed";
+  $ref3 = "Ref3 changed";
+  $ref4 = "Ref4 changed";
+  $ref5 = "Ref5 changed";
+}
+
+
+class C {
+
+       function __construct(&$ref1, &$ref2, &$ref3, &$ref4, &$ref5) {
+         $ref1 = "Ref1 changed";
+         $ref2 = "Ref2 changed";
+         $ref3 = "Ref3 changed";
+         $ref4 = "Ref4 changed";
+         $ref5 = "Ref5 changed";
+       }
+
+       function refs(&$ref1, &$ref2, &$ref3, &$ref4, &$ref5) {
+         $ref1 = "Ref1 changed";
+         $ref2 = "Ref2 changed";
+         $ref3 = "Ref3 changed";
+         $ref4 = "Ref4 changed";
+         $ref5 = "Ref5 changed";
+       }
+
+} 
+
+echo "\n ---- Pass uninitialised array & object by ref: function call ---\n";
+unset($u1, $u2, $u3, $u4, $u5);
+refs($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c);
+var_dump($u1, $u2, $u3, $u4, $u5);
+
+echo "\n ---- Pass uninitialised arrays & objects by ref: static method call 
---\n";
+unset($u1, $u2, $u3, $u4, $u5);
+C::refs($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c);
+var_dump($u1, $u2, $u3, $u4, $u5);
+
+echo "\n\n---- Pass uninitialised arrays & objects by ref: constructor ---\n";
+unset($u1, $u2, $u3, $u4, $u5);
+$c = new C($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c);
+var_dump($u1, $u2, $u3, $u4, $u5);
+
+echo "\n ---- Pass uninitialised arrays & objects by ref: instance method call 
---\n";
+unset($u1, $u2, $u3, $u4, $u5);
+$c->refs($u1[0], $u2[0][1], $u3->a, $u4->a->b, $u5->a->b->c);
+var_dump($u1, $u2, $u3, $u4, $u5);
+
+?>
+--EXPECTF--
+---- Pass uninitialised array & object by ref: function call ---
+
+Strict Standards: Creating default object from empty value in %s on line %d
+
+Strict Standards: Creating default object from empty value in %s on line %d
+
+Strict Standards: Creating default object from empty value in %s on line %d
+
+Strict Standards: Creating default object from empty value in %s on line %d
+
+Strict Standards: Creating default object from empty value in %s on line %d
+
+Strict Standards: Creating default object from empty value in %s on line %d
+array(1) {
+  [0]=>
+  unicode(12) "Ref1 changed"
+}
+array(1) {
+  [0]=>
+  array(1) {
+    [1]=>
+    unicode(12) "Ref2 changed"
+  }
+}
+object(stdClass)#1 (1) {
+  [u"a"]=>
+  unicode(12) "Ref3 changed"
+}
+object(stdClass)#2 (1) {
+  [u"a"]=>
+  object(stdClass)#3 (1) {
+    [u"b"]=>
+    unicode(12) "Ref4 changed"
+  }
+}
+object(stdClass)#4 (1) {
+  [u"a"]=>
+  object(stdClass)#5 (1) {
+    [u"b"]=>
+    object(stdClass)#6 (1) {
+      [u"c"]=>
+      unicode(12) "Ref5 changed"
+    }
+  }
+}
+
+ ---- Pass uninitialised arrays & objects by ref: static method call ---
+
+Strict Standards: Creating default object from empty value in %s on line %d
+
+Strict Standards: Creating default object from empty value in %s on line %d
+
+Strict Standards: Creating default object from empty value in %s on line %d
+
+Strict Standards: Creating default object from empty value in %s on line %d
+
+Strict Standards: Creating default object from empty value in %s on line %d
+
+Strict Standards: Creating default object from empty value in %s on line %d
+
+Strict Standards: Non-static method C::refs() should not be called statically 
in %s on line %d
+array(1) {
+  [0]=>
+  unicode(12) "Ref1 changed"
+}
+array(1) {
+  [0]=>
+  array(1) {
+    [1]=>
+    unicode(12) "Ref2 changed"
+  }
+}
+object(stdClass)#4 (1) {
+  [u"a"]=>
+  unicode(12) "Ref3 changed"
+}
+object(stdClass)#5 (1) {
+  [u"a"]=>
+  object(stdClass)#6 (1) {
+    [u"b"]=>
+    unicode(12) "Ref4 changed"
+  }
+}
+object(stdClass)#2 (1) {
+  [u"a"]=>
+  object(stdClass)#3 (1) {
+    [u"b"]=>
+    object(stdClass)#1 (1) {
+      [u"c"]=>
+      unicode(12) "Ref5 changed"
+    }
+  }
+}
+
+
+---- Pass uninitialised arrays & objects by ref: constructor ---
+
+Strict Standards: Creating default object from empty value in %s on line %d
+
+Strict Standards: Creating default object from empty value in %s on line %d
+
+Strict Standards: Creating default object from empty value in %s on line %d
+
+Strict Standards: Creating default object from empty value in %s on line %d
+
+Strict Standards: Creating default object from empty value in %s on line %d
+
+Strict Standards: Creating default object from empty value in %s on line %d
+array(1) {
+  [0]=>
+  unicode(12) "Ref1 changed"
+}
+array(1) {
+  [0]=>
+  array(1) {
+    [1]=>
+    unicode(12) "Ref2 changed"
+  }
+}
+object(stdClass)#3 (1) {
+  [u"a"]=>
+  unicode(12) "Ref3 changed"
+}
+object(stdClass)#1 (1) {
+  [u"a"]=>
+  object(stdClass)#5 (1) {
+    [u"b"]=>
+    unicode(12) "Ref4 changed"
+  }
+}
+object(stdClass)#6 (1) {
+  [u"a"]=>
+  object(stdClass)#4 (1) {
+    [u"b"]=>
+    object(stdClass)#7 (1) {
+      [u"c"]=>
+      unicode(12) "Ref5 changed"
+    }
+  }
+}
+
+ ---- Pass uninitialised arrays & objects by ref: instance method call ---
+
+Strict Standards: Creating default object from empty value in %s on line %d
+
+Strict Standards: Creating default object from empty value in %s on line %d
+
+Strict Standards: Creating default object from empty value in %s on line %d
+
+Strict Standards: Creating default object from empty value in %s on line %d
+
+Strict Standards: Creating default object from empty value in %s on line %d
+
+Strict Standards: Creating default object from empty value in %s on line %d
+array(1) {
+  [0]=>
+  unicode(12) "Ref1 changed"
+}
+array(1) {
+  [0]=>
+  array(1) {
+    [1]=>
+    unicode(12) "Ref2 changed"
+  }
+}
+object(stdClass)#6 (1) {
+  [u"a"]=>
+  unicode(12) "Ref3 changed"
+}
+object(stdClass)#4 (1) {
+  [u"a"]=>
+  object(stdClass)#7 (1) {
+    [u"b"]=>
+    unicode(12) "Ref4 changed"
+  }
+}
+object(stdClass)#1 (1) {
+  [u"a"]=>
+  object(stdClass)#5 (1) {
+    [u"b"]=>
+    object(stdClass)#3 (1) {
+      [u"c"]=>
+      unicode(12) "Ref5 changed"
+    }
+  }
+}
+
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/short_tags.003.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/short_tags.003.phpt
diff -u /dev/null php-src/tests/lang/short_tags.003.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/short_tags.003.phpt      Fri Nov 28 10:42:20 2008
@@ -0,0 +1,32 @@
+--TEST--
+tags
+--INI--
+short_open_tags=on
+asp_tags=on
+--FILE--
+<?='this should get echoed'?>
+
+<%= 'so should this' %>
+
+<?php
+$a = 'This gets echoed twice';
+?>
+
+<?= $a?>
+
+<%= $a%>
+
+<? $b=3; ?>
+
+<?php
+   echo "{$b}";
+?>
+--EXPECT--
+this should get echoed
+so should this
+
+This gets echoed twice
+This gets echoed twice
+
+3
+
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/passByReference_009.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/passByReference_009.phpt
diff -u /dev/null php-src/tests/lang/passByReference_009.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/passByReference_009.phpt Fri Nov 28 10:42:20 2008
@@ -0,0 +1,24 @@
+--TEST--
+Assignement as argument
+--FILE--
+<?php
+    function foo(&$x, &$y) { $x = 1; echo $y ; }
+
+    $x = 0;
+    foo($x, $x); // prints 1 .. 
+
+
+    function foo2($x, &$y, $z)
+    {
+      echo $x; // 0
+      echo $y; // 1
+      $y = 2;
+    }
+
+    $x = 0;
+
+    foo2($x, $x, $x = 1);
+    echo $x; // 2
+?>
+--EXPECTF--
+1012
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/static_variation_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/static_variation_001.phpt
diff -u /dev/null php-src/tests/lang/static_variation_001.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/static_variation_001.phpt        Fri Nov 28 10:42:20 2008
@@ -0,0 +1,112 @@
+--TEST--
+Statics in nested functions & evals.
+--FILE--
+<?php
+
+static $a = array(7,8,9);
+
+function f1() {
+       static $a = array(1,2,3);
+
+       function g1() {
+               static $a = array(4,5,6);
+               var_dump($a);
+       }
+       
+       var_dump($a);
+       
+}
+
+f1();
+g1();
+var_dump($a);
+
+eval(' static $b = array(10,11,12); ');
+
+function f2() {
+       eval(' static $b = array(1,2,3); ');
+       
+       function g2a() {
+               eval(' static $b = array(4,5,6); ');
+               var_dump($b);           
+       }
+       
+       eval('function g2b() { static $b = array(7, 8, 9); var_dump($b); } ');
+       var_dump($b);
+}
+
+f2();
+g2a();
+g2b();
+var_dump($b);
+
+
+eval(' function f3() { static $c = array(1,2,3); var_dump($c); }');
+f3();
+
+?>
+--EXPECTF--
+array(3) {
+  [0]=>
+  int(1)
+  [1]=>
+  int(2)
+  [2]=>
+  int(3)
+}
+array(3) {
+  [0]=>
+  int(4)
+  [1]=>
+  int(5)
+  [2]=>
+  int(6)
+}
+array(3) {
+  [0]=>
+  int(7)
+  [1]=>
+  int(8)
+  [2]=>
+  int(9)
+}
+array(3) {
+  [0]=>
+  int(1)
+  [1]=>
+  int(2)
+  [2]=>
+  int(3)
+}
+array(3) {
+  [0]=>
+  int(4)
+  [1]=>
+  int(5)
+  [2]=>
+  int(6)
+}
+array(3) {
+  [0]=>
+  int(7)
+  [1]=>
+  int(8)
+  [2]=>
+  int(9)
+}
+array(3) {
+  [0]=>
+  int(10)
+  [1]=>
+  int(11)
+  [2]=>
+  int(12)
+}
+array(3) {
+  [0]=>
+  int(1)
+  [1]=>
+  int(2)
+  [2]=>
+  int(3)
+}
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/func_get_args.003.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/func_get_args.003.phpt
diff -u /dev/null php-src/tests/lang/func_get_args.003.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/func_get_args.003.phpt   Fri Nov 28 10:42:20 2008
@@ -0,0 +1,11 @@
+--TEST--
+func_get_args() outside of a function declaration
+--FILE--
+<?php
+
+var_dump(func_get_args());     
+
+?>
+--EXPECTREGEX--
+Warning\: func_get_args\(\)\:  Called from the global scope - no function 
context in \S* on line 3
+bool\(false\)
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/static_basic_002.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/static_basic_002.phpt
diff -u /dev/null php-src/tests/lang/static_basic_002.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/static_basic_002.phpt    Fri Nov 28 10:42:20 2008
@@ -0,0 +1,28 @@
+--TEST--
+Multiple declarations of the same static variable
+--FILE--
+<?php
+
+$a = 5;
+
+var_dump($a);
+
+static $a = 10;
+static $a = 11;
+
+var_dump($a);
+
+function foo() {
+       static $a = 13;
+       static $a = 14;
+       
+       var_dump($a);
+}
+
+foo();
+
+?>
+--EXPECT--
+int(5)
+int(11)
+int(14)
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/func_get_arg.005.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/func_get_arg.005.phpt
diff -u /dev/null php-src/tests/lang/func_get_arg.005.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/func_get_arg.005.phpt    Fri Nov 28 10:42:20 2008
@@ -0,0 +1,19 @@
+--TEST--
+A variable, which is referenced by another variable, is passed by value.
+During the call, the original variable is updated. This should not affect 
func_get_arg().  
+--FILE--
+<?php
+function refVal($x) {
+       global $a;
+       $a = 'changed.a';
+       var_dump($x);
+       var_dump(func_get_arg(0));
+}
+
+$a = "original.a";
+$ref =& $a;
+refVal($a);
+?>
+--EXPECTF--
+unicode(10) "original.a"
+unicode(10) "original.a"
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/func_get_arg.001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/func_get_arg.001.phpt
diff -u /dev/null php-src/tests/lang/func_get_arg.001.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/func_get_arg.001.phpt    Fri Nov 28 10:42:20 2008
@@ -0,0 +1,15 @@
+--TEST--
+func_get_arg test
+--FILE--
+<?php
+
+function foo($a)
+{
+   $a=5;
+   echo func_get_arg(0);
+}
+foo(2);
+echo "\n";
+?>
+--EXPECT--
+2
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/func_num_args.002.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/func_num_args.002.phpt
diff -u /dev/null php-src/tests/lang/func_num_args.002.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/func_num_args.002.phpt   Fri Nov 28 10:42:20 2008
@@ -0,0 +1,14 @@
+--TEST--
+func_num_args with variable number of args
+--FILE--
+<?php
+
+function foo($a)
+{
+       var_dump(func_num_args());      
+}
+foo(1, 2, 3);
+
+?>
+--EXPECT--
+int(3)
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/func_num_args.003.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/func_num_args.003.phpt
diff -u /dev/null php-src/tests/lang/func_num_args.003.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/func_num_args.003.phpt   Fri Nov 28 10:42:20 2008
@@ -0,0 +1,12 @@
+--TEST--
+func_num_args() outside of a function declaration
+--FILE--
+<?php
+
+var_dump(func_num_args());     
+
+?>
+--EXPECTF--
+
+Warning: func_num_args():  Called from the global scope - no function context 
in %s on line %d
+int(-1)
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/func_get_args.002.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/func_get_args.002.phpt
diff -u /dev/null php-src/tests/lang/func_get_args.002.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/func_get_args.002.phpt   Fri Nov 28 10:42:20 2008
@@ -0,0 +1,22 @@
+--TEST--
+func_get_args with variable number of args
+--FILE--
+<?php
+
+function foo($a)
+{
+       var_dump(func_get_args());      
+}
+foo(1, 2, 3);
+
+?>
+--EXPECT--
+array(3) {
+  [0]=>
+  int(1)
+  [1]=>
+  int(2)
+  [2]=>
+  int(3)
+}
+
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/passByReference_007.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/passByReference_007.phpt
diff -u /dev/null php-src/tests/lang/passByReference_007.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/passByReference_007.phpt Fri Nov 28 10:42:20 2008
@@ -0,0 +1,106 @@
+--TEST--
+Pass function and method calls by reference and by value.
+--FILE--
+<?php
+class C {
+       static function sreturnVal() {
+               global $a;
+               return $a;
+       }
+       
+       static function &sreturnReference() {
+               global $a;
+               return $a;
+       }
+
+       function returnVal() {
+               global $a;
+               return $a;
+       }
+       
+       function &returnReference() {
+               global $a;
+               return $a;
+       }
+}
+
+function returnVal() {
+               global $a;
+               return $a;
+}
+
+function &returnReference() {
+               global $a;
+               return $a;
+}
+
+
+
+function foo(&$ref) {
+       var_dump($ref);
+       $ref = "changed";
+}
+
+
+echo "Pass a function call that returns a value:\n";
+$a = "original";
+foo(returnVal());
+var_dump($a);
+
+echo "Pass a function call that returns a reference:\n";
+$a = "original";
+foo(returnReference());
+var_dump($a);
+
+
+echo "\nPass a static method call that returns a value:\n";
+$a = "original";
+foo(C::sreturnVal());
+var_dump($a);
+
+echo "Pass a static method call that returns a reference:\n";
+$a = "original";
+foo(C::sreturnReference());
+var_dump($a);
+
+
+$myC = new C;
+echo "\nPass a method call that returns a value:\n";
+$a = "original";
+foo($myC->returnVal());
+var_dump($a);
+
+echo "Pass a method call that returns a reference:\n";
+$a = "original";
+foo($myC->returnReference());
+var_dump($a);
+
+?>
+--EXPECTF--
+Pass a function call that returns a value:
+
+Strict Standards: Only variables should be passed by reference in %s on line %d
+unicode(8) "original"
+unicode(8) "original"
+Pass a function call that returns a reference:
+unicode(8) "original"
+unicode(7) "changed"
+
+Pass a static method call that returns a value:
+
+Strict Standards: Only variables should be passed by reference in %s on line %d
+unicode(8) "original"
+unicode(8) "original"
+Pass a static method call that returns a reference:
+unicode(8) "original"
+unicode(7) "changed"
+
+Pass a method call that returns a value:
+
+Strict Standards: Only variables should be passed by reference in %s on line %d
+unicode(8) "original"
+unicode(8) "original"
+Pass a method call that returns a reference:
+unicode(8) "original"
+unicode(7) "changed"
+
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/func_get_args.004.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/func_get_args.004.phpt
diff -u /dev/null php-src/tests/lang/func_get_args.004.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/func_get_args.004.phpt   Fri Nov 28 10:42:21 2008
@@ -0,0 +1,67 @@
+--TEST--
+Pass same variable by ref and by value. 
+--FILE--
+<?php
+function valRef($x, &$y) {
+       var_dump($x, $y);
+       var_dump(func_get_args());
+       $x = 'changed.x';
+       $y = 'changed.y';
+       var_dump(func_get_args());
+}
+
+function refVal(&$x, $y) {
+       var_dump($x, $y);
+       var_dump(func_get_args());
+       $x = 'changed.x';
+       $y = 'changed.y';
+       var_dump(func_get_args());
+}
+
+
+echo "\n\n-- Val, Ref --\n";
+$a = 'original.a';
+valRef($a, $a);
+var_dump($a);
+
+echo "\n\n-- Ref, Val --\n";
+$b = 'original.b';
+refVal($b, $b);
+var_dump($b);
+?>
+--EXPECTF--
+-- Val, Ref --
+unicode(10) "original.a"
+unicode(10) "original.a"
+array(2) {
+  [0]=>
+  unicode(10) "original.a"
+  [1]=>
+  unicode(10) "original.a"
+}
+array(2) {
+  [0]=>
+  unicode(10) "original.a"
+  [1]=>
+  unicode(9) "changed.y"
+}
+unicode(9) "changed.y"
+
+
+-- Ref, Val --
+unicode(10) "original.b"
+unicode(10) "original.b"
+array(2) {
+  [0]=>
+  unicode(10) "original.b"
+  [1]=>
+  unicode(10) "original.b"
+}
+array(2) {
+  [0]=>
+  unicode(9) "changed.x"
+  [1]=>
+  unicode(10) "original.b"
+}
+unicode(9) "changed.x"
+
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/passByReference_001.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/passByReference_001.phpt
diff -u /dev/null php-src/tests/lang/passByReference_001.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/passByReference_001.phpt Fri Nov 28 10:42:21 2008
@@ -0,0 +1,37 @@
+--TEST--
+passing of function parameters by reference
+--FILE--
+<?php
+function f($arg1, &$arg2)
+{
+       var_dump($arg1++);
+       var_dump($arg2++);
+}
+
+function g (&$arg1, &$arg2)
+{
+       var_dump($arg1);
+       var_dump($arg2);
+}
+$a = 7;
+$b = 15;
+
+f($a, $b);
+
+var_dump($a);
+var_dump($b);
+
+$c=array(1);
+g($c,$c[0]);
+
+?>
+--EXPECT--
+int(7)
+int(15)
+int(7)
+int(16)
+array(1) {
+  [0]=>
+  &int(1)
+}
+int(1)
\ No newline at end of file
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/func_get_arg_variation.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/func_get_arg_variation.phpt
diff -u /dev/null php-src/tests/lang/func_get_arg_variation.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/func_get_arg_variation.phpt      Fri Nov 28 10:42:21 2008
@@ -0,0 +1,28 @@
+--TEST--
+func_get_arg test
+--FILE--
+<?php
+
+function foo($a)
+{
+   $a=5;
+   echo func_get_arg();
+   echo func_get_arg(2,2);
+   echo func_get_arg("hello");
+   echo func_get_arg(-1);
+   echo func_get_arg(2);
+}
+foo(2);
+echo "\n";
+?>
+--EXPECTF--
+Warning: func_get_arg() expects exactly 1 parameter, 0 given in %s on line %d
+
+Warning: func_get_arg() expects exactly 1 parameter, 2 given in %s on line %d
+
+Warning: func_get_arg() expects parameter 1 to be long, Unicode string given 
in %s on line %d
+
+Warning: func_get_arg():  The argument number should be >= 0 in %s on line %d
+
+Warning: func_get_arg():  Argument 2 not passed to function in %s on line %d
+
http://cvs.php.net/viewvc.cgi/php-src/tests/lang/func_get_arg.004.phpt?r1=1.1&r2=1.2&diff_format=u
Index: php-src/tests/lang/func_get_arg.004.phpt
diff -u /dev/null php-src/tests/lang/func_get_arg.004.phpt:1.2
--- /dev/null   Fri Nov 28 10:42:21 2008
+++ php-src/tests/lang/func_get_arg.004.phpt    Fri Nov 28 10:42:21 2008
@@ -0,0 +1,16 @@
+--TEST--
+func_get_arg on non-existent arg
+--FILE--
+<?php
+
+function foo($a)
+{
+       var_dump(func_get_arg(2));      
+}
+foo(2, 3);
+echo "\n";
+
+?>
+--EXPECTF--
+Warning: func_get_arg():  Argument 2 not passed to function in %s on line %d
+bool(false)
\ No newline at end of file

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to