[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/ext/intl/common/common_error.c trunk/ext/intl/common/common_error.c

2011-11-26 Thread Gustavo André dos Santos Lopes
cataphract   Sat, 26 Nov 2011 14:55:31 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=319952

Log:
- Fixed bug #60392 (U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR undeclared)
  (fedora at famillecollet dot com)

Bug: https://bugs.php.net/60392 (Open)  'U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR' 
undeclared
  
Changed paths:
U   php/php-src/branches/PHP_5_4/ext/intl/common/common_error.c
U   php/php-src/trunk/ext/intl/common/common_error.c

Modified: php/php-src/branches/PHP_5_4/ext/intl/common/common_error.c
===
--- php/php-src/branches/PHP_5_4/ext/intl/common/common_error.c 2011-11-26 
12:08:23 UTC (rev 319951)
+++ php/php-src/branches/PHP_5_4/ext/intl/common/common_error.c 2011-11-26 
14:55:31 UTC (rev 319952)
@@ -241,7 +241,9 @@
INTL_EXPOSE_CONST( U_IDNA_VERIFICATION_ERROR );
INTL_EXPOSE_CONST( U_IDNA_LABEL_TOO_LONG_ERROR );
INTL_EXPOSE_CONST( U_IDNA_ZERO_LENGTH_LABEL_ERROR );
+#if U_ICU_VERSION_MAJOR_NUM  3 || U_ICU_VERSION_MAJOR_NUM == 3  
U_ICU_VERSION_MINOR_NUM = 8
INTL_EXPOSE_CONST( U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR );
+#endif
INTL_EXPOSE_CONST( U_IDNA_ERROR_LIMIT );

/* Aliases for StringPrep */

Modified: php/php-src/trunk/ext/intl/common/common_error.c
===
--- php/php-src/trunk/ext/intl/common/common_error.c2011-11-26 12:08:23 UTC 
(rev 319951)
+++ php/php-src/trunk/ext/intl/common/common_error.c2011-11-26 14:55:31 UTC 
(rev 319952)
@@ -241,7 +241,9 @@
INTL_EXPOSE_CONST( U_IDNA_VERIFICATION_ERROR );
INTL_EXPOSE_CONST( U_IDNA_LABEL_TOO_LONG_ERROR );
INTL_EXPOSE_CONST( U_IDNA_ZERO_LENGTH_LABEL_ERROR );
+#if U_ICU_VERSION_MAJOR_NUM  3 || U_ICU_VERSION_MAJOR_NUM == 3  
U_ICU_VERSION_MINOR_NUM = 8
INTL_EXPOSE_CONST( U_IDNA_DOMAIN_NAME_TOO_LONG_ERROR );
+#endif
INTL_EXPOSE_CONST( U_IDNA_ERROR_LIMIT );

/* Aliases for StringPrep */

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/NEWS branches/PHP_5_3/ext/date/lib/parse_date.c branches/PHP_5_3/ext/date/lib/parse_date.re branches/PHP_5_3/ext/date/tests/bug54851.phpt branches/PHP_5_4

2011-11-26 Thread Derick Rethans
derick   Sat, 26 Nov 2011 16:44:21 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=319960

Log:
- Fixed bug #54851 (DateTime::createFromFormat() doesn't interpret D).

Bug: https://bugs.php.net/54851 (Assigned) DateTime::createFromFormat, 
$format=='D' or $format=='l' Always Returns Today.
  
Changed paths:
U   php/php-src/branches/PHP_5_3/NEWS
U   php/php-src/branches/PHP_5_3/ext/date/lib/parse_date.c
U   php/php-src/branches/PHP_5_3/ext/date/lib/parse_date.re
A   php/php-src/branches/PHP_5_3/ext/date/tests/bug54851.phpt
U   php/php-src/branches/PHP_5_4/ext/date/lib/parse_date.c
U   php/php-src/branches/PHP_5_4/ext/date/lib/parse_date.re
A   php/php-src/branches/PHP_5_4/ext/date/tests/bug54851.phpt
U   php/php-src/trunk/ext/date/lib/parse_date.c
U   php/php-src/trunk/ext/date/lib/parse_date.re
A   php/php-src/trunk/ext/date/tests/bug54851.phpt

Modified: php/php-src/branches/PHP_5_3/NEWS
===
--- php/php-src/branches/PHP_5_3/NEWS	2011-11-26 16:13:39 UTC (rev 319959)
+++ php/php-src/branches/PHP_5_3/NEWS	2011-11-26 16:44:21 UTC (rev 319960)
@@ -33,6 +33,8 @@
 timestamp). (Derick)
   . Fixed bug #55253 (DateTime::add() and sub() result -1 hour on objects with
 time zone type 2). (Derick)
+  . Fixed bug #54851 (DateTime::createFromFormat() doesn't interpret D).
+(Derick)
   . Fixed bug #54596 (incorrect years for DateTime objects created with 4-digit
 years). (Derick)


Modified: php/php-src/branches/PHP_5_3/ext/date/lib/parse_date.c
===
--- php/php-src/branches/PHP_5_3/ext/date/lib/parse_date.c	2011-11-26 16:13:39 UTC (rev 319959)
+++ php/php-src/branches/PHP_5_3/ext/date/lib/parse_date.c	2011-11-26 16:44:21 UTC (rev 319960)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Fri Nov 25 16:42:41 2011 */
+/* Generated by re2c 0.13.5 on Sat Nov 26 16:43:31 2011 */
 #line 1 ext/date/lib/parse_date.re
 /*
+--+
@@ -24917,8 +24917,19 @@
 		switch (*fptr) {
 			case 'D': /* three letter day */
 			case 'l': /* full day */
-if (!timelib_lookup_relunit((char **) ptr)) {
-	add_pbf_error(s, A textual day could not be found, string, begin);
+{
+	const timelib_relunit* tmprel = 0;
+
+	tmprel = timelib_lookup_relunit((char **) ptr);
+	if (!tmprel) {
+		add_pbf_error(s, A textual day could not be found, string, begin);
+		break;
+	} else {
+		in.time-have_relative = 1;
+		in.time-relative.have_weekday_relative = 1;
+		in.time-relative.weekday = tmprel-multiplier;
+		in.time-relative.weekday_behavior = 1;
+	}
 }
 break;
 			case 'd': /* two digit day, with leading zero */
@@ -25001,15 +25012,31 @@
 }
 break;
 			case 'i': /* two digit minute, with leading zero */
-TIMELIB_CHECK_NUMBER;
-if ((s-time-i = timelib_get_nr((char **) ptr, 2)) == TIMELIB_UNSET) {
-	add_pbf_error(s, A two digit minute could not be found, string, begin);
+{
+	int length;
+	timelib_sll min;
+
+	TIMELIB_CHECK_NUMBER;
+	min = timelib_get_nr_ex((char **) ptr, 2, length);
+	if (min == TIMELIB_UNSET || length != 2) {
+		add_pbf_error(s, A two digit minute could not be found, string, begin);
+	} else {
+		s-time-i = min;
+	}
 }
 break;
 			case 's': /* two digit second, with leading zero */
-TIMELIB_CHECK_NUMBER;
-if ((s-time-s = timelib_get_nr((char **) ptr, 2)) == TIMELIB_UNSET) {
-	add_pbf_error(s, A two digit second could not be found, string, begin);
+{
+	int length;
+	timelib_sll sec;
+
+	TIMELIB_CHECK_NUMBER;
+	sec = timelib_get_nr_ex((char **) ptr, 2, length);
+	if (sec == TIMELIB_UNSET || length != 2) {
+		add_pbf_error(s, A two second minute could not be found, string, begin);
+	} else {
+		s-time-s = sec;
+	}
 }
 break;
 			case 'u': /* up to six digit millisecond */

Modified: php/php-src/branches/PHP_5_3/ext/date/lib/parse_date.re
===
--- php/php-src/branches/PHP_5_3/ext/date/lib/parse_date.re	2011-11-26 16:13:39 UTC (rev 319959)
+++ php/php-src/branches/PHP_5_3/ext/date/lib/parse_date.re	2011-11-26 16:44:21 UTC (rev 319960)
@@ -1924,8 +1924,19 @@
 		switch (*fptr) {
 			case 'D': /* three letter day */
 			case 'l': /* full day */
-if (!timelib_lookup_relunit((char **) ptr)) {
-	add_pbf_error(s, A textual day could not be found, string, begin);
+{
+	const timelib_relunit* tmprel = 0;
+
+	tmprel = timelib_lookup_relunit((char **) ptr);
+	if (!tmprel) {
+		add_pbf_error(s, A textual day could not be found, string, begin);
+		break;
+	} else {
+		in.time-have_relative = 1;
+		in.time-relative.have_weekday_relative = 1;
+		in.time-relative.weekday = 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/tests/classes/ctor_in_interface_02.phpt branches/PHP_5_4/tests/classes/ctor_in_interface_02.phpt trunk/tests/classes/ctor_in_interface_02.phpt

2011-11-26 Thread Felipe Pena
felipe   Sat, 26 Nov 2011 17:35:19 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=319962

Log:
- Fix test

Changed paths:
U   php/php-src/branches/PHP_5_3/tests/classes/ctor_in_interface_02.phpt
U   php/php-src/branches/PHP_5_4/tests/classes/ctor_in_interface_02.phpt
U   php/php-src/trunk/tests/classes/ctor_in_interface_02.phpt

Modified: php/php-src/branches/PHP_5_3/tests/classes/ctor_in_interface_02.phpt
===
--- php/php-src/branches/PHP_5_3/tests/classes/ctor_in_interface_02.phpt
2011-11-26 17:30:03 UTC (rev 319961)
+++ php/php-src/branches/PHP_5_3/tests/classes/ctor_in_interface_02.phpt
2011-11-26 17:35:19 UTC (rev 319962)
@@ -32,4 +32,4 @@

 ?
 --EXPECTF--
-Fatal error: Can't inherit abstract function constr3::__construct() 
(previously declared abstract in constr1) in %s on line %d
+Fatal error: Declaration of implem13::__construct() must be compatible with 
constr3::__construct($a) in %s on line %d

Modified: php/php-src/branches/PHP_5_4/tests/classes/ctor_in_interface_02.phpt
===
--- php/php-src/branches/PHP_5_4/tests/classes/ctor_in_interface_02.phpt
2011-11-26 17:30:03 UTC (rev 319961)
+++ php/php-src/branches/PHP_5_4/tests/classes/ctor_in_interface_02.phpt
2011-11-26 17:35:19 UTC (rev 319962)
@@ -32,4 +32,4 @@

 ?
 --EXPECTF--
-Fatal error: Can't inherit abstract function constr3::__construct() 
(previously declared abstract in constr1) in %s on line %d
+Fatal error: Declaration of implem13::__construct() must be compatible with 
constr3::__construct($a) in %s on line %d

Modified: php/php-src/trunk/tests/classes/ctor_in_interface_02.phpt
===
--- php/php-src/trunk/tests/classes/ctor_in_interface_02.phpt   2011-11-26 
17:30:03 UTC (rev 319961)
+++ php/php-src/trunk/tests/classes/ctor_in_interface_02.phpt   2011-11-26 
17:35:19 UTC (rev 319962)
@@ -32,4 +32,4 @@

 ?
 --EXPECTF--
-Fatal error: Can't inherit abstract function constr3::__construct() 
(previously declared abstract in constr1) in %s on line %d
+Fatal error: Declaration of implem13::__construct() must be compatible with 
constr3::__construct($a) in %s on line %d

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

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/ext/sockets/sockets.c branches/PHP_5_4/ext/sockets/tests/mcast_ipv4_send_error.phpt trunk/ext/sockets/sockets.c trunk/ext/sockets/tests/mcast_ipv4_send_er

2011-11-26 Thread Gustavo André dos Santos Lopes
cataphract   Sat, 26 Nov 2011 17:48:52 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=319963

Log:
- Small ajustments to some multicast options.

Changed paths:
U   php/php-src/branches/PHP_5_4/ext/sockets/sockets.c
A   
php/php-src/branches/PHP_5_4/ext/sockets/tests/mcast_ipv4_send_error.phpt
U   php/php-src/trunk/ext/sockets/sockets.c
A   php/php-src/trunk/ext/sockets/tests/mcast_ipv4_send_error.phpt

Modified: php/php-src/branches/PHP_5_4/ext/sockets/sockets.c
===
--- php/php-src/branches/PHP_5_4/ext/sockets/sockets.c  2011-11-26 17:35:19 UTC 
(rev 319962)
+++ php/php-src/branches/PHP_5_4/ext/sockets/sockets.c  2011-11-26 17:48:52 UTC 
(rev 319963)
@@ -2189,8 +2189,16 @@
goto dosockopt;

case IP_MULTICAST_LOOP:
+   convert_to_boolean_ex(arg4);
+   goto ipv4_loop_ttl;
case IP_MULTICAST_TTL:
convert_to_long_ex(arg4);
+   if (Z_LVAL_PP(arg4)  0L || Z_LVAL_PP(arg4)  255L) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING,
+   Expected a value between 0 and 
255);
+   RETURN_FALSE;
+   }
+ipv4_loop_ttl:
ipv4_mcast_ttl_lback = (unsigned char) Z_LVAL_PP(arg4);
opt_ptr = ipv4_mcast_ttl_lback;
optlen  = sizeof(ipv4_mcast_ttl_lback);
@@ -2225,8 +2233,16 @@
goto dosockopt;

case IPV6_MULTICAST_LOOP:
+   convert_to_boolean_ex(arg4);
+   goto ipv6_loop_hops;
case IPV6_MULTICAST_HOPS:
convert_to_long_ex(arg4);
+   if (Z_LVAL_PP(arg4)  -1L || Z_LVAL_PP(arg4)  255L) {
+   php_error_docref(NULL TSRMLS_CC, E_WARNING,
+   Expected a value between -1 
and 255);
+   RETURN_FALSE;
+   }
+ipv6_loop_hops:
ov = (int) Z_LVAL_PP(arg4);
opt_ptr = ov;
optlen  = sizeof(ov);

Added: php/php-src/branches/PHP_5_4/ext/sockets/tests/mcast_ipv4_send_error.phpt
===
--- php/php-src/branches/PHP_5_4/ext/sockets/tests/mcast_ipv4_send_error.phpt   
(rev 0)
+++ php/php-src/branches/PHP_5_4/ext/sockets/tests/mcast_ipv4_send_error.phpt   
2011-11-26 17:48:52 UTC (rev 319963)
@@ -0,0 +1,79 @@
+--TEST--
+Multicast support: IPv4 send options with unusual values
+--SKIPIF--
+?php
+if (!extension_loaded('sockets')) {
+die('skip sockets extension not available.');
+}
+if (socket_set_option($s, $level, IP_MULTICAST_IF, 1) === false) {
+   die(skip interface 1 either doesn't exist or has no ipv4 address);
+}
+--FILE--
+?php
+$domain = AF_INET;
+$level = IPPROTO_IP;
+$s = socket_create($domain, SOCK_DGRAM, SOL_UDP) or die(err);
+
+echo Setting IP_MULTICAST_LOOP with 256\n;
+//if we had a simple cast to unsigned char, this would be the same as 0
+$r = socket_set_option($s, $level, IP_MULTICAST_LOOP, 256);
+var_dump($r);
+$r = socket_get_option($s, $level, IP_MULTICAST_LOOP);
+var_dump($r);
+echo \n;
+
+echo Setting IP_MULTICAST_LOOP with false\n;
+//should convert to (unsigned char)0
+$r = socket_set_option($s, $level, IP_MULTICAST_LOOP, false);
+var_dump($r);
+$r = socket_get_option($s, $level, IP_MULTICAST_LOOP);
+var_dump($r);
+echo \n;
+
+echo Setting IP_MULTICAST_TTL with 256\n;
+//if we had a simple cast to unsigned char, this would be the same as 0
+$r = socket_set_option($s, $level, IP_MULTICAST_TTL, 256);
+var_dump($r);
+$r = socket_get_option($s, $level, IP_MULTICAST_TTL);
+var_dump($r);
+echo \n;
+
+echo Setting IP_MULTICAST_TTL with \254\\n;
+$r = socket_set_option($s, $level, IP_MULTICAST_TTL, 254);
+var_dump($r);
+$r = socket_get_option($s, $level, IP_MULTICAST_TTL);
+var_dump($r);
+echo \n;
+
+echo Setting IP_MULTICAST_TTL with -1\n;
+//should give error, not be the same as 255
+$r = socket_set_option($s, $level, IP_MULTICAST_TTL, -1);
+var_dump($r);
+$r = socket_get_option($s, $level, IP_MULTICAST_TTL);
+var_dump($r);
+echo \n;
+
+--EXPECTF--
+Setting IP_MULTICAST_LOOP with 256
+bool(true)
+int(1)
+
+Setting IP_MULTICAST_LOOP with false
+bool(true)
+int(0)
+
+Setting IP_MULTICAST_TTL with 256
+
+Warning: socket_set_option(): Expected a value between 0 and 255 in %s on line 
%d
+bool(false)
+int(1)
+
+Setting IP_MULTICAST_TTL with 254
+bool(true)
+int(254)
+
+Setting IP_MULTICAST_TTL with -1
+
+Warning: socket_set_option(): Expected a value between 0 and 255 in %s on line 
%d
+bool(false)
+int(254)


Property changes on: 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2011-11-26 Thread Felipe Pena
felipe   Sat, 26 Nov 2011 17:56:43 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=319964

Log:
- Fixed bug #55788 (test redirects should abide SHOW_ONLY_GROUPS in 
run-tests.php)
  patch by: tyrael at php.net

Bug: https://bugs.php.net/55788 (Open) test redirects should abide 
SHOW_ONLY_GROUPS in run-tests.php
  
Changed paths:
U   php/php-src/branches/PHP_5_3/run-tests.php
U   php/php-src/branches/PHP_5_4/run-tests.php
U   php/php-src/trunk/run-tests.php

Modified: php/php-src/branches/PHP_5_3/run-tests.php
===
--- php/php-src/branches/PHP_5_3/run-tests.php  2011-11-26 17:48:52 UTC (rev 
319963)
+++ php/php-src/branches/PHP_5_3/run-tests.php  2011-11-26 17:56:43 UTC (rev 
319964)
@@ -678,7 +678,7 @@
 with value 'bar').

 -g  Comma seperated list of groups to show during test run
-(e.x. FAIL,SKIP).
+(possible values: PASS, FAIL, XFAIL, SKIP, BORK, WARN, LEAK, 
REDIRECT).

 -m  Test for memory leaks with Valgrind.

@@ -2384,24 +2384,34 @@

 function show_redirect_start($tests, $tested, $tested_file)
 {
-   global $html_output, $html_file;
+   global $html_output, $html_file, $line_length, $SHOW_ONLY_GROUPS;

if ($html_output) {
fwrite($html_file, trtd colspan='3'---gt; $tests ($tested 
[$tested_file]) begin/td/tr\n);
}

-   echo --- $tests ($tested [$tested_file]) begin\n;
+   if (!$SHOW_ONLY_GROUPS || in_array('REDIRECT', $SHOW_ONLY_GROUPS)) {
+  echo REDIRECT $tests ($tested [$tested_file]) begin\n;
+   } else {
+  // Write over the last line to avoid random trailing chars 
on next echo
+  echo str_repeat( , $line_length), \r;
+   }
 }

 function show_redirect_ends($tests, $tested, $tested_file)
 {
-   global $html_output, $html_file;
+   global $html_output, $html_file, $line_length, $SHOW_ONLY_GROUPS;

if ($html_output) {
fwrite($html_file, trtd colspan='3'---gt; $tests ($tested 
[$tested_file]) done/td/tr\n);
}

-   echo --- $tests ($tested [$tested_file]) done\n;
+   if (!$SHOW_ONLY_GROUPS || in_array('REDIRECT', $SHOW_ONLY_GROUPS)) {
+  echo REDIRECT $tests ($tested [$tested_file]) done\n;
+   } else {
+  // Write over the last line to avoid random trailing chars 
on next echo
+  echo str_repeat( , $line_length), \r;
+   }
 }

 function show_test($test_idx, $shortname)

Modified: php/php-src/branches/PHP_5_4/run-tests.php
===
--- php/php-src/branches/PHP_5_4/run-tests.php  2011-11-26 17:48:52 UTC (rev 
319963)
+++ php/php-src/branches/PHP_5_4/run-tests.php  2011-11-26 17:56:43 UTC (rev 
319964)
@@ -678,7 +678,7 @@
 with value 'bar').

 -g  Comma seperated list of groups to show during test run
-(e.x. FAIL,SKIP).
+(possible values: PASS, FAIL, XFAIL, SKIP, BORK, WARN, LEAK, 
REDIRECT).

 -m  Test for memory leaks with Valgrind.

@@ -2384,24 +2384,34 @@

 function show_redirect_start($tests, $tested, $tested_file)
 {
-   global $html_output, $html_file;
+   global $html_output, $html_file, $line_length, $SHOW_ONLY_GROUPS;

if ($html_output) {
fwrite($html_file, trtd colspan='3'---gt; $tests ($tested 
[$tested_file]) begin/td/tr\n);
}

-   echo --- $tests ($tested [$tested_file]) begin\n;
+   if (!$SHOW_ONLY_GROUPS || in_array('REDIRECT', $SHOW_ONLY_GROUPS)) {
+  echo REDIRECT $tests ($tested [$tested_file]) begin\n;
+   } else {
+  // Write over the last line to avoid random trailing chars 
on next echo
+  echo str_repeat( , $line_length), \r;
+   }
 }

 function show_redirect_ends($tests, $tested, $tested_file)
 {
-   global $html_output, $html_file;
+   global $html_output, $html_file, $line_length, $SHOW_ONLY_GROUPS;

if ($html_output) {
fwrite($html_file, trtd colspan='3'---gt; $tests ($tested 
[$tested_file]) done/td/tr\n);
}

-   echo --- $tests ($tested [$tested_file]) done\n;
+   if (!$SHOW_ONLY_GROUPS || in_array('REDIRECT', $SHOW_ONLY_GROUPS)) {
+  echo REDIRECT $tests ($tested [$tested_file]) done\n;
+   } else {
+  // Write over the last line to avoid random trailing chars 
on next echo
+  echo str_repeat( , $line_length), \r;
+   }
 }

 function show_test($test_idx, $shortname)

Modified: php/php-src/trunk/run-tests.php
===
--- php/php-src/trunk/run-tests.php 2011-11-26 17:48:52 UTC (rev 319963)
+++ php/php-src/trunk/run-tests.php 2011-11-26 17:56:43 UTC (rev 319964)
@@ -678,7 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/tests/strings/offsets_chaining_1.phpt branches/PHP_5_3/tests/strings/offsets_chaining_2.phpt branches/PHP_5_3/tests/strings/offsets_chaining_3.phpt branch

2011-11-26 Thread Ferenc Kovacs
tyrael   Sat, 26 Nov 2011 18:41:45 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=319965

Log:
adding some tests for string offsets

Changed paths:
A   php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_1.phpt
A   php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_2.phpt
A   php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_3.phpt
A   php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_4.phpt
A   php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_5.phpt
A   php/php-src/branches/PHP_5_3/tests/strings/offsets_general.phpt
A   php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_1.phpt
A   php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_2.phpt
A   php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_3.phpt
A   php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_4.phpt
A   php/php-src/branches/PHP_5_4/tests/strings/offsets_chaining_5.phpt
A   php/php-src/branches/PHP_5_4/tests/strings/offsets_general.phpt
A   php/php-src/trunk/tests/strings/offsets_chaining_1.phpt
A   php/php-src/trunk/tests/strings/offsets_chaining_2.phpt
A   php/php-src/trunk/tests/strings/offsets_chaining_3.phpt
A   php/php-src/trunk/tests/strings/offsets_chaining_4.phpt
A   php/php-src/trunk/tests/strings/offsets_chaining_5.phpt
A   php/php-src/trunk/tests/strings/offsets_general.phpt

Added: php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_1.phpt
===
--- php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_1.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_1.phpt	2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,11 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+?php
+$string = foobar;
+var_dump($string[0][0][0][0]);
+?
+--EXPECTF--
+Fatal error: Cannot use string offset as an array in %s on line %d

Added: php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_2.phpt
===
--- php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_2.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_2.phpt	2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,11 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+?php
+$string = foobar;
+var_dump($string{0}{0}[0][0]);
+?
+--EXPECTF--
+Fatal error: Cannot use string offset as an array in %s on line %d

Added: php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_3.phpt
===
--- php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_3.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_3.phpt	2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,11 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+?php
+$string = foobar;
+var_dump(isset($string[0][0][0][0]));
+?
+--EXPECTF--
+Fatal error: Cannot use string offset as an array in %s on line %d

Added: php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_4.phpt
===
--- php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_4.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_4.phpt	2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,11 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+?php
+$string = foobar;
+var_dump(isset($string{0}{0}[0][0]));
+?
+--EXPECTF--
+Fatal error: Cannot use string offset as an array in %s on line %d

Added: php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_5.phpt
===
--- php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_5.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_3/tests/strings/offsets_chaining_5.phpt	2011-11-26 18:41:45 UTC (rev 319965)
@@ -0,0 +1,23 @@
+--TEST--
+testing the behavior of string offset chaining
+--INI--
+error_reporting=E_ALL | E_DEPRECATED
+--FILE--
+?php
+$array = array('expected_array' = foobar);
+var_dump(isset($array['expected_array']));
+var_dump($array['expected_array']);
+var_dump(isset($array['expected_array']['foo']));
+var_dump($array['expected_array']['foo']);
+var_dump(isset($array['expected_array']['foo']['bar']));
+var_dump($array['expected_array']['foo']['bar']);
+?
+--EXPECTF--
+bool(true)
+string(6) foobar
+bool(true)
+string(1) f
+bool(false)
+
+Fatal error: Cannot use string offset as an array in %s on line %d
+

Added: 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_3/run-tests.php branches/PHP_5_4/run-tests.php trunk/run-tests.php

2011-11-26 Thread Felipe Pena
felipe   Sat, 26 Nov 2011 20:18:03 +

Revision: http://svn.php.net/viewvc?view=revisionrevision=319967

Log:
- Added JUnit output format option
  patch by: Ferenc Kovacs (tyrael at php.net)

Changed paths:
U   php/php-src/branches/PHP_5_3/run-tests.php
U   php/php-src/branches/PHP_5_4/run-tests.php
U   php/php-src/trunk/run-tests.php

Modified: php/php-src/branches/PHP_5_3/run-tests.php
===
--- php/php-src/branches/PHP_5_3/run-tests.php	2011-11-26 19:04:51 UTC (rev 319966)
+++ php/php-src/branches/PHP_5_3/run-tests.php	2011-11-26 20:18:03 UTC (rev 319967)
@@ -200,6 +200,26 @@
 	$DETAILED = 0;
 }

+// Check whether a junit log is wanted.
+$JUNIT = getenv('TEST_PHP_JUNIT');
+if (empty($JUNIT) || (!file_exists($JUNIT)  !is_writable(dirname($JUNIT))) || (file_exists($JUNIT)  !is_writable($JUNIT)) || !($JUNIT = @fopen($JUNIT, 'w'))) {
+	$JUNIT = FALSE;
+}
+else{
+	$JUNIT = array(
+		'fp'= $JUNIT,
+		'test_total'= 0,
+		'test_pass' = 0,
+		'test_fail' = 0,
+		'test_error'= 0,
+		'test_skip' = 0,
+		'started_at'= microtime(true),
+		'finished_at'   = NULL,
+		'execution_time'= NULL,
+		'result_xml'= '',
+	);
+}
+
 if (getenv('SHOW_ONLY_GROUPS')) {
 	$SHOW_ONLY_GROUPS = explode(,, getenv('SHOW_ONLY_GROUPS'));
 } else {
@@ -811,6 +831,10 @@
 		if ($output_file != ''  $just_save_results) {
 			save_or_mail_results();
 		}
+
+		if ($JUNIT) {
+			save_junit_xml();
+		}

 		if (getenv('REPORT_EXIT_STATUS') == 1 and preg_match('/FAILED(?: |$)/', implode(' ', $test_results))) {
 			exit(1);
@@ -946,6 +970,10 @@

 save_or_mail_results();

+if ($JUNIT) {
+	save_junit_xml();
+}
+
 if (getenv('REPORT_EXIT_STATUS') == 1 and $sum_results['FAILED']) {
 	exit(1);
 }
@@ -1165,6 +1193,7 @@
 	global $leak_check, $temp_source, $temp_target, $cfg, $environment;
 	global $no_clean;
 	global $valgrind_version;
+	global $JUNIT;
 	$temp_filenames = null;
 	$org_file = $file;

@@ -1300,6 +1329,14 @@
 'diff'  = '',
 'info'  = $bork_info [$file],
 		);
+
+		if ($JUNIT) {
+			$JUNIT['test_total']++;
+			$JUNIT['test_error']++;
+			$JUNIT['result_xml'] .= 'testcase classname='.$shortname.' name='.htmlspecialchars($tested_file, ENT_QUOTES).' time=0'.\n;
+			$JUNIT['result_xml'] .= 'error type=BORKED message='.$bork_info.' /'.\n;
+			$JUNIT['result_xml'] .= '/testcase'.\n;
+		}
 		return 'BORKED';
 	}

@@ -1322,6 +1359,13 @@
 $php = realpath(./sapi/cgi/php-cgi) . ' -C ';
 			} else {
 show_result('SKIP', $tested, $tested_file, reason: CGI not available);
+if ($JUNIT) {
+	$JUNIT['test_total']++;
+	$JUNIT['test_skip']++;
+	$JUNIT['result_xml'] .= 'testcase classname='.$shortname.' name='.htmlspecialchars($tested, ENT_QUOTES).' time=0'.\n;
+	$JUNIT['result_xml'] .= 'skippedCGI not available/skipped'.\n;
+	$JUNIT['result_xml'] .= '/testcase'.\n;
+}
 return 'SKIPPED';
 			}
 		}
@@ -1459,7 +1503,14 @@
 $env['USE_ZEND_ALLOC'] = '1';
 			}

+			if ($JUNIT) {
+$test_started_at	= microtime(true);
+			}
 			$output = system_with_timeout($extra $php $pass_options -q $ini_settings -d display_errors=0 $test_skipif, $env);
+			if ($JUNIT) {
+$test_finished_at   = microtime(true);
+$test_execution_time= number_format($test_finished_at-$test_started_at, 2);
+			}

 			if (!$cfg['keep']['skip']) {
 @unlink($test_skipif);
@@ -1481,6 +1532,13 @@
 	@unlink($test_skipif);
 }

+if ($JUNIT) {
+	$JUNIT['test_total']++;
+	$JUNIT['test_skip']++;
+	$JUNIT['result_xml'] .= 'testcase classname='.$shortname.' name='.htmlspecialchars($tested, ENT_QUOTES).' time='.$test_execution_time.''.\n;
+	$JUNIT['result_xml'] .= 'skipped![CDATA['.\n.$m[1].\n.']]/skipped'.\n;
+	$JUNIT['result_xml'] .= '/testcase'.\n;
+}
 return 'SKIPPED';
 			}

@@ -1535,6 +1593,12 @@

 			// a redirected test never fails
 			$IN_REDIRECT = false;
+			if ($JUNIT) {
+$JUNIT['test_total']++;
+$JUNIT['test_pass']++;
+$JUNIT['result_xml'] .= 'testcase classname='.$shortname.' name='.htmlspecialchars($tested, ENT_QUOTES).' time='.$test_execution_time.''.\n;
+$JUNIT['result_xml'] .= '/testcase'.\n;
+			}
 			return 'REDIR';

 		} else {
@@ -1566,6 +1630,13 @@
 'diff'   = '',
 'info'   = $bork_info [$file],
 		);
+		if ($JUNIT) {
+			$JUNIT['test_total']++;
+			$JUNIT['test_error']++;
+			$JUNIT['result_xml'] .= 'testcase classname='.$shortname.' name='.htmlspecialchars($tested, ENT_QUOTES).' time='.$test_execution_time.''.\n;
+			$JUNIT['result_xml'] .= 'error type=BORKED message='.$bork_info.' /'.\n;
+			$JUNIT['result_xml'] .= '/testcase'.\n;
+		}
 		return 'BORKED';
 	}

@@ -1619,6 +1690,13 @@
 		$env['REQUEST_METHOD'] = 'POST';

 		if (empty($request)) {
+			if ($JUNIT) {
+$JUNIT['test_total']++;
+$JUNIT['test_error']++;
+$JUNIT['result_xml'] .= 'testcase classname='.$shortname.'