[PHP-CVS] com php-src: clarify NEWS: NEWS

2013-03-19 Thread Stanislav Malyshev
Commit:5aaff8d634ec919a5fa24c05485b5ad250588982
Author:Stanislav Malyshev  Tue, 19 Mar 2013 22:32:50 
-0700
Parents:   cb76420fe04d6d5531d5f98c1c232696ed4d361c
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=5aaff8d634ec919a5fa24c05485b5ad250588982

Log:
clarify NEWS

Changed paths:
  M  NEWS


Diff:
diff --git a/NEWS b/NEWS
index ef2fc8f..597010b 100644
--- a/NEWS
+++ b/NEWS
@@ -3,8 +3,8 @@ PHP 
   NEWS
 ?? ??? 20??, PHP 5.5.0 Beta 1
 
 - Core:
-  . Added Zend Opcache extension and enable it by default. More details here:
-https://wiki.php.net/rfc/optimizerplus. (Dmitry)
+  . Added Zend Opcache extension and enable building it by default. 
+More details here: https://wiki.php.net/rfc/optimizerplus. (Dmitry)
   . Fixed bug #64354 (Unserialize array of objects whose class can't
 be autoloaded fail). (Laruence)
   . Added support for changing the process's title in CLI/CLI-Server SAPIs.


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



Re: [PHP-CVS] com php-src: Backported fix for bug #62852: NEWS ext/date/php_date.c ext/date/tests/bug62852.phpt ext/date/tests/bug62852_var2.phpt ext/date/tests/bug62852_var3.phpt

2013-03-19 Thread Stas Malyshev
Hi!

> + if (!php_date_initialize_from_hash(&return_value, &dateobj, myht 
> TSRMLS_CC)) {
> + php_error(E_ERROR, "Invalid serialization data for DateTime 
> object");
> + }

Why this is E_ERROR? Can't we recover from this problem? Bad
serialization data is E_NOTICE for unserialize(), why suddenly it
becomes fatal error?

-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

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



Re: [PHP-CVS] com php-src: fix C90 compat: Zend/zend_API.c

2013-03-19 Thread Anatol Belski
Happy to help where i can :)

Regards

Anatol

On Tue, 2013-03-19 at 19:37 +0400, Dmitry Stogov wrote:
> Sorry, my mistake.
> Thanks.
> 
> Dmitry.
> 
> On Tue, Mar 19, 2013 at 5:42 PM, Anatol Belski  wrote:
> Commit:7687b8b81c599b0374cb902e9dd812d2cfc12efd
> Author:Anatol Belski  Tue, 19 Mar 2013
> 14:42:18 +0100
> Parents:   7b0993bfb4b19bb160a72310b907c4fc12a5bef9
> Branches:  PHP-5.4
> 
> Link:
> 
> http://git.php.net/?p=php-src.git;a=commitdiff;h=7687b8b81c599b0374cb902e9dd812d2cfc12efd
> 
> Log:
> fix C90 compat
> 
> Changed paths:
>   M  Zend/zend_API.c
> 
> 
> Diff:
> diff --git a/Zend/zend_API.c b/Zend/zend_API.c
> index b9e97cb..668ddff 100644
> --- a/Zend/zend_API.c
> +++ b/Zend/zend_API.c
> @@ -1039,9 +1039,10 @@ static int
> zval_update_class_constant(zval **pp, int is_static, int
> offset TSRML
> 
>  zend_hash_move_forward_ex(&ce->properties_info, &pos)) {
> if (is_static ==
> ((prop_info->flags & ZEND_ACC_STATIC) != 0) &&
> offset ==
> prop_info->offset) {
> +   int ret;
> 
> zend_class_entry *old_scope = *scope;
> *scope =
> prop_info->ce;
> -   int ret =
> zval_update_constant(pp, (void*)1 TSRMLS_CC);
> +   ret =
> zval_update_constant(pp, (void*)1 TSRMLS_CC);
> *scope =
> old_scope;
> return ret;
> }
> 
> 
> --
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
> 
> 



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



[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: ext/date/php_date.c

2013-03-19 Thread Anatol Belski
Commit:cfd096fd7cc7e48e052f7309780a0bed257ed524
Author:Anatol Belski  Tue, 19 Mar 2013 21:22:09 +0100
Parents:   c6f6bf88d8c660f7dcb412b0d5049d376e3a5d36 
8d199c7c4f93ebe5b9293096143d7007a6ad13a4
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=cfd096fd7cc7e48e052f7309780a0bed257ed524

Log:
Merge branch 'PHP-5.3' into PHP-5.4

* PHP-5.3:
  Backported fix for bug #62852

Bugs:
https://bugs.php.net/62852

Changed paths:
  MM  ext/date/php_date.c


Diff:



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



[PHP-CVS] com php-src: Backported fix for bug #62852: NEWS ext/date/php_date.c ext/date/tests/bug62852.phpt ext/date/tests/bug62852_var2.phpt ext/date/tests/bug62852_var3.phpt

2013-03-19 Thread Anatol Belski
Commit:8d199c7c4f93ebe5b9293096143d7007a6ad13a4
Author:Anatol Belski  Tue, 19 Mar 2013 21:19:55 +0100
Parents:   4a6291508d69fab951562b996ed7223c052a0168
Branches:  PHP-5.3 PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=8d199c7c4f93ebe5b9293096143d7007a6ad13a4

Log:
Backported fix for bug #62852

Bugs:
https://bugs.php.net/62852

Changed paths:
  M  NEWS
  M  ext/date/php_date.c
  M  ext/date/tests/bug62852.phpt
  A  ext/date/tests/bug62852_var2.phpt
  A  ext/date/tests/bug62852_var3.phpt


Diff:
diff --git a/NEWS b/NEWS
index c8c6f75..facb9ad 100644
--- a/NEWS
+++ b/NEWS
@@ -14,6 +14,9 @@ PHP   
 NEWS
   . Fixed bug #63530 (mysqlnd_stmt::bind_one_parameter crashes, uses wrong 
alloc
 for stmt->param_bind). (Andrey)
 
+- DateTime
+  . Fixed bug #62852 (Unserialize Invalid Date causes crash). (Anatol)
+
 
 14 Mar 2013, PHP 5.3.23
 
diff --git a/ext/date/php_date.c b/ext/date/php_date.c
index 2e616b1..e27be7d 100644
--- a/ext/date/php_date.c
+++ b/ext/date/php_date.c
@@ -2554,13 +2554,15 @@ static int php_date_initialize_from_hash(zval 
**return_value, php_date_obj **dat
case TIMELIB_ZONETYPE_OFFSET:
case TIMELIB_ZONETYPE_ABBR: {
char *tmp = 
emalloc(Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 2);
+   int ret;
snprintf(tmp, 
Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 2, "%s %s", 
Z_STRVAL_PP(z_date), Z_STRVAL_PP(z_timezone));
-   php_date_initialize(*dateobj, 
tmp, Z_STRLEN_PP(z_date) + Z_STRLEN_PP(z_timezone) + 1, NULL, NULL, 0 
TSRMLS_CC);
+   ret = 
php_date_initialize(*dateobj, tmp, Z_STRLEN_PP(z_date) + 
Z_STRLEN_PP(z_timezone) + 1, NULL, NULL, 0 TSRMLS_CC);
efree(tmp);
-   return 1;
+   return 1 == ret;
}
 
-   case TIMELIB_ZONETYPE_ID:
+   case TIMELIB_ZONETYPE_ID: {
+   int ret;
convert_to_string(*z_timezone);
 
tzi = 
php_date_parse_tzfile(Z_STRVAL_PP(z_timezone), DATE_TIMEZONEDB TSRMLS_CC);
@@ -2571,9 +2573,10 @@ static int php_date_initialize_from_hash(zval 
**return_value, php_date_obj **dat
tzobj->tzi.tz = tzi;
tzobj->initialized = 1;
 
-   php_date_initialize(*dateobj, 
Z_STRVAL_PP(z_date), Z_STRLEN_PP(z_date), NULL, tmp_obj, 0 TSRMLS_CC);
+   ret = 
php_date_initialize(*dateobj, Z_STRVAL_PP(z_date), Z_STRLEN_PP(z_date), NULL, 
tmp_obj, 0 TSRMLS_CC);
zval_ptr_dtor(&tmp_obj);
-   return 1;
+   return 1 == ret;
+   }
}
}
}
@@ -2597,7 +2600,9 @@ PHP_METHOD(DateTime, __set_state)
 
php_date_instantiate(date_ce_date, return_value TSRMLS_CC);
dateobj = (php_date_obj *) zend_object_store_get_object(return_value 
TSRMLS_CC);
-   php_date_initialize_from_hash(&return_value, &dateobj, myht TSRMLS_CC);
+   if (!php_date_initialize_from_hash(&return_value, &dateobj, myht 
TSRMLS_CC)) {
+   php_error(E_ERROR, "Invalid serialization data for DateTime 
object");
+   }
 }
 /* }}} */
 
@@ -2613,7 +2618,9 @@ PHP_METHOD(DateTime, __wakeup)
 
myht = Z_OBJPROP_P(object);
 
-   php_date_initialize_from_hash(&return_value, &dateobj, myht TSRMLS_CC);
+   if (!php_date_initialize_from_hash(&return_value, &dateobj, myht 
TSRMLS_CC)) {
+   php_error(E_ERROR, "Invalid serialization data for DateTime 
object");
+   }
 }
 /* }}} */
 
diff --git a/ext/date/tests/bug62852.phpt b/ext/date/tests/bug62852.phpt
index 26de510..7013a3f 100644
--- a/ext/date/tests/bug62852.phpt
+++ b/ext/date/tests/bug62852.phpt
@@ -1,36 +1,14 @@
 --TEST--
-Bug #62852 (Unserialize invalid DateTime causes crash)
+Bug #62852 (Unserialize invalid DateTime causes crash), variation 1
 --INI--
 date.timezone=GMT
---XFAIL--
-bug is not fixed yet
 --FILE--
 
 --EXPECTF--
-okey
+Fatal error: Invalid serialization data for DateTime object in %sbug62852.php 
on line %d
diff --git a/ext/date/tests/bug62852_var2.phpt 
b/ext/date/tests/bug62852_var2.phpt
ne

Re: [PHP-CVS] com php-src: ZO+ NEWS: NEWS

2013-03-19 Thread David Soria Parra
On 03/19/2013 07:37 PM, Stas Malyshev wrote:
> Hi!
> 
>>  - Core:
>> +  . Added Zend Optimizer+ extension and enable it by default. More details 
>> here:
>> +https://wiki.php.net/rfc/optimizerplus. (Dmitry)
> 
> I think building it is enabled by default, but extension itself isn't?
> Am I wrong?
> 

Yes thats true.

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



Re: [PHP-CVS] com php-src: ZO+ NEWS: NEWS

2013-03-19 Thread Stas Malyshev
Hi!

>  - Core:
> +  . Added Zend Optimizer+ extension and enable it by default. More details 
> here:
> +https://wiki.php.net/rfc/optimizerplus. (Dmitry)

I think building it is enabled by default, but extension itself isn't?
Am I wrong?

-- 
Stanislav Malyshev, Software Architect
SugarCRM: http://www.sugarcrm.com/
(408)454-6900 ext. 227

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



Re: [PHP-CVS] com php-src: fix C90 compat: Zend/zend_API.c

2013-03-19 Thread Dmitry Stogov
Sorry, my mistake.
Thanks.

Dmitry.

On Tue, Mar 19, 2013 at 5:42 PM, Anatol Belski  wrote:

> Commit:7687b8b81c599b0374cb902e9dd812d2cfc12efd
> Author:Anatol Belski  Tue, 19 Mar 2013 14:42:18
> +0100
> Parents:   7b0993bfb4b19bb160a72310b907c4fc12a5bef9
> Branches:  PHP-5.4
>
> Link:
> http://git.php.net/?p=php-src.git;a=commitdiff;h=7687b8b81c599b0374cb902e9dd812d2cfc12efd
>
> Log:
> fix C90 compat
>
> Changed paths:
>   M  Zend/zend_API.c
>
>
> Diff:
> diff --git a/Zend/zend_API.c b/Zend/zend_API.c
> index b9e97cb..668ddff 100644
> --- a/Zend/zend_API.c
> +++ b/Zend/zend_API.c
> @@ -1039,9 +1039,10 @@ static int zval_update_class_constant(zval **pp,
> int is_static, int offset TSRML
>
>  zend_hash_move_forward_ex(&ce->properties_info, &pos)) {
> if (is_static ==
> ((prop_info->flags & ZEND_ACC_STATIC) != 0) &&
> offset == prop_info->offset) {
> +   int ret;
> zend_class_entry
> *old_scope = *scope;
> *scope = prop_info->ce;
> -   int ret =
> zval_update_constant(pp, (void*)1 TSRMLS_CC);
> +   ret =
> zval_update_constant(pp, (void*)1 TSRMLS_CC);
> *scope = old_scope;
> return ret;
> }
>
>
> --
> PHP CVS Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>


[PHP-CVS] com php-src: Refer to Zend Optimizer as Zend Opcache from now on: NEWS

2013-03-19 Thread David Soria Parra
Commit:5e55c6d9fd5cd69fa67296cd6371d81812b98f2a
Author:David Soria Parra  Tue, 19 Mar 2013 16:15:54 
+0100
Parents:   60b36a681986c754a925daa7142e28b450f85c38
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=5e55c6d9fd5cd69fa67296cd6371d81812b98f2a

Log:
Refer to Zend Optimizer as Zend Opcache from now on

Changed paths:
  M  NEWS


Diff:
diff --git a/NEWS b/NEWS
index c8b70ef..ef2fc8f 100644
--- a/NEWS
+++ b/NEWS
@@ -3,7 +3,7 @@ PHP 
   NEWS
 ?? ??? 20??, PHP 5.5.0 Beta 1
 
 - Core:
-  . Added Zend Optimizer+ extension and enable it by default. More details 
here:
+  . Added Zend Opcache extension and enable it by default. More details here:
 https://wiki.php.net/rfc/optimizerplus. (Dmitry)
   . Fixed bug #64354 (Unserialize array of objects whose class can't
 be autoloaded fail). (Laruence)


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



[PHP-CVS] com php-src: ZO+ NEWS: NEWS

2013-03-19 Thread David Soria Parra
Commit:60b36a681986c754a925daa7142e28b450f85c38
Author:David Soria Parra  Tue, 19 Mar 2013 15:26:40 
+0100
Parents:   25b84546a8a0ecb21df2e9a9531913fca66c318c
Branches:  PHP-5.5

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=60b36a681986c754a925daa7142e28b450f85c38

Log:
ZO+ NEWS

Changed paths:
  M  NEWS


Diff:
diff --git a/NEWS b/NEWS
index 805a40d..c8b70ef 100644
--- a/NEWS
+++ b/NEWS
@@ -3,6 +3,8 @@ PHP 
   NEWS
 ?? ??? 20??, PHP 5.5.0 Beta 1
 
 - Core:
+  . Added Zend Optimizer+ extension and enable it by default. More details 
here:
+https://wiki.php.net/rfc/optimizerplus. (Dmitry)
   . Fixed bug #64354 (Unserialize array of objects whose class can't
 be autoloaded fail). (Laruence)
   . Added support for changing the process's title in CLI/CLI-Server SAPIs.


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



[PHP-CVS] com php-src: fix C89 compat: ext/spl/spl_dllist.c

2013-03-19 Thread Anatol Belski
Commit:b3d82845dbdd00d7d9293247331cd08862ec30a2
Author:Anatol Belski  Tue, 19 Mar 2013 15:13:27 +0100
Parents:   ce04268bb9de5eb1c6f7794889ae5661d2c87b91
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=b3d82845dbdd00d7d9293247331cd08862ec30a2

Log:
fix C89 compat

Changed paths:
  M  ext/spl/spl_dllist.c


Diff:
diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c
index 3ac2201..8361086 100644
--- a/ext/spl/spl_dllist.c
+++ b/ext/spl/spl_dllist.c
@@ -1260,12 +1260,12 @@ SPL_METHOD(SplDoublyLinkedList, add)
/* If index is the last entry+1 then we do a push because we're 
not inserting before any entry */
spl_ptr_llist_push(intern->llist, value TSRMLS_CC);
} else {
-   /* Get the element we want to insert before */
-   element = spl_ptr_llist_offset(intern->llist, index, 
intern->flags & SPL_DLLIST_IT_LIFO);
-
/* Create the new element we want to insert */
spl_ptr_llist_element *elem = 
emalloc(sizeof(spl_ptr_llist_element));
 
+   /* Get the element we want to insert before */
+   element = spl_ptr_llist_offset(intern->llist, index, 
intern->flags & SPL_DLLIST_IT_LIFO);
+
elem->data = value;
elem->rc   = 1;
/* connect to the neighbours */


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: main/php_ini.c

2013-03-19 Thread David Soria Parra
Commit:c542e969f276cf6531383cfe71e76337407a3b2f
Author:David Soria Parra  Tue, 19 Mar 2013 15:11:48 
+0100
Parents:   ce04268bb9de5eb1c6f7794889ae5661d2c87b91 
c6f6bf88d8c660f7dcb412b0d5049d376e3a5d36
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=c542e969f276cf6531383cfe71e76337407a3b2f

Log:
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  Fix typos

Changed paths:
  MM  main/php_ini.c


Diff:



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



[PHP-CVS] com php-src: Fix typos: main/php_ini.c

2013-03-19 Thread David Soria Parra
Commit:c6f6bf88d8c660f7dcb412b0d5049d376e3a5d36
Author:Carson McDonald  Tue, 12 Mar 2013 
04:15:50 -0400
Committer: David Soria Parra   Tue, 19 Mar 2013 15:11:34 +0100
Parents:   7687b8b81c599b0374cb902e9dd812d2cfc12efd
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=c6f6bf88d8c660f7dcb412b0d5049d376e3a5d36

Log:
Fix typos

Changed paths:
  M  main/php_ini.c


Diff:
diff --git a/main/php_ini.c b/main/php_ini.c
index b15a384..bceb6e5 100644
--- a/main/php_ini.c
+++ b/main/php_ini.c
@@ -290,7 +290,7 @@ static void php_ini_parser_cb(zval *arg1, zval *arg2, zval 
*arg3, int callback_t
is_special_section = 1;
has_per_dir_config = 1;
 
-   /* make the path lowercase on Windows, 
for case insensitivty. Does nothign for other platforms */
+   /* make the path lowercase on Windows, 
for case insensitivity. Does nothing for other platforms */
TRANSLATE_SLASHES_LOWER(key);
 
/* HOST sections */


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend_API.c

2013-03-19 Thread Anatol Belski
Commit:6f0f5d5281f4311dc4254b917ba185bacb659add
Author:Anatol Belski  Tue, 19 Mar 2013 14:44:20 +0100
Parents:   4837bdb91049e47e0c15873a2d1d4d1f7a4c65d2 
7687b8b81c599b0374cb902e9dd812d2cfc12efd
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=6f0f5d5281f4311dc4254b917ba185bacb659add

Log:
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  fix C90 compat

Changed paths:
  MM  Zend/zend_API.c


Diff:



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



[PHP-CVS] com php-src: fix C90 compat: Zend/zend_API.c

2013-03-19 Thread Anatol Belski
Commit:7687b8b81c599b0374cb902e9dd812d2cfc12efd
Author:Anatol Belski  Tue, 19 Mar 2013 14:42:18 +0100
Parents:   7b0993bfb4b19bb160a72310b907c4fc12a5bef9
Branches:  PHP-5.4

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=7687b8b81c599b0374cb902e9dd812d2cfc12efd

Log:
fix C90 compat

Changed paths:
  M  Zend/zend_API.c


Diff:
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index b9e97cb..668ddff 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -1039,9 +1039,10 @@ static int zval_update_class_constant(zval **pp, int 
is_static, int offset TSRML
 
zend_hash_move_forward_ex(&ce->properties_info, &pos)) {
if (is_static == ((prop_info->flags & 
ZEND_ACC_STATIC) != 0) &&
offset == prop_info->offset) {
+   int ret;
zend_class_entry *old_scope = 
*scope;
*scope = prop_info->ce;
-   int ret = 
zval_update_constant(pp, (void*)1 TSRMLS_CC);
+   ret = zval_update_constant(pp, 
(void*)1 TSRMLS_CC);
*scope = old_scope;
return ret;
}


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



[PHP-CVS] com php-src: Fix #48358 add() method for SplDoublyLinkedLis: NEWS ext/spl/spl_dllist.c ext/spl/tests/SplDoublyLinkedList_add_invalid_offset.phpt ext/spl/tests/SplDoublyLinkedList_add_missing

2013-03-19 Thread David Soria Parra
Commit:42574690795937290a4ad6d319f917c077542953
Author:Mark Baker  Mon, 18 Mar 2013 22:01:42 
+0100
Committer: David Soria Parra   Tue, 19 Mar 2013 14:46:21 +0100
Parents:   4837bdb91049e47e0c15873a2d1d4d1f7a4c65d2
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=42574690795937290a4ad6d319f917c077542953

Log:
Fix #48358 add() method for SplDoublyLinkedLis

Bugs:
https://bugs.php.net/48358

Changed paths:
  M  NEWS
  M  ext/spl/spl_dllist.c
  A  ext/spl/tests/SplDoublyLinkedList_add_invalid_offset.phpt
  A  ext/spl/tests/SplDoublyLinkedList_add_missing_parameter1.phpt
  A  ext/spl/tests/SplDoublyLinkedList_add_missing_parameter2.phpt
  A  ext/spl/tests/SplDoublyLinkedList_add_null_offset.phpt
  A  ext/spl/tests/dllist_013.phpt

diff --git a/NEWS b/NEWS
index 2ea5117..805a40d 100644
--- a/NEWS
+++ b/NEWS
@@ -22,6 +22,10 @@ PHP  
  NEWS
 (Gustavo, Derick, Anatol)
   . Fixed bug #62852 (Unserialize Invalid Date causes crash). (Anatol)
 
+- SPL:
+  . Implement FR #48358 (Add SplDoublyLinkedList::add() to insert an element
+at a given offset). (Mark Baker, David Soria Parra)
+
 07 Mar 2013, PHP 5.5.0 Alpha 6
 
 - Core:
diff --git a/ext/spl/spl_dllist.c b/ext/spl/spl_dllist.c
index a7f15d0..3ac2201 100644
--- a/ext/spl/spl_dllist.c
+++ b/ext/spl/spl_dllist.c
@@ -794,7 +794,7 @@ SPL_METHOD(SplDoublyLinkedList, offsetGet)
intern = (spl_dllist_object*)zend_object_store_get_object(getThis() 
TSRMLS_CC);
index  = spl_offset_convert_to_long(zindex TSRMLS_CC);
 
-if (index < 0 || index >= intern->llist->count) {
+   if (index < 0 || index >= intern->llist->count) {
zend_throw_exception(spl_ce_OutOfRangeException, "Offset 
invalid or out of range", 0 TSRMLS_CC);
return;
}
@@ -881,9 +881,9 @@ SPL_METHOD(SplDoublyLinkedList, offsetUnset)
 
intern = (spl_dllist_object*)zend_object_store_get_object(getThis() 
TSRMLS_CC);
index  = spl_offset_convert_to_long(zindex TSRMLS_CC);
-llist  = intern->llist;
+   llist  = intern->llist;
 
-if (index < 0 || index >= intern->llist->count) {
+   if (index < 0 || index >= intern->llist->count) {
zend_throw_exception(spl_ce_OutOfRangeException, "Offset out of 
range", 0 TSRMLS_CC);
return;
}
@@ -1138,7 +1138,7 @@ SPL_METHOD(SplDoublyLinkedList, serialize)
spl_dllist_object *intern   = 
(spl_dllist_object*)zend_object_store_get_object(getThis() TSRMLS_CC);
smart_str  buf  = {0};
spl_ptr_llist_element *current  = intern->llist->head, *next;
-zval   *flags;
+   zval   *flags;
php_serialize_data_t   var_hash;
 
if (zend_parse_parameters_none() == FAILURE) {
@@ -1234,6 +1234,61 @@ error:
 
 } /* }}} */
 
+/* {{{ proto void SplDoublyLinkedList::add(mixed $index, mixed $newval) U
+ Inserts a new entry before the specified $index consisting of $newval. */
+SPL_METHOD(SplDoublyLinkedList, add)
+{
+   zval  *zindex, *value;
+   spl_dllist_object *intern;
+   spl_ptr_llist_element *element;
+   long  index;
+
+   if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "zz", &zindex, 
&value) == FAILURE) {
+   return;
+   }
+   SEPARATE_ARG_IF_REF(value);
+
+   intern = (spl_dllist_object*)zend_object_store_get_object(getThis() 
TSRMLS_CC);
+   index  = spl_offset_convert_to_long(zindex TSRMLS_CC);
+
+   if (index < 0 || index > intern->llist->count) {
+   zend_throw_exception(spl_ce_OutOfRangeException, "Offset 
invalid or out of range", 0 TSRMLS_CC);
+   return;
+   }
+
+   if (index == intern->llist->count) {
+   /* If index is the last entry+1 then we do a push because we're 
not inserting before any entry */
+   spl_ptr_llist_push(intern->llist, value TSRMLS_CC);
+   } else {
+   /* Get the element we want to insert before */
+   element = spl_ptr_llist_offset(intern->llist, index, 
intern->flags & SPL_DLLIST_IT_LIFO);
+
+   /* Create the new element we want to insert */
+   spl_ptr_llist_element *elem = 
emalloc(sizeof(spl_ptr_llist_element));
+
+   elem->data = value;
+   elem->rc   = 1;
+   /* connect to the neighbours */
+   elem->next = element;
+   elem->prev = element->prev;
+
+   /* connect the neighbours to this new element */
+   if (elem->prev == NULL) {
+   intern->llist->head = elem;
+   } else {
+   element->prev->next = elem;
+   }
+   element->prev = elem;
+
+   intern->llist->count++;
+
+   if (intern->llist->ctor) {
+   inte

[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend_API.c

2013-03-19 Thread Dmitry Stogov
Commit:4837bdb91049e47e0c15873a2d1d4d1f7a4c65d2
Author:Dmitry Stogov  Tue, 19 Mar 2013 17:04:35 
+0400
Parents:   960d5be52873acdf1afc67aa12b72d2cdc93119c 
7b0993bfb4b19bb160a72310b907c4fc12a5bef9
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=4837bdb91049e47e0c15873a2d1d4d1f7a4c65d2

Log:
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  Fixed bug #63976 (Parent class incorrectly using child constant in class 
property)

Conflicts:
NEWS

Bugs:
https://bugs.php.net/63976

Changed paths:
  MM  Zend/zend_API.c


Diff:



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



[PHP-CVS] com php-src: Fixed bug #63976 (Parent class incorrectly using child constant in class property): NEWS Zend/tests/bug63976.phpt Zend/zend_API.c

2013-03-19 Thread Dmitry Stogov
Commit:7b0993bfb4b19bb160a72310b907c4fc12a5bef9
Author:Dmitry Stogov  Tue, 19 Mar 2013 16:59:01 
+0400
Parents:   984561cfa81adfd893833bce506544349b04c803
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=7b0993bfb4b19bb160a72310b907c4fc12a5bef9

Log:
Fixed bug #63976 (Parent class incorrectly using child constant in class 
property)

Bugs:
https://bugs.php.net/63976

Changed paths:
  M  NEWS
  A  Zend/tests/bug63976.phpt
  M  Zend/zend_API.c


Diff:
diff --git a/NEWS b/NEWS
index 3c6579d..ca51fc3 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,8 @@ PHP 
   NEWS
 (Dmitry)
   . Fixed bug #64370 (microtime(true) less than 
$_SERVER['REQUEST_TIME_FLOAT']).
 (Anatol)
+  . Fixed bug #63976 (Parent class incorrectly using child constant in class
+property). (Dmitry)
   . Fixed bug #62343 (Show class_alias In get_declared_classes()) (Dmitry)
 
 - PCRE:
diff --git a/Zend/tests/bug63976.phpt b/Zend/tests/bug63976.phpt
new file mode 100644
index 000..0ac09d9
--- /dev/null
+++ b/Zend/tests/bug63976.phpt
@@ -0,0 +1,20 @@
+--TEST--
+Bug #63976 (Parent class incorrectly using child constant in class property)
+--FILE--
+table);
+?>
+--EXPECT--
+string(3) "foo"
diff --git a/Zend/zend_API.c b/Zend/zend_API.c
index eec4ab0..b9e97cb 100644
--- a/Zend/zend_API.c
+++ b/Zend/zend_API.c
@@ -1022,6 +1022,40 @@ ZEND_API void zend_merge_properties(zval *obj, HashTable 
*properties, int destro
 }
 /* }}} */
 
+static int zval_update_class_constant(zval **pp, int is_static, int offset 
TSRMLS_DC) /* {{{ */
+{
+   if ((Z_TYPE_PP(pp) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT ||
+   (Z_TYPE_PP(pp) & IS_CONSTANT_TYPE_MASK) == IS_CONSTANT_ARRAY) { 

+   zend_class_entry **scope = 
EG(in_execution)?&EG(scope):&CG(active_class_entry);
+
+   if ((*scope)->parent) {
+   zend_class_entry *ce = *scope;
+   HashPosition pos;
+   zend_property_info *prop_info;
+
+   do {
+   for 
(zend_hash_internal_pointer_reset_ex(&ce->properties_info, &pos);
+
zend_hash_get_current_data_ex(&ce->properties_info, (void **) &prop_info, &pos) 
== SUCCESS;
+
zend_hash_move_forward_ex(&ce->properties_info, &pos)) {
+   if (is_static == ((prop_info->flags & 
ZEND_ACC_STATIC) != 0) &&
+   offset == prop_info->offset) {
+   zend_class_entry *old_scope = 
*scope;
+   *scope = prop_info->ce;
+   int ret = 
zval_update_constant(pp, (void*)1 TSRMLS_CC);
+   *scope = old_scope;
+   return ret;
+   }
+   }   
+   ce = ce->parent;
+   } while (ce);
+   
+   }
+   return zval_update_constant(pp, (void*)1 TSRMLS_CC);
+   }
+   return 0;
+}
+/* }}} */
+
 ZEND_API void zend_update_class_constants(zend_class_entry *class_type 
TSRMLS_DC) /* {{{ */
 {
if ((class_type->ce_flags & ZEND_ACC_CONSTANTS_UPDATED) == 0 || 
(!CE_STATIC_MEMBERS(class_type) && class_type->default_static_members_count)) {
@@ -1034,7 +1068,7 @@ ZEND_API void 
zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
 
for (i = 0; i < class_type->default_properties_count; i++) {
if (class_type->default_properties_table[i]) {
-   
zval_update_constant(&class_type->default_properties_table[i], (void**)1 
TSRMLS_CC);
+   
zval_update_class_constant(&class_type->default_properties_table[i], 0, i 
TSRMLS_CC);
}
}
 
@@ -1075,7 +1109,7 @@ ZEND_API void 
zend_update_class_constants(zend_class_entry *class_type TSRMLS_DC
}
 
for (i = 0; i < class_type->default_static_members_count; i++) {
-   zval_update_constant(&CE_STATIC_MEMBERS(class_type)[i], 
(void**)1 TSRMLS_CC);
+   
zval_update_class_constant(&CE_STATIC_MEMBERS(class_type)[i], 1, i TSRMLS_CC);
}
 
*scope = old_scope;


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



[PHP-CVS] com php-src: Partial fix for bug #64239: Zend/tests/bug64239_1.phpt Zend/zend_builtin_functions.c

2013-03-19 Thread Dmitry Stogov
Commit:984561cfa81adfd893833bce506544349b04c803
Author:Dmitry Stogov  Tue, 19 Mar 2013 15:45:48 
+0400
Parents:   84630a1109084507bc0c78301db831328229f1cb
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=984561cfa81adfd893833bce506544349b04c803

Log:
Partial fix for bug #64239

Bugs:
https://bugs.php.net/64239

Changed paths:
  A  Zend/tests/bug64239_1.phpt
  M  Zend/zend_builtin_functions.c


Diff:
diff --git a/Zend/tests/bug64239_1.phpt b/Zend/tests/bug64239_1.phpt
new file mode 100644
index 000..fe58cbd
--- /dev/null
+++ b/Zend/tests/bug64239_1.phpt
@@ -0,0 +1,22 @@
+--TEST--
+Bug #64239 (get_class_methods() changed behavior)
+--FILE--
+backtrace(); }
+}
+class B {
+   use T2 { t2method as Bmethod; }
+}
+trait T2 {
+   public function t2method() {
+   }
+}
+var_dump(get_class_methods("B"));
+--EXPECT--
+array(2) {
+  [0]=>
+  string(7) "bmethod"
+  [1]=>
+  string(8) "t2method"
+}
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 1e85785..dcb1818 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -1025,6 +1025,13 @@ ZEND_FUNCTION(get_object_vars)
 }
 /* }}} */
 
+static int same_name(const char *key, const char *name, zend_uint name_len)
+{
+   char *lcname = zend_str_tolower_dup(name, name_len);
+   int ret = memcmp(lcname, key, name_len) == 0;
+   efree(lcname);
+   return ret;
+}
 
 /* {{{ proto array get_class_methods(mixed class)
Returns an array of method names for class or class instance. */
@@ -1072,14 +1079,26 @@ ZEND_FUNCTION(get_class_methods)
uint len = strlen(mptr->common.function_name);
 
/* Do not display old-style inherited constructors */
-   if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0 ||
-   mptr->common.scope == ce ||
-   zend_hash_get_current_key_ex(&ce->function_table, 
&key, &key_len, &num_index, 0, &pos) != HASH_KEY_IS_STRING ||
-   zend_binary_strcasecmp(key, key_len-1, 
mptr->common.function_name, len) == 0) {
-
+   if (zend_hash_get_current_key_ex(&ce->function_table, 
&key, &key_len, &num_index, 0, &pos) != HASH_KEY_IS_STRING) {
MAKE_STD_ZVAL(method_name);
ZVAL_STRINGL(method_name, 
mptr->common.function_name, len, 1);

zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval 
*), NULL);
+   } else if ((mptr->common.fn_flags & ZEND_ACC_CTOR) == 0 
||
+   mptr->common.scope == ce ||
+   zend_binary_strcasecmp(key, key_len-1, 
mptr->common.function_name, len) == 0) {
+
+   if (mptr->type == ZEND_USER_FUNCTION &&
+   *mptr->op_array.refcount > 1 &&
+   (len != key_len - 1 ||
+!same_name(key, mptr->common.function_name, 
len))) {
+   MAKE_STD_ZVAL(method_name);
+   ZVAL_STRINGL(method_name, key, key_len 
- 1, 1);
+   
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval 
*), NULL);
+   } else {
+   MAKE_STD_ZVAL(method_name);
+   ZVAL_STRINGL(method_name, 
mptr->common.function_name, len, 1);
+   
zend_hash_next_index_insert(return_value->value.ht, &method_name, sizeof(zval 
*), NULL);
+   }
}
}
zend_hash_move_forward_ex(&ce->function_table, &pos);
@@ -1640,14 +1659,6 @@ ZEND_FUNCTION(restore_exception_handler)
 }
 /* }}} */
 
-static int same_name(const char *key, const char *name, zend_uint name_len)
-{
-   char *lcname = zend_str_tolower_dup(name, name_len);
-   int ret = memcmp(lcname, key, name_len) == 0;
-   efree(lcname);
-   return ret;
-}
-
 static int copy_class_or_interface_name(zend_class_entry **pce TSRMLS_DC, int 
num_args, va_list args, zend_hash_key *hash_key)
 {
zval *array = va_arg(args, zval *);


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend_builtin_functions.c

2013-03-19 Thread Dmitry Stogov
Commit:960d5be52873acdf1afc67aa12b72d2cdc93119c
Author:Dmitry Stogov  Tue, 19 Mar 2013 15:47:43 
+0400
Parents:   74e11fb14c983302c84ee88fee40248b6f9b0f9a 
984561cfa81adfd893833bce506544349b04c803
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=960d5be52873acdf1afc67aa12b72d2cdc93119c

Log:
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  Partial fix for bug #64239

Bugs:
https://bugs.php.net/64239

Changed paths:
  MM  Zend/zend_builtin_functions.c


Diff:



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



[PHP-CVS] com php-src: Fixed bug #62343 (Show class_alias In get_declared_classes()): NEWS Zend/tests/bug62343.phpt Zend/zend_builtin_functions.c

2013-03-19 Thread Dmitry Stogov
Commit:4a6291508d69fab951562b996ed7223c052a0168
Author:Dmitry Stogov  Tue, 19 Mar 2013 14:56:53 
+0400
Parents:   87c8ea15f29cd89e8a58d2f6dce4348453c6ac59
Branches:  PHP-5.3 PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=4a6291508d69fab951562b996ed7223c052a0168

Log:
Fixed bug #62343 (Show class_alias In get_declared_classes())

Bugs:
https://bugs.php.net/62343

Changed paths:
  M  NEWS
  A  Zend/tests/bug62343.phpt
  M  Zend/zend_builtin_functions.c


Diff:
diff --git a/NEWS b/NEWS
index adf868f..c8c6f75 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,7 @@ PHP 
   NEWS
 - Core
   . Fixed bug #64370 (microtime(true) less than 
$_SERVER['REQUEST_TIME_FLOAT']).
 (Anatol)
+  . Fixed bug #62343 (Show class_alias In get_declared_classes()) (Dmitry)
 
 - PCRE:
   . Merged PCRE 8.32). (Anatol)
diff --git a/Zend/tests/bug62343.phpt b/Zend/tests/bug62343.phpt
new file mode 100644
index 000..b0208c4
--- /dev/null
+++ b/Zend/tests/bug62343.phpt
@@ -0,0 +1,13 @@
+--TEST--
+Bug #62343 (Show class_alias In get_declared_classes())
+--FILE--
+
+--EXPECT--
+string(1) "b"
+string(1) "a"
diff --git a/Zend/zend_builtin_functions.c b/Zend/zend_builtin_functions.c
index 06f1462..c60cff5 100644
--- a/Zend/zend_builtin_functions.c
+++ b/Zend/zend_builtin_functions.c
@@ -1541,6 +1541,13 @@ ZEND_FUNCTION(restore_exception_handler)
 }
 /* }}} */
 
+static int same_name(const char *key, const char *name, zend_uint name_len)
+{
+   char *lcname = zend_str_tolower_dup(name, name_len);
+   int ret = memcmp(lcname, key, name_len) == 0;
+   efree(lcname);
+   return ret;
+}
 
 static int copy_class_or_interface_name(zend_class_entry **pce TSRMLS_DC, int 
num_args, va_list args, zend_hash_key *hash_key)
 {
@@ -1552,7 +1559,13 @@ static int copy_class_or_interface_name(zend_class_entry 
**pce TSRMLS_DC, int nu
 
if ((hash_key->nKeyLength==0 || hash_key->arKey[0]!=0)
&& (comply_mask == (ce->ce_flags & mask))) {
-   add_next_index_stringl(array, ce->name, ce->name_length, 1);
+   if (ce->refcount > 1 && 
+   (ce->name_length != hash_key->nKeyLength - 1 || 
+!same_name(hash_key->arKey, ce->name, ce->name_length))) {
+   add_next_index_stringl(array, hash_key->arKey, 
hash_key->nKeyLength - 1, 1);
+   } else {
+   add_next_index_stringl(array, ce->name, 
ce->name_length, 1);
+   }
}
return ZEND_HASH_APPLY_KEEP;
 }


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend_builtin_functions.c

2013-03-19 Thread Dmitry Stogov
Commit:74e11fb14c983302c84ee88fee40248b6f9b0f9a
Author:Dmitry Stogov  Tue, 19 Mar 2013 15:00:24 
+0400
Parents:   ef8c8eaa9583130029facf2817d2c5c4b01f1c41 
84630a1109084507bc0c78301db831328229f1cb
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=74e11fb14c983302c84ee88fee40248b6f9b0f9a

Log:
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  Fixed bug #62343 (Show class_alias In get_declared_classes())

Conflicts:
NEWS

Bugs:
https://bugs.php.net/62343

Changed paths:
  MM  Zend/zend_builtin_functions.c


Diff:



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



[PHP-CVS] com php-src: Merge branch 'PHP-5.3' into PHP-5.4: NEWS Zend/zend_builtin_functions.c

2013-03-19 Thread Dmitry Stogov
Commit:84630a1109084507bc0c78301db831328229f1cb
Author:Dmitry Stogov  Tue, 19 Mar 2013 14:59:08 
+0400
Parents:   e62bb0325763d9847847dd198e05c9b3147caf05 
4a6291508d69fab951562b996ed7223c052a0168
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=84630a1109084507bc0c78301db831328229f1cb

Log:
Merge branch 'PHP-5.3' into PHP-5.4

* PHP-5.3:
  Fixed bug #62343 (Show class_alias In get_declared_classes())

Bugs:
https://bugs.php.net/62343

Changed paths:
  MM  NEWS
  MM  Zend/zend_builtin_functions.c


Diff:
diff --cc NEWS
index 75b588b,c8c6f75..3c6579d
--- a/NEWS
+++ b/NEWS
@@@ -1,37 -1,14 +1,38 @@@
  PHP
NEWS
  
|||
 -?? ??? 2013, PHP 5.3.24
 -
 +?? ??? 2013, PHP 5.4.14
  - Core
 +  . Fixed bug #64417 (ArrayAccess::&offsetGet() in a trait causes fatal 
error).
 +(Dmitry)
. Fixed bug #64370 (microtime(true) less than 
$_SERVER['REQUEST_TIME_FLOAT']).
  (Anatol)
+   . Fixed bug #62343 (Show class_alias In get_declared_classes()) (Dmitry)
  
  - PCRE:
 -  . Merged PCRE 8.32). (Anatol)
 +  . Merged PCRE 8.32. (Anatol)
 +
 +- SNMP:
 +  . Fixed bug #61981 (OO API, walk: $suffix_as_key is not working correctly).
 +  (Boris Lytochkin)
 +
 +14 Mar 2013, PHP 5.4.13
 +
 +- Core:
 +  . Fixed bug #64354 (Unserialize array of objects whose class can't
 +be autoloaded fail). (Laruence)
 +  . Fixed bug #64235 (Insteadof not work for class method in 5.4.11).
 +(Laruence)
 +  . Fixed bug #64197 (_Offsetof() macro used but not defined on ARM/Clang). 
 +(Ard Biesheuvel)
 +  . Implemented FR #64175 (Added HTTP codes as of RFC 6585). (Jonh Wendell)
 +  . Fixed bug #64142 (dval to lval different behavior on ppc64). (Remi)
 +  . Fixed bug #64070 (Inheritance with Traits failed with error). (Dmitry)
 +
 +- CLI server:
 +  . Fixed bug #64128 (buit-in web server is broken on ppc64). (Remi)
 +
 +- Mbstring:
 +  . mb_split() can now handle empty matches like preg_split() does. 
(Moriyoshi)
  
  - mysqlnd
. Fixed bug #63530 (mysqlnd_stmt::bind_one_parameter crashes, uses wrong 
alloc


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



[PHP-CVS] com php-src: Merge branch 'PHP-5.4' into PHP-5.5: Zend/zend_compile.c

2013-03-19 Thread Dmitry Stogov
Commit:ef8c8eaa9583130029facf2817d2c5c4b01f1c41
Author:Dmitry Stogov  Tue, 19 Mar 2013 13:07:32 
+0400
Parents:   f621f0b8e7f1a2d061d37e16f71bcb2000c2a786 
e62bb0325763d9847847dd198e05c9b3147caf05
Branches:  PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=ef8c8eaa9583130029facf2817d2c5c4b01f1c41

Log:
Merge branch 'PHP-5.4' into PHP-5.5

* PHP-5.4:
  Fixed bug #64417 (ArrayAccess::&offsetGet() in a trait causes fatal error)

Conflicts:
NEWS
Zend/zend_compile.c

Bugs:
https://bugs.php.net/64417

Changed paths:
  MM  Zend/zend_compile.c


Diff:
diff --cc Zend/zend_compile.c
index aa1df99,766a2de..6df3def
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@@ -3829,10 -3632,10 +3829,10 @@@ static zend_bool zend_traits_method_com
  {
zend_uintfn_flags = fn->common.scope->ce_flags;
zend_uint other_flags = other_fn->common.scope->ce_flags;
 -  
 +
return zend_do_perform_implementation_check(fn, other_fn TSRMLS_CC)
-   && zend_do_perform_implementation_check(other_fn, fn TSRMLS_CC)
+   && ((other_fn->common.scope->ce_flags & ZEND_ACC_INTERFACE) || 
zend_do_perform_implementation_check(other_fn, fn TSRMLS_CC))
 -  && ((fn_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC)) == 
 +  && ((fn_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC)) ==
(other_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC))); /* equal 
final and static qualifier */
  }
  /* }}} */


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



[PHP-CVS] com php-src: Fixed bug #64417 (ArrayAccess::&offsetGet() in a trait causes fatal error): NEWS Zend/tests/bug64417.phpt Zend/zend_compile.c

2013-03-19 Thread Dmitry Stogov
Commit:e62bb0325763d9847847dd198e05c9b3147caf05
Author:Dmitry Stogov  Tue, 19 Mar 2013 12:48:23 
+0400
Parents:   e25b2d7ea5a2699fb32b467aae9e3a0fda2ba0db
Branches:  PHP-5.4 PHP-5.5 master

Link:   
http://git.php.net/?p=php-src.git;a=commitdiff;h=e62bb0325763d9847847dd198e05c9b3147caf05

Log:
Fixed bug #64417 (ArrayAccess::&offsetGet() in a trait causes fatal error)

Bugs:
https://bugs.php.net/64417

Changed paths:
  M  NEWS
  A  Zend/tests/bug64417.phpt
  M  Zend/zend_compile.c


Diff:
diff --git a/NEWS b/NEWS
index fd05e22..75b588b 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,8 @@ PHP 
   NEWS
 |||
 ?? ??? 2013, PHP 5.4.14
 - Core
+  . Fixed bug #64417 (ArrayAccess::&offsetGet() in a trait causes fatal error).
+(Dmitry)
   . Fixed bug #64370 (microtime(true) less than 
$_SERVER['REQUEST_TIME_FLOAT']).
 (Anatol)
 
diff --git a/Zend/tests/bug64417.phpt b/Zend/tests/bug64417.phpt
new file mode 100644
index 000..f3ef740
--- /dev/null
+++ b/Zend/tests/bug64417.phpt
@@ -0,0 +1,39 @@
+--TEST--
+Bug #64417 (BC break: ArrayAccess::&offsetGet() in a trait causes fatal error)
+--FILE--
+container[] = $value;
+} else {
+$this->container[$offset] = $value;
+}
+}
+public function offsetExists($offset) {
+return isset($this->container[$offset]);
+}
+public function offsetUnset($offset) {
+unset($this->container[$offset]);
+}
+public function &offsetGet($offset) {
+   $result = null;
+if (isset($this->container[$offset])) {
+$result = &$this->container[$offset];
+}
+return $result;
+}
+}
+
+class obj implements ArrayAccess {
+use aa;
+}
+
+$o = new obj;
+$o['x'] = 1;
+++$o['x'];
+echo $o['x'], "\n";
+--EXPECT--
+2
+
diff --git a/Zend/zend_compile.c b/Zend/zend_compile.c
index 0a1749d..766a2de 100644
--- a/Zend/zend_compile.c
+++ b/Zend/zend_compile.c
@@ -3634,7 +3634,7 @@ static zend_bool 
zend_traits_method_compatibility_check(zend_function *fn, zend_
zend_uint other_flags = other_fn->common.scope->ce_flags;

return zend_do_perform_implementation_check(fn, other_fn TSRMLS_CC)
-   && zend_do_perform_implementation_check(other_fn, fn TSRMLS_CC)
+   && ((other_fn->common.scope->ce_flags & ZEND_ACC_INTERFACE) || 
zend_do_perform_implementation_check(other_fn, fn TSRMLS_CC))
&& ((fn_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC)) == 
(other_flags & (ZEND_ACC_FINAL|ZEND_ACC_STATIC))); /* equal 
final and static qualifier */
 }


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



Re: [PHP-CVS] com php-src: Avoid trailing line break: ext/opcache/zend_accelerator_module.c

2013-03-19 Thread Dmitry Stogov
On Mon, Mar 18, 2013 at 9:51 PM, Andrey Hristov  wrote:

> On 03/18/2013 02:40 PM, Dmitry Stogov wrote:
>
>> Hi Andrey,
>>
>> I don't think it makes a lot of sense to make it in only this particular
>> place.
>> We use "int" in thousands other places (near everywhere across PHP
>> sources).
>>
>
> "A journey of a thousand miles begins with a single step" Lau-Tzu :)
>

OK :)

Dmitry.