[PHP-CVS] svn: /php/php-src/trunk/ext/snmp/ snmp.c

2011-07-23 Thread Boris Lytochkin
lytboris Sat, 23 Jul 2011 07:40:40 +

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

Log:
provide backwards compatibility for 'p' in zend_parse_parameters()

Changed paths:
U   php/php-src/trunk/ext/snmp/snmp.c

Modified: php/php-src/trunk/ext/snmp/snmp.c
===
--- php/php-src/trunk/ext/snmp/snmp.c   2011-07-23 06:04:26 UTC (rev 313619)
+++ php/php-src/trunk/ext/snmp/snmp.c   2011-07-23 07:40:40 UTC (rev 313620)
@@ -1683,7 +1683,11 @@
char *filename;
int filename_len;

+#if PHP_VERSION_ID  50399
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, s, filename, 
filename_len) == FAILURE) {
+#else
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, p, filename, 
filename_len) == FAILURE) {
+#endif
RETURN_FALSE;
}


-- 
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/sapi/cli/php_cli_server.c trunk/sapi/cli/php_cli_server.c

2011-07-23 Thread Moriyoshi Koizumi
moriyoshiSat, 23 Jul 2011 11:29:26 +

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

Log:
- Give index.php a precedence over index.html.  Patch by davidc.

Changed paths:
U   php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
U   php/php-src/trunk/sapi/cli/php_cli_server.c

Modified: php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c
===
--- php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c  2011-07-23 
09:27:15 UTC (rev 313626)
+++ php/php-src/branches/PHP_5_4/sapi/cli/php_cli_server.c  2011-07-23 
11:29:26 UTC (rev 313627)
@@ -1065,7 +1065,7 @@
 static void php_cli_server_request_translate_vpath(php_cli_server_request 
*request, const char *document_root, size_t document_root_len) /* {{{ */
 {
struct stat sb;
-   static const char *index_files[] = { index.html, index.php, NULL };
+   static const char *index_files[] = { index.php, index.html, NULL };
char *buf = safe_pemalloc(1, request-vpath_len, 1 + document_root_len 
+ 1 + sizeof(index.html), 1);
char *p = buf, *prev_patch = 0, *q, *vpath;
memmove(p, document_root, document_root_len);

Modified: php/php-src/trunk/sapi/cli/php_cli_server.c
===
--- php/php-src/trunk/sapi/cli/php_cli_server.c 2011-07-23 09:27:15 UTC (rev 
313626)
+++ php/php-src/trunk/sapi/cli/php_cli_server.c 2011-07-23 11:29:26 UTC (rev 
313627)
@@ -1065,7 +1065,7 @@
 static void php_cli_server_request_translate_vpath(php_cli_server_request 
*request, const char *document_root, size_t document_root_len) /* {{{ */
 {
struct stat sb;
-   static const char *index_files[] = { index.html, index.php, NULL };
+   static const char *index_files[] = { index.php, index.html, NULL };
char *buf = safe_pemalloc(1, request-vpath_len, 1 + document_root_len 
+ 1 + sizeof(index.html), 1);
char *p = buf, *prev_patch = 0, *q, *vpath;
memmove(p, document_root, document_root_len);

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

[PHP-CVS] svn: /SVNROOT/ global_avail

2011-07-23 Thread Pierre Joye
pajoye   Sat, 23 Jul 2011 12:36:40 +

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

Log:
- web karma for Tyrael

Changed paths:
U   SVNROOT/global_avail

Modified: SVNROOT/global_avail
===
--- SVNROOT/global_avail2011-07-23 12:19:23 UTC (rev 313628)
+++ SVNROOT/global_avail2011-07-23 12:36:40 UTC (rev 313629)
@@ -52,9 +52,9 @@
 # The PHP Web Group maintains www.php.net, news.php.net, bugs.php.net,
 # people.php.net, master.php.net, wiki.php.net, pecl.php.net and qa.php.net.

-avail|salathe,scottmac,jmertic,lsmith,johannes,ilia,cmv,tcobb,gareth,jah,eschmid,ronabop,derick,sterling,stas,phildriscoll,jmoore,andre,jani,david,lyric,zimt,mk,goba,zak,jmcastagnetto,dams,tom,jacques,sebastian,georg,mj,imajes,cortesi,sander,markonen,edink,jan,victor,mfischer,wez,sesser,pollita,alindeman,magnus,iliaa,philip,didou,sfox,sean,dufuz,nlopess,pajoye,helly,tony2001,bjori,felipe,dsp,aharvey,danbrown,moacir,till,vrana|web/php,web/php-bugs,web/php-master,web/php-news,web/php-hosts,web/php-wiki,web/php-people,web/pecl,web/qa
+avail|salathe,scottmac,jmertic,lsmith,johannes,ilia,cmv,tcobb,gareth,jah,eschmid,ronabop,derick,sterling,stas,phildriscoll,jmoore,andre,jani,david,lyric,zimt,mk,goba,zak,jmcastagnetto,dams,tom,jacques,sebastian,georg,mj,imajes,cortesi,sander,markonen,edink,jan,victor,mfischer,wez,sesser,pollita,alindeman,magnus,iliaa,philip,didou,sfox,sean,dufuz,nlopess,pajoye,helly,tony2001,bjori,felipe,dsp,aharvey,danbrown,moacir,till,vrana,tyrael|web/php,web/php-bugs,web/php-master,web/php-news,web/php-hosts,web/php-wiki,web/php-people,web/pecl,web/qa

-avail|degeberg,tyrael|web/php-bugs
+avail|degeberg|web/php-bugs
 avail|danielc|web/php
 avail|ericstewart|web/php/*/archive
 avail|odoucet|web/php-news/,web/qa/

-- 
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/Zend/tests/traits/ bug55137.phpt

2011-07-23 Thread Stefan Marr
gron Sat, 23 Jul 2011 13:42:58 +

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

Log:
Added test case which was only added to trunk, bug seems to be fixed already.

Changed paths:
A   php/php-src/branches/PHP_5_4/Zend/tests/traits/bug55137.phpt

Added: php/php-src/branches/PHP_5_4/Zend/tests/traits/bug55137.phpt
===
--- php/php-src/branches/PHP_5_4/Zend/tests/traits/bug55137.phpt
(rev 0)
+++ php/php-src/branches/PHP_5_4/Zend/tests/traits/bug55137.phpt
2011-07-23 13:42:58 UTC (rev 313630)
@@ -0,0 +1,26 @@
+--TEST--
+Bug #55137 (Changing trait static method visibility)
+--FILE--
+?php
+
+trait A {
+   protected static function foo() { echo abc\n; }
+   private static function bar() { echo def\n; }
+}
+
+
+class B {
+   use A {
+  A::foo as public;
+  A::bar as public baz;
+   }
+}
+
+B::foo();
+B::baz();
+
+
+?
+--EXPECT--
+abc
+def

-- 
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/Zend/tests/traits/bugs/overridding-conflicting-property-initializer.phpt branches/PHP_5_4/Zend/zend_compile.c trunk/Zend/tests/traits/bugs/overridding-con

2011-07-23 Thread Stefan Marr
gron Sat, 23 Jul 2011 13:48:07 +

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

Log:
Fixed bug in the handling of conflicting property initializers for traits.
# Bug was uncovered by discussion in http://news.php.net/php.internals/54129
# Forgot to check the actual value of the initializer comparison, only checked
# whether comparison was successful which is not enough.

Changed paths:
A   
php/php-src/branches/PHP_5_4/Zend/tests/traits/bugs/overridding-conflicting-property-initializer.phpt
U   php/php-src/branches/PHP_5_4/Zend/zend_compile.c
A   
php/php-src/trunk/Zend/tests/traits/bugs/overridding-conflicting-property-initializer.phpt
U   php/php-src/trunk/Zend/zend_compile.c

Added: 
php/php-src/branches/PHP_5_4/Zend/tests/traits/bugs/overridding-conflicting-property-initializer.phpt
===
--- 
php/php-src/branches/PHP_5_4/Zend/tests/traits/bugs/overridding-conflicting-property-initializer.phpt
   (rev 0)
+++ 
php/php-src/branches/PHP_5_4/Zend/tests/traits/bugs/overridding-conflicting-property-initializer.phpt
   2011-07-23 13:48:07 UTC (rev 313632)
@@ -0,0 +1,23 @@
+--TEST--
+Properties are considered incompatible if they are different in any of their
+defined characteristics. Thus, initialization values have to be equal, too.
+--FILE--
+?php
+error_reporting(E_ALL);
+
+trait foo
+{
+public $zoo = 'foo::zoo';
+}
+
+class baz
+{
+use foo;
+public $zoo = 'baz::zoo';
+}
+
+$obj = new baz();
+echo $obj-zoo, \n;
+?
+--EXPECTF--
+Fatal error: baz and foo define the same property ($zoo) in the composition of 
baz. However, the definition differs and is considered incompatible. Class was 
composed in %s on line %d
\ No newline at end of file

Modified: php/php-src/branches/PHP_5_4/Zend/zend_compile.c
===
--- php/php-src/branches/PHP_5_4/Zend/zend_compile.c2011-07-23 13:48:02 UTC 
(rev 313631)
+++ php/php-src/branches/PHP_5_4/Zend/zend_compile.c2011-07-23 13:48:07 UTC 
(rev 313632)
@@ -3919,13 +3919,15 @@
if ((coliding_prop-flags  ZEND_ACC_PPP_MASK) 
== (property_info-flags  ZEND_ACC_PPP_MASK)) {
/* flags are identical, now the value 
needs to be checked */
if (property_info-flags  
ZEND_ACC_STATIC) {
-   not_compatible = 
compare_function(compare_result,
-   
  
ce-default_static_members_table[coliding_prop-offset],
-   
  
ce-traits[i]-default_static_members_table[property_info-offset] TSRMLS_CC) 
== FAILURE;
+not_compatible = (FAILURE == compare_function(compare_result,
+  
ce-default_static_members_table[coliding_prop-offset],
+  
ce-traits[i]-default_static_members_table[property_info-offset] TSRMLS_CC))
+  || (Z_LVAL(compare_result) != 0);
} else {
-   not_compatible = 
compare_function(compare_result,
-   

ce-default_properties_table[coliding_prop-offset],
-   

ce-traits[i]-default_properties_table[property_info-offset] TSRMLS_CC) == 
FAILURE;
+   not_compatible = (FAILURE == 
compare_function(compare_result,
+  
ce-default_properties_table[coliding_prop-offset],
+  
ce-traits[i]-default_properties_table[property_info-offset] TSRMLS_CC))
+  || (Z_LVAL(compare_result) != 0);
}
} else {
/* the flags are not identical, thus, 
we assume properties are not compatible */

Added: 
php/php-src/trunk/Zend/tests/traits/bugs/overridding-conflicting-property-initializer.phpt
===
--- 
php/php-src/trunk/Zend/tests/traits/bugs/overridding-conflicting-property-initializer.phpt
  (rev 0)
+++ 
php/php-src/trunk/Zend/tests/traits/bugs/overridding-conflicting-property-initializer.phpt
  2011-07-23 13:48:07 UTC (rev 313632)
@@ -0,0 +1,23 @@
+--TEST--
+Properties are considered incompatible if they are different in any of their
+defined 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/Zend/zend_compile.c trunk/Zend/zend_compile.c

2011-07-23 Thread Stefan Marr
gron Sat, 23 Jul 2011 18:12:31 +

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

Log:
Fixed incorrect initialization when copied op_array.vars was NULL (TRAITS)

Changed paths:
U   php/php-src/branches/PHP_5_4/Zend/zend_compile.c
U   php/php-src/trunk/Zend/zend_compile.c

Modified: php/php-src/branches/PHP_5_4/Zend/zend_compile.c
===
--- php/php-src/branches/PHP_5_4/Zend/zend_compile.c2011-07-23 17:12:42 UTC 
(rev 313637)
+++ php/php-src/branches/PHP_5_4/Zend/zend_compile.c2011-07-23 18:12:31 UTC 
(rev 313638)
@@ -3502,15 +3502,20 @@
fe-op_array.refcount = emalloc(sizeof(zend_uint));
*(fe-op_array.refcount) = 1;

-   i = fe-op_array.last_var;
-   dupvars = safe_emalloc(fe-op_array.last_var, 
sizeof(zend_compiled_variable), 0);
-   while (i  0) {
-   i--;
-   dupvars[i].name = estrndup(fe-op_array.vars[i].name, 
fe-op_array.vars[i].name_len);
-   dupvars[i].name_len = fe-op_array.vars[i].name_len;
-   dupvars[i].hash_value = fe-op_array.vars[i].hash_value;
-   }
-   fe-op_array.vars = dupvars;
+  if (fe-op_array.vars) {
+i = fe-op_array.last_var;
+dupvars = safe_emalloc(fe-op_array.last_var, 
sizeof(zend_compiled_variable), 0);
+while (i  0) {
+  i--;
+  dupvars[i].name = estrndup(fe-op_array.vars[i].name, 
fe-op_array.vars[i].name_len);
+  dupvars[i].name_len = fe-op_array.vars[i].name_len;
+  dupvars[i].hash_value = fe-op_array.vars[i].hash_value;
+}
+fe-op_array.vars = dupvars;
+  }
+   else {
+fe-op_array.vars = NULL;
+  }

opcode_copy = safe_emalloc(sizeof(zend_op), fe-op_array.last, 0);
for(i = 0; i  fe-op_array.last; i++) {

Modified: php/php-src/trunk/Zend/zend_compile.c
===
--- php/php-src/trunk/Zend/zend_compile.c   2011-07-23 17:12:42 UTC (rev 
313637)
+++ php/php-src/trunk/Zend/zend_compile.c   2011-07-23 18:12:31 UTC (rev 
313638)
@@ -3502,15 +3502,20 @@
fe-op_array.refcount = emalloc(sizeof(zend_uint));
*(fe-op_array.refcount) = 1;

-   i = fe-op_array.last_var;
-   dupvars = safe_emalloc(fe-op_array.last_var, 
sizeof(zend_compiled_variable), 0);
-   while (i  0) {
-   i--;
-   dupvars[i].name = estrndup(fe-op_array.vars[i].name, 
fe-op_array.vars[i].name_len);
-   dupvars[i].name_len = fe-op_array.vars[i].name_len;
-   dupvars[i].hash_value = fe-op_array.vars[i].hash_value;
-   }
-   fe-op_array.vars = dupvars;
+  if (fe-op_array.vars) {
+i = fe-op_array.last_var;
+dupvars = safe_emalloc(fe-op_array.last_var, 
sizeof(zend_compiled_variable), 0);
+while (i  0) {
+  i--;
+  dupvars[i].name = estrndup(fe-op_array.vars[i].name, 
fe-op_array.vars[i].name_len);
+  dupvars[i].name_len = fe-op_array.vars[i].name_len;
+  dupvars[i].hash_value = fe-op_array.vars[i].hash_value;
+}
+fe-op_array.vars = dupvars;
+  }
+   else {
+fe-op_array.vars = NULL;
+  }

opcode_copy = safe_emalloc(sizeof(zend_op), fe-op_array.last, 0);
for(i = 0; i  fe-op_array.last; i++) {

-- 
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/NEWS branches/PHP_5_4/ext/spl/php_spl.c branches/PHP_5_4/ext/spl/php_spl.h branches/PHP_5_4/ext/spl/spl_functions.c branches/PHP_5_4/ext/spl/spl_functions

2011-07-23 Thread Stefan Marr
gron Sat, 23 Jul 2011 19:08:43 +

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

Log:
Added missing class_uses(..) function to SPL to mirror class_implements(..).

# Was pointed out as missing in bug #55266.

Bug: https://bugs.php.net/55266 (Assigned) Traits vs Type hints
  
Changed paths:
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/ext/spl/php_spl.c
U   php/php-src/branches/PHP_5_4/ext/spl/php_spl.h
U   php/php-src/branches/PHP_5_4/ext/spl/spl_functions.c
U   php/php-src/branches/PHP_5_4/ext/spl/spl_functions.h
U   php/php-src/trunk/NEWS
U   php/php-src/trunk/ext/spl/php_spl.c
U   php/php-src/trunk/ext/spl/php_spl.h
U   php/php-src/trunk/ext/spl/spl_functions.c
U   php/php-src/trunk/ext/spl/spl_functions.h

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS	2011-07-23 18:19:12 UTC (rev 313639)
+++ php/php-src/branches/PHP_5_4/NEWS	2011-07-23 19:08:43 UTC (rev 313640)
@@ -12,6 +12,10 @@
   . Dropped restriction of not setting the same value multiple times, the last
 one holds. (giovanni at giacobbi dot net, fat)

+- SPL extension:
+  . Added missing class_uses(..) as pointed out by #55266 (Stefan)
+
+
 14 Jul 2011, PHP 5.4.0 Alpha 2
 - General improvements:
   . Zend Signal Handling. (Lucas Nealan,Arnaud Le Blanc,Brian Shire, Ilia)

Modified: php/php-src/branches/PHP_5_4/ext/spl/php_spl.c
===
--- php/php-src/branches/PHP_5_4/ext/spl/php_spl.c	2011-07-23 18:19:12 UTC (rev 313639)
+++ php/php-src/branches/PHP_5_4/ext/spl/php_spl.c	2011-07-23 19:08:43 UTC (rev 313640)
@@ -166,6 +166,35 @@
 }
 /* }}} */

+/* {{{ proto array class_uses(mixed what [, bool autoload ])
+ Return all traits used by a class. */
+PHP_FUNCTION(class_uses)
+{
+	zval *obj;
+	zend_bool autoload = 1;
+	zend_class_entry *ce;
+
+	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z|b, obj, autoload) == FAILURE) {
+		RETURN_FALSE;
+	}
+	if (Z_TYPE_P(obj) != IS_OBJECT  Z_TYPE_P(obj) != IS_STRING) {
+		php_error_docref(NULL TSRMLS_CC, E_WARNING, object or string expected);
+		RETURN_FALSE;
+	}
+
+	if (Z_TYPE_P(obj) == IS_STRING) {
+		if (NULL == (ce = spl_find_ce_by_name(Z_STRVAL_P(obj), Z_STRLEN_P(obj), autoload TSRMLS_CC))) {
+			RETURN_FALSE;
+		}
+	} else {
+		ce = Z_OBJCE_P(obj);
+	}
+
+	array_init(return_value);
+	spl_add_traits(return_value, ce, 1, ZEND_ACC_TRAIT TSRMLS_CC);
+}
+/* }}} */
+
 #define SPL_ADD_CLASS(class_name, z_list, sub, allow, ce_flags) \
 	spl_add_classes(spl_ce_ ## class_name, z_list, sub, allow, ce_flags TSRMLS_CC)

@@ -933,6 +962,12 @@
 	ZEND_ARG_INFO(0, autoload)
 ZEND_END_ARG_INFO()

+ZEND_BEGIN_ARG_INFO_EX(arginfo_class_uses, 0, 0, 1)
+	ZEND_ARG_INFO(0, what)
+	ZEND_ARG_INFO(0, autoload)
+ZEND_END_ARG_INFO()
+
+
 ZEND_BEGIN_ARG_INFO(arginfo_spl_classes, 0)
 ZEND_END_ARG_INFO()

@@ -977,6 +1012,7 @@
 	PHP_FE(spl_autoload_call,   arginfo_spl_autoload_call)
 	PHP_FE(class_parents,   arginfo_class_parents)
 	PHP_FE(class_implements,arginfo_class_implements)
+  PHP_FE(class_uses,  arginfo_class_uses)
 	PHP_FE(spl_object_hash, arginfo_spl_object_hash)
 #ifdef SPL_ITERATORS_H
 	PHP_FE(iterator_to_array,   arginfo_iterator_to_array)

Modified: php/php-src/branches/PHP_5_4/ext/spl/php_spl.h
===
--- php/php-src/branches/PHP_5_4/ext/spl/php_spl.h	2011-07-23 18:19:12 UTC (rev 313639)
+++ php/php-src/branches/PHP_5_4/ext/spl/php_spl.h	2011-07-23 19:08:43 UTC (rev 313640)
@@ -85,6 +85,7 @@
 PHP_FUNCTION(spl_classes);
 PHP_FUNCTION(class_parents);
 PHP_FUNCTION(class_implements);
+PHP_FUNCTION(class_uses);

 PHPAPI void php_spl_object_hash(zval *obj, char* md5str TSRMLS_DC);


Modified: php/php-src/branches/PHP_5_4/ext/spl/spl_functions.c
===
--- php/php-src/branches/PHP_5_4/ext/spl/spl_functions.c	2011-07-23 18:19:12 UTC (rev 313639)
+++ php/php-src/branches/PHP_5_4/ext/spl/spl_functions.c	2011-07-23 19:08:43 UTC (rev 313640)
@@ -103,6 +103,18 @@
 }
 /* }}} */

+/* {{{ spl_add_traits */
+void spl_add_traits(zval *list, zend_class_entry * pce, int allow, int ce_flags TSRMLS_DC)
+{
+	zend_uint num_traits;
+
+	for (num_traits = 0; num_traits  pce-num_traits; num_traits++) {
+		spl_add_class_name(list, pce-traits[num_traits], allow, ce_flags TSRMLS_CC);
+	}
+}
+/* }}} */
+
+
 /* {{{ spl_add_classes */
 int spl_add_classes(zend_class_entry *pce, zval *list, int sub, int allow, int ce_flags TSRMLS_DC)
 {

Modified: php/php-src/branches/PHP_5_4/ext/spl/spl_functions.h
===
--- php/php-src/branches/PHP_5_4/ext/spl/spl_functions.h	2011-07-23 18:19:12 UTC (rev 313639)
+++ 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/UPGRADING branches/PHP_5_4/Zend/zend_ini_scanner.c branches/PHP_5_4/Zend/zend_language_parser.y branches/PHP_5_4/tests/lang/array_shortcut_001.phpt branch

2011-07-23 Thread Pierre Joye
pajoye   Sat, 23 Jul 2011 20:23:21 +

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

Log:
- add short array syntax as defined in 
https://wiki.php.net/rfc/shortsyntaxforarrays, 2nd solution using = only

Changed paths:
U   php/php-src/branches/PHP_5_4/UPGRADING
U   php/php-src/branches/PHP_5_4/Zend/zend_ini_scanner.c
U   php/php-src/branches/PHP_5_4/Zend/zend_language_parser.y
A   php/php-src/branches/PHP_5_4/tests/lang/array_shortcut_001.phpt
A   php/php-src/branches/PHP_5_4/tests/lang/array_shortcut_002.phpt
A   php/php-src/branches/PHP_5_4/tests/lang/array_shortcut_003.phpt
A   php/php-src/branches/PHP_5_4/tests/lang/array_shortcut_005.phpt
U   php/php-src/trunk/UPGRADING
U   php/php-src/trunk/Zend/zend_language_parser.y
A   php/php-src/trunk/tests/lang/array_shortcut_001.phpt
A   php/php-src/trunk/tests/lang/array_shortcut_002.phpt
A   php/php-src/trunk/tests/lang/array_shortcut_003.phpt
A   php/php-src/trunk/tests/lang/array_shortcut_005.phpt

Modified: php/php-src/branches/PHP_5_4/UPGRADING
===
--- php/php-src/branches/PHP_5_4/UPGRADING	2011-07-23 19:08:43 UTC (rev 313640)
+++ php/php-src/branches/PHP_5_4/UPGRADING	2011-07-23 20:23:21 UTC (rev 313641)
@@ -456,5 +456,10 @@
- fnv132
- fnv164
- joaat
+
+ k. New Syntax
+   - Short array syntax
+ $a = [1, 2, 3, 4];
+ $a = ['one' = 1, 'two' = 2, 'three' = 3, 'four' = 4];
+ $a = ['one' = 1, 2, 'three' = 3, 4];

-

Modified: php/php-src/branches/PHP_5_4/Zend/zend_ini_scanner.c
===
--- php/php-src/branches/PHP_5_4/Zend/zend_ini_scanner.c	2011-07-23 19:08:43 UTC (rev 313640)
+++ php/php-src/branches/PHP_5_4/Zend/zend_ini_scanner.c	2011-07-23 20:23:21 UTC (rev 313641)
@@ -1,4 +1,4 @@
-/* Generated by re2c 0.13.5 on Wed Jun 29 02:53:12 2011 */
+/* Generated by re2c 0.13.5 on Mon Jan 17 14:03:33 2011 */
 #line 1 Zend/zend_ini_scanner.l
 /*
+--+

Modified: php/php-src/branches/PHP_5_4/Zend/zend_language_parser.y
===
--- php/php-src/branches/PHP_5_4/Zend/zend_language_parser.y	2011-07-23 19:08:43 UTC (rev 313640)
+++ php/php-src/branches/PHP_5_4/Zend/zend_language_parser.y	2011-07-23 20:23:21 UTC (rev 313641)
@@ -761,6 +761,7 @@
 	|	'@' { zend_do_begin_silence($1 TSRMLS_CC); } expr { zend_do_end_silence($1 TSRMLS_CC); $$ = $3; }
 	|	scalar{ $$ = $1; }
 	|	T_ARRAY '(' array_pair_list ')' { $$ = $3; }
+ 	|	'[' array_pair_list ']' { $$ = $2; }
 	|	'`' backticks_expr '`' { zend_do_shell_exec($$, $2 TSRMLS_CC); }
 	|	T_PRINT expr  { zend_do_print($$, $2 TSRMLS_CC); }
 	|	function is_reference '(' { zend_do_begin_lambda_function_declaration($$, $1, $2.op_type, 0 TSRMLS_CC); }
@@ -894,6 +895,7 @@
 	|	'+' static_scalar { ZVAL_LONG($1.u.constant, 0); add_function($2.u.constant, $1.u.constant, $2.u.constant TSRMLS_CC); $$ = $2; }
 	|	'-' static_scalar { ZVAL_LONG($1.u.constant, 0); sub_function($2.u.constant, $1.u.constant, $2.u.constant TSRMLS_CC); $$ = $2; }
 	|	T_ARRAY '(' static_array_pair_list ')' { $$ = $3; Z_TYPE($$.u.constant) = IS_CONSTANT_ARRAY; }
+	|	'[' static_array_pair_list ']' { $$ = $2; Z_TYPE($$.u.constant) = IS_CONSTANT_ARRAY; }
 	|	static_class_constant { $$ = $1; }
 ;


Added: php/php-src/branches/PHP_5_4/tests/lang/array_shortcut_001.phpt
===
--- php/php-src/branches/PHP_5_4/tests/lang/array_shortcut_001.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_4/tests/lang/array_shortcut_001.phpt	2011-07-23 20:23:21 UTC (rev 313641)
@@ -0,0 +1,13 @@
+--TEST--
+Square bracket array shortcut test
+--FILE--
+?php
+print_r([1, 2, 3]);
+?
+--EXPECT--
+Array
+(
+[0] = 1
+[1] = 2
+[2] = 3
+)

Added: php/php-src/branches/PHP_5_4/tests/lang/array_shortcut_002.phpt
===
--- php/php-src/branches/PHP_5_4/tests/lang/array_shortcut_002.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_4/tests/lang/array_shortcut_002.phpt	2011-07-23 20:23:21 UTC (rev 313641)
@@ -0,0 +1,13 @@
+--TEST--
+Square bracket associative array shortcut test
+--FILE--
+?php
+print_r([foo = orange, bar = apple, baz = lemon]);
+?
+--EXPECT--
+Array
+(
+[foo] = orange
+[bar] = apple
+[baz] = lemon
+)

Added: php/php-src/branches/PHP_5_4/tests/lang/array_shortcut_003.phpt
===
--- php/php-src/branches/PHP_5_4/tests/lang/array_shortcut_003.phpt	(rev 0)
+++ php/php-src/branches/PHP_5_4/tests/lang/array_shortcut_003.phpt	2011-07-23 20:23:21 UTC (rev 313641)
@@ -0,0 +1,13 @@
+--TEST--
+Testing array shortcut and 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/NEWS branches/PHP_5_4/Zend/zend_builtin_functions.c branches/PHP_5_4/Zend/zend_errors.h branches/PHP_5_4/php.ini-development branches/PHP_5_4/php.ini-prod

2011-07-23 Thread Stanislav Malyshev
stas Sat, 23 Jul 2011 22:07:22 +

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

Log:
Change E_ALL to include E_STRICT

Changed paths:
U   php/php-src/branches/PHP_5_4/NEWS
U   php/php-src/branches/PHP_5_4/Zend/zend_builtin_functions.c
U   php/php-src/branches/PHP_5_4/Zend/zend_errors.h
U   php/php-src/branches/PHP_5_4/php.ini-development
U   php/php-src/branches/PHP_5_4/php.ini-production
U   php/php-src/trunk/Zend/zend_builtin_functions.c
U   php/php-src/trunk/Zend/zend_errors.h
U   php/php-src/trunk/php.ini-development
U   php/php-src/trunk/php.ini-production

Modified: php/php-src/branches/PHP_5_4/NEWS
===
--- php/php-src/branches/PHP_5_4/NEWS	2011-07-23 22:05:08 UTC (rev 313644)
+++ php/php-src/branches/PHP_5_4/NEWS	2011-07-23 22:07:22 UTC (rev 313645)
@@ -10,6 +10,8 @@
 get_magic_quotes_gpc, get_magic_quotes_runtime are kept but always return
 false, set_magic_quotes_runtime raises an E_CORE_ERROR. (Pierrick, Pierre)

+- Changed E_ALL to include E_STRICT. (Stas)
+
 - Improved PHP-FPM SAPI:
   . Added process.max to control the number of process FPM can fork. FR #55166.
 (fat)

Modified: php/php-src/branches/PHP_5_4/Zend/zend_builtin_functions.c
===
--- php/php-src/branches/PHP_5_4/Zend/zend_builtin_functions.c	2011-07-23 22:05:08 UTC (rev 313644)
+++ php/php-src/branches/PHP_5_4/Zend/zend_builtin_functions.c	2011-07-23 22:07:22 UTC (rev 313645)
@@ -1501,7 +1501,7 @@
 	zval *error_handler;
 	zend_bool had_orig_error_handler=0;
 	char *error_handler_name = NULL;
-	long error_type = E_ALL | E_STRICT;
+	long error_type = E_ALL;

 	if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, z|l, error_handler, error_type) == FAILURE) {
 		return;

Modified: php/php-src/branches/PHP_5_4/Zend/zend_errors.h
===
--- php/php-src/branches/PHP_5_4/Zend/zend_errors.h	2011-07-23 22:05:08 UTC (rev 313644)
+++ php/php-src/branches/PHP_5_4/Zend/zend_errors.h	2011-07-23 22:07:22 UTC (rev 313645)
@@ -38,7 +38,7 @@
 #define E_DEPRECATED		(113L)
 #define E_USER_DEPRECATED	(114L)

-#define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_RECOVERABLE_ERROR | E_DEPRECATED | E_USER_DEPRECATED)
+#define E_ALL (E_ERROR | E_WARNING | E_PARSE | E_NOTICE | E_CORE_ERROR | E_CORE_WARNING | E_COMPILE_ERROR | E_COMPILE_WARNING | E_USER_ERROR | E_USER_WARNING | E_USER_NOTICE | E_RECOVERABLE_ERROR | E_DEPRECATED | E_USER_DEPRECATED | E_STRICT)
 #define E_CORE (E_CORE_ERROR | E_CORE_WARNING)

 #endif /* ZEND_ERRORS_H */

Modified: php/php-src/branches/PHP_5_4/php.ini-development
===
--- php/php-src/branches/PHP_5_4/php.ini-development	2011-07-23 22:05:08 UTC (rev 313644)
+++ php/php-src/branches/PHP_5_4/php.ini-development	2011-07-23 22:07:22 UTC (rev 313645)
@@ -102,8 +102,8 @@
 ;   Production Value: Off

 ; error_reporting
-;   Default Value: E_ALL  ~E_NOTICE
-;   Development Value: E_ALL | E_STRICT
+;   Default Value: E_ALL  ~E_NOTICE  ~E_STRICT  ~E_DEPRECATED
+;   Development Value: E_ALL
 ;   Production Value: E_ALL  ~E_DEPRECATED

 ; html_errors
@@ -412,7 +412,7 @@
 ; recommend error reporting setting. Your production server shouldn't be wasting
 ; resources complaining about best practices and coding standards. That's what
 ; development servers and development settings are for.
-; Note: The php.ini-development file has this setting as E_ALL | E_STRICT. This
+; Note: The php.ini-development file has this setting as E_ALL. This
 ; means it pretty much reports everything which is exactly what you want during
 ; development and early testing.
 ;
@@ -443,15 +443,15 @@
 ; E_USER_DEPRECATED - user-generated deprecation warnings
 ;
 ; Common Values:
-;   E_ALL  ~E_NOTICE  (Show all errors, except for notices and coding standards warnings.)
-;   E_ALL  ~E_NOTICE | E_STRICT  (Show all errors, except for notices)
+;   E_ALL (Show all errors, warnings and notices including coding standards.)
+;   E_ALL  ~E_NOTICE  (Show all errors, except for notices)
+;   E_ALL  ~E_NOTICE  ~E_STRICT  (Show all errors, except for notices and coding standards warnings.)
 ;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only errors)
-;   E_ALL | E_STRICT  (Show all errors, warnings and notices including coding standards.)
-; Default Value: E_ALL  ~E_NOTICE
-; Development Value: E_ALL | E_STRICT
+; Default Value: E_ALL  ~E_NOTICE  ~E_STRICT  ~E_DEPRECATED
+; Development Value: E_ALL
 ; Production Value: E_ALL  ~E_DEPRECATED
 ; http://php.net/error-reporting
-error_reporting = E_ALL | E_STRICT
+error_reporting = E_ALL

 ; This directive controls whether or not and where PHP 

[PHP-CVS] svn: /php/php-src/ branches/PHP_5_4/UPGRADING branches/PHP_5_4/php.ini-development branches/PHP_5_4/php.ini-production trunk/php.ini-development trunk/php.ini-production

2011-07-23 Thread Stanislav Malyshev
stas Sun, 24 Jul 2011 05:42:29 +

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

Log:
No E_STRICT in production

Changed paths:
U   php/php-src/branches/PHP_5_4/UPGRADING
U   php/php-src/branches/PHP_5_4/php.ini-development
U   php/php-src/branches/PHP_5_4/php.ini-production
U   php/php-src/trunk/php.ini-development
U   php/php-src/trunk/php.ini-production

Modified: php/php-src/branches/PHP_5_4/UPGRADING
===
--- php/php-src/branches/PHP_5_4/UPGRADING  2011-07-23 22:07:22 UTC (rev 
313645)
+++ php/php-src/branches/PHP_5_4/UPGRADING  2011-07-24 05:42:29 UTC (rev 
313646)
@@ -336,6 +336,8 @@
   raw POST data in multipart requests and read/process the POST data in a
   stream fashion (through php://input), without having it copied in memory two/
   three times.
+- Changed E_ALL to include E_STRICT. Recommended production value changed to
+  E_ALL  ~E_DEPRECATED  ~E_STRICT.

 
 12. Syntax additions

Modified: php/php-src/branches/PHP_5_4/php.ini-development
===
--- php/php-src/branches/PHP_5_4/php.ini-development2011-07-23 22:07:22 UTC 
(rev 313645)
+++ php/php-src/branches/PHP_5_4/php.ini-development2011-07-24 05:42:29 UTC 
(rev 313646)
@@ -104,7 +104,7 @@
 ; error_reporting
 ;   Default Value: E_ALL  ~E_NOTICE  ~E_STRICT  ~E_DEPRECATED
 ;   Development Value: E_ALL
-;   Production Value: E_ALL  ~E_DEPRECATED
+;   Production Value: E_ALL  ~E_DEPRECATED  ~E_STRICT

 ; html_errors
 ;   Default Value: On
@@ -449,7 +449,7 @@
 ;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only 
errors)
 ; Default Value: E_ALL  ~E_NOTICE  ~E_STRICT  ~E_DEPRECATED
 ; Development Value: E_ALL
-; Production Value: E_ALL  ~E_DEPRECATED
+; Production Value: E_ALL  ~E_DEPRECATED  ~E_STRICT
 ; http://php.net/error-reporting
 error_reporting = E_ALL


Modified: php/php-src/branches/PHP_5_4/php.ini-production
===
--- php/php-src/branches/PHP_5_4/php.ini-production 2011-07-23 22:07:22 UTC 
(rev 313645)
+++ php/php-src/branches/PHP_5_4/php.ini-production 2011-07-24 05:42:29 UTC 
(rev 313646)
@@ -104,7 +104,7 @@
 ; error_reporting
 ;   Default Value: E_ALL  ~E_NOTICE  ~E_STRICT  ~E_DEPRECATED
 ;   Development Value: E_ALL
-;   Production Value: E_ALL  ~E_DEPRECATED
+;   Production Value: E_ALL  ~E_DEPRECATED  ~E_STRICT

 ; html_errors
 ;   Default Value: On
@@ -449,9 +449,9 @@
 ;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only 
errors)
 ; Default Value: E_ALL  ~E_NOTICE  ~E_STRICT  ~E_DEPRECATED
 ; Development Value: E_ALL
-; Production Value: E_ALL  ~E_DEPRECATED
+; Production Value: E_ALL  ~E_DEPRECATED  ~E_STRICT
 ; http://php.net/error-reporting
-error_reporting = E_ALL  ~E_DEPRECATED
+error_reporting = E_ALL  ~E_DEPRECATED  ~E_STRICT

 ; This directive controls whether or not and where PHP will output errors,
 ; notices and warnings too. Error output is very useful during development, but

Modified: php/php-src/trunk/php.ini-development
===
--- php/php-src/trunk/php.ini-development   2011-07-23 22:07:22 UTC (rev 
313645)
+++ php/php-src/trunk/php.ini-development   2011-07-24 05:42:29 UTC (rev 
313646)
@@ -104,7 +104,7 @@
 ; error_reporting
 ;   Default Value: E_ALL  ~E_NOTICE  ~E_STRICT  ~E_DEPRECATED
 ;   Development Value: E_ALL
-;   Production Value: E_ALL  ~E_DEPRECATED
+;   Production Value: E_ALL  ~E_DEPRECATED  ~E_STRICT

 ; html_errors
 ;   Default Value: On
@@ -449,7 +449,7 @@
 ;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only 
errors)
 ; Default Value: E_ALL  ~E_NOTICE  ~E_STRICT  ~E_DEPRECATED
 ; Development Value: E_ALL
-; Production Value: E_ALL  ~E_DEPRECATED
+; Production Value: E_ALL  ~E_DEPRECATED  ~E_STRICT
 ; http://php.net/error-reporting
 error_reporting = E_ALL


Modified: php/php-src/trunk/php.ini-production
===
--- php/php-src/trunk/php.ini-production2011-07-23 22:07:22 UTC (rev 
313645)
+++ php/php-src/trunk/php.ini-production2011-07-24 05:42:29 UTC (rev 
313646)
@@ -104,7 +104,7 @@
 ; error_reporting
 ;   Default Value: E_ALL  ~E_NOTICE  ~E_STRICT  ~E_DEPRECATED
 ;   Development Value: E_ALL
-;   Production Value: E_ALL  ~E_DEPRECATED
+;   Production Value: E_ALL  ~E_DEPRECATED  ~E_STRICT

 ; html_errors
 ;   Default Value: On
@@ -449,9 +449,9 @@
 ;   E_COMPILE_ERROR|E_RECOVERABLE_ERROR|E_ERROR|E_CORE_ERROR  (Show only 
errors)
 ; Default Value: E_ALL  ~E_NOTICE  ~E_STRICT  ~E_DEPRECATED
 ; Development Value: E_ALL
-; Production Value: E_ALL  ~E_DEPRECATED
+; Production Value: E_ALL  ~E_DEPRECATED  ~E_STRICT
 ; http://php.net/error-reporting
-error_reporting = E_ALL  ~E_DEPRECATED