Bug #64720 [Com]: SegFault on zend_deactivate (php-fpm)

2013-04-29 Thread d dot ananyev at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=64720&edit=1

 ID: 64720
 Comment by: d dot ananyev at gmail dot com
 Reported by:d dot ananyev at gmail dot com
 Summary:SegFault on zend_deactivate (php-fpm)
 Status: Feedback
 Type:   Bug
 Package:opcache
 Operating System:   CentOS release 6.4 (Final)
 PHP Version:5.4.14
 Block user comment: N
 Private report: N

 New Comment:

We've got the same segfault trace without any opcode cache.

Core was generated by `php-fpm: pool www
 
'.
Program terminated with signal 11, Segmentation fault.
#0  _zend_mm_free_int (heap=0x1177330, p=0x17926c0) at /usr/build/php-
5.4.10/php-5.4.10/Zend/zend_alloc.c:2100
2100if (ZEND_MM_IS_FREE_BLOCK(next_block)) {
Missing separate debuginfos, use: debuginfo-install fftw-3.2.1-3.1.el6.x86_64 
lcms-libs-1.19-1.el6.x86_64 libc-client-2007e-11.el6.x86_64 libidn-1.18-
2.el6.x86_64 libmcrypt-2.5.8-9.el6.x86_64 librabbitmq-0.2-
0.1.git2059570.el6.remi.x86_64 libtool-ltdl-2.2.6-15.5.el6.x86_64 xz-libs-
4.999.9-0.3.beta.20091007git.el6.x86_64
(gdb) bt
#0  _zend_mm_free_int (heap=0x1177330, p=0x17926c0) at /usr/build/php-
5.4.10/php-5.4.10/Zend/zend_alloc.c:2100
#1  0x007116d7 in _zval_dtor (zval_ptr=0x16beb60) at /usr/build/php-
5.4.10/php-5.4.10/Zend/zend_variables.h:35
#2  _zval_ptr_dtor (zval_ptr=0x16beb60) at /usr/build/php-5.4.10/php-
5.4.10/Zend/zend_execute_API.c:438
#3  0x007163af in cleanup_user_class_data (pce=) 
at 
/usr/build/php-5.4.10/php-5.4.10/Zend/zend_opcode.c:165
#4  zend_cleanup_user_class_data (pce=) at /usr/build/php-
5.4.10/php-5.4.10/Zend/zend_opcode.c:198
#5  0x0072b944 in zend_hash_reverse_apply (ht=0x1177c90, 
apply_func=0x716340 ) at /usr/build/php-
5.4.10/php-5.4.10/Zend/zend_hash.c:799
#6  0x00714156 in shutdown_executor () at /usr/build/php-5.4.10/php-
5.4.10/Zend/zend_execute_API.c:289
#7  0x0071f412 in zend_deactivate () at /usr/build/php-5.4.10/php-
5.4.10/Zend/zend.c:938
#8  0x006c2a3c in php_request_shutdown (dummy=) at 
/usr/build/php-5.4.10/php-5.4.10/main/main.c:1790
#9  0x007d0d49 in main (argc=, argv=) at /usr/build/php-5.4.10/php-5.4.10/sapi/fpm/fpm/fpm_main.c:1948


Previous Comments:

[2013-04-26 18:39:52] s...@php.net

If it is OPcache related, try using OPcache from https://github.com/zend-
dev/ZendOptimizerPlus.  This has various fixes that aren't yet in PECL.


[2013-04-26 17:43:42] d dot ananyev at gmail dot com

I installed OpCache from this link:
http://pecl.php.net/package/ZendOpcache/7.0.1

I'll check if it will be reproduced without opcode cache.


[2013-04-26 17:13:04] s...@php.net

Where did you install opcache from?
Does the crash happen without opcache?


[2013-04-26 13:10:43] d dot ananyev at gmail dot com

i'sorry we're using php-5.4.10 because not all modules can run on 5.4.14


[2013-04-26 10:47:42] d dot ananyev at gmail dot com

My opcache stats (screenshots)
https://drive.google.com/folderview?id=0B4F2-uZsSusnLWF0a2ZrQ2REUmc&usp=sharing




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=64720


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64720&edit=1


Bug #64724 [Asn->Fbk]: Objects stored in Sessions sometimes get "lost".

2013-04-29 Thread mike
Edit report at https://bugs.php.net/bug.php?id=64724&edit=1

 ID: 64724
 Updated by: m...@php.net
 Reported by:php dot bugs at lippe-net dot de
 Summary:Objects stored in Sessions sometimes get "lost".
-Status: Assigned
+Status: Feedback
 Type:   Bug
 Package:*General Issues
 Operating System:   Debian Wheezy
 PHP Version:5.4.14
 Assigned To:mike
 Block user comment: N
 Private report: N

 New Comment:

Can't reproduce.

Do you have any special extensions loaded? If so, see if that also happens 
without them loaded.


Previous Comments:

[2013-04-27 15:45:48] larue...@php.net

maybe due to the serialize


[2013-04-26 15:04:24] php dot bugs at lippe-net dot de

Description:

The "transactions" array of the $_SESSION variable is initialized only once.

If you repeat the invocation of the script. After a while the array contains 
some 
elements that are no more Objects of "class S" but references (for example 
r:5607;).



Test script:
---
data[] = mt_rand(0, 50);
}
}

public function serialize() {
return serialize($this->data);
}

public function unserialize($data) {
$this->data = unserialize($data);
}

}

session_name("testS");
session_start();

if ( empty($_SESSION["transactions"]) ) {
$_SESSION["transactions"] = [ new S(), new S(), new S(), new S() ];
}

echo serialize($_SESSION);

?>

Expected result:

Example (first call):
transactions|a:4:{i:0;C:1:"S":76:{a:8:
{i:0;i:9;i:1;i:24;i:2;i:23;i:3;i:46;i:4;i:29;i:5;i:4;i:6;i:44;i:7;i:14;}}i:1;C:1:"
S":51:{a:5:{i:0;i:11;i:1;i:45;i:2;i:12;i:3;i:10;i:4;i:21;}}i:2;C:1:"S":59:{a:6:
{i:0;i:47;i:1;i:5;i:2;i:40;i:3;i:35;i:4;i:29;i:5;i:14;}}i:3;C:1:"S":58:{a:6:
{i:0;i:20;i:1;i:20;i:2;i:7;i:3;i:44;i:4;i:7;i:5;i:27;}}}

Actual result:
--
Example (after some roundabout 50 calls):

transactions|a:4:{i:0;r:5607;i:1;r:5617;i:2;r:5624;i:3;r:5632;}






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64724&edit=1


Bug #64733 [Opn->Nab]: handling large int does not work according to documentation

2013-04-29 Thread cataphract
Edit report at https://bugs.php.net/bug.php?id=64733&edit=1

 ID: 64733
 Updated by: cataphr...@php.net
 Reported by:ludko2 at gmail dot com
 Summary:handling large int does not work according to
 documentation
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:*General Issues
 Operating System:   win7 64bit
 PHP Version:5.4.14
 Block user comment: N
 Private report: N

 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

The documentation is clear in that this is platform dependent behavior.


Previous Comments:

[2013-04-29 09:04:00] ludko2 at gmail dot com

Description:

handling large int does not work according to documentation:

(Tested on 5.4.6)

Example from documentation: http://php.net/manual/en/language.types.integer.php

$large_number = 9223372036854775807;
var_dump($large_number); // int(9223372036854775807)


If this is expected behavior, please update documentation to specify it more 
clearly.

Please note that converting all integer values to string with number_format 
function is quite time and code consuming..

Test script:
---
$large_number = 9223372036854775807;
var_dump($large_number); // int(9223372036854775807)

Expected result:

int(9223372036854775807)

Actual result:
--
float(9.2233720368548E+18)






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64733&edit=1


Bug #64720 [Fbk->Opn]: SegFault on zend_deactivate (php-fpm)

2013-04-29 Thread d dot ananyev at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=64720&edit=1

 ID: 64720
 User updated by:d dot ananyev at gmail dot com
 Reported by:d dot ananyev at gmail dot com
 Summary:SegFault on zend_deactivate (php-fpm)
-Status: Feedback
+Status: Open
 Type:   Bug
-Package:opcache
+Package:Reproducible crash
 Operating System:   CentOS release 6.4 (Final)
-PHP Version:5.4.14
+PHP Version:5.4.10
 Block user comment: N
 Private report: N

 New Comment:

It's not opcache related


Previous Comments:

[2013-04-29 09:01:31] d dot ananyev at gmail dot com

We've got the same segfault trace without any opcode cache.

Core was generated by `php-fpm: pool www
 
'.
Program terminated with signal 11, Segmentation fault.
#0  _zend_mm_free_int (heap=0x1177330, p=0x17926c0) at /usr/build/php-
5.4.10/php-5.4.10/Zend/zend_alloc.c:2100
2100if (ZEND_MM_IS_FREE_BLOCK(next_block)) {
Missing separate debuginfos, use: debuginfo-install fftw-3.2.1-3.1.el6.x86_64 
lcms-libs-1.19-1.el6.x86_64 libc-client-2007e-11.el6.x86_64 libidn-1.18-
2.el6.x86_64 libmcrypt-2.5.8-9.el6.x86_64 librabbitmq-0.2-
0.1.git2059570.el6.remi.x86_64 libtool-ltdl-2.2.6-15.5.el6.x86_64 xz-libs-
4.999.9-0.3.beta.20091007git.el6.x86_64
(gdb) bt
#0  _zend_mm_free_int (heap=0x1177330, p=0x17926c0) at /usr/build/php-
5.4.10/php-5.4.10/Zend/zend_alloc.c:2100
#1  0x007116d7 in _zval_dtor (zval_ptr=0x16beb60) at /usr/build/php-
5.4.10/php-5.4.10/Zend/zend_variables.h:35
#2  _zval_ptr_dtor (zval_ptr=0x16beb60) at /usr/build/php-5.4.10/php-
5.4.10/Zend/zend_execute_API.c:438
#3  0x007163af in cleanup_user_class_data (pce=) 
at 
/usr/build/php-5.4.10/php-5.4.10/Zend/zend_opcode.c:165
#4  zend_cleanup_user_class_data (pce=) at /usr/build/php-
5.4.10/php-5.4.10/Zend/zend_opcode.c:198
#5  0x0072b944 in zend_hash_reverse_apply (ht=0x1177c90, 
apply_func=0x716340 ) at /usr/build/php-
5.4.10/php-5.4.10/Zend/zend_hash.c:799
#6  0x00714156 in shutdown_executor () at /usr/build/php-5.4.10/php-
5.4.10/Zend/zend_execute_API.c:289
#7  0x0071f412 in zend_deactivate () at /usr/build/php-5.4.10/php-
5.4.10/Zend/zend.c:938
#8  0x006c2a3c in php_request_shutdown (dummy=) at 
/usr/build/php-5.4.10/php-5.4.10/main/main.c:1790
#9  0x007d0d49 in main (argc=, argv=) at /usr/build/php-5.4.10/php-5.4.10/sapi/fpm/fpm/fpm_main.c:1948


[2013-04-26 18:39:52] s...@php.net

If it is OPcache related, try using OPcache from https://github.com/zend-
dev/ZendOptimizerPlus.  This has various fixes that aren't yet in PECL.


[2013-04-26 17:43:42] d dot ananyev at gmail dot com

I installed OpCache from this link:
http://pecl.php.net/package/ZendOpcache/7.0.1

I'll check if it will be reproduced without opcode cache.


[2013-04-26 17:13:04] s...@php.net

Where did you install opcache from?
Does the crash happen without opcache?


[2013-04-26 13:10:43] d dot ananyev at gmail dot com

i'sorry we're using php-5.4.10 because not all modules can run on 5.4.14




The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at

https://bugs.php.net/bug.php?id=64720


-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64720&edit=1


[PHP-BUG] Bug #64733 [NEW]: handling large int does not work according to documentation

2013-04-29 Thread ludko2 at gmail dot com
From: ludko2 at gmail dot com
Operating system: win7 64bit
PHP version:  5.4.14
Package:  *General Issues
Bug Type: Bug
Bug description:handling large int does not work according to documentation

Description:

handling large int does not work according to documentation:

(Tested on 5.4.6)

Example from documentation:
http://php.net/manual/en/language.types.integer.php

$large_number = 9223372036854775807;
var_dump($large_number); // int(9223372036854775807)


If this is expected behavior, please update documentation to specify it
more clearly.

Please note that converting all integer values to string with number_format
function is quite time and code consuming..

Test script:
---
$large_number = 9223372036854775807;
var_dump($large_number); // int(9223372036854775807)

Expected result:

int(9223372036854775807)

Actual result:
--
float(9.2233720368548E+18)

-- 
Edit bug report at https://bugs.php.net/bug.php?id=64733&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64733&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64733&r=trysnapshot53
Try a snapshot (trunk): 
https://bugs.php.net/fix.php?id=64733&r=trysnapshottrunk
Fixed in SVN:   https://bugs.php.net/fix.php?id=64733&r=fixed
Fixed in release:   https://bugs.php.net/fix.php?id=64733&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64733&r=needtrace
Need Reproduce Script:  https://bugs.php.net/fix.php?id=64733&r=needscript
Try newer version:  https://bugs.php.net/fix.php?id=64733&r=oldversion
Not developer issue:https://bugs.php.net/fix.php?id=64733&r=support
Expected behavior:  https://bugs.php.net/fix.php?id=64733&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=64733&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=64733&r=submittedtwice
register_globals:   https://bugs.php.net/fix.php?id=64733&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64733&r=php4
Daylight Savings:   https://bugs.php.net/fix.php?id=64733&r=dst
IIS Stability:  https://bugs.php.net/fix.php?id=64733&r=isapi
Install GNU Sed:https://bugs.php.net/fix.php?id=64733&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64733&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64733&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64733&r=mysqlcfg



Bug #64731 [Com]: Constructor called from trait gives warning message

2013-04-29 Thread Danack at basereality dot com
Edit report at https://bugs.php.net/bug.php?id=64731&edit=1

 ID: 64731
 Comment by: Danack at basereality dot com
 Reported by:Danack at basereality dot com
 Summary:Constructor called from trait gives warning message
 Status: Open
 Type:   Bug
 Package:Compile Failure
 Operating System:   Ubuntu 12.04 LTS
 PHP Version:5.5.0beta4
 Block user comment: N
 Private report: N

 New Comment:

Forgot to post my configure settings.

 configure  \
  --disable-debug \
  --disable-rpath \
  --enable-fpm \
  --enable-inline-optimization \
  --enable-json \
  --enable-mbregex \
  --enable-mbstring \
  --enable-pcntl \
  --enable-sockets \
  --enable-sysvsem \
  --enable-sysvshm \
  --enable-zip \
  --with-bz2 \
  --with-config-file-path=/etc \
  --with-curl \
  --with-freetype-dir=/usr/lib \
  --with-gd \
  --with-jpeg-dir=/usr/lib \
  --with-mcrypt \
  --with-pecl=/usr/lib \
  --with-pic \
  --with-png-dir=/usr/lib \
  --with-zlib \
  --with-mhash \
  --with-mysql \
  --with-mysqli \
  --with-pcre-regex \
  --without-pdo-sqlite


Previous Comments:

[2013-04-28 22:42:08] Danack at basereality dot com

Description:

Calling a constructor that takes a parameter inside a trait, the parameter 
isn't 
passed to the constructor and so a warning is generated and the constructor is 
missing a parameter.

I was only able to get this to be repeatable when the trait is defined in a 
file 
that is outside of the current directory i.e. the bug is dependent of file 
location, so may be hard to replicate.

This was seen both against 5.5.0beta4 and the current 5.5 git head.

This issue isn't present on 5.4 (afaik).

Test script:
---
Code is a bit too long to post entirely, example files are here:

https://gist.github.com/Danack/5478333

with instructions of where to put the files to see the bug.


The relevant parts of the code are:

trait Singleton{

   public static function getInstance($data = array()){ 
  new static($data);
   }
}

class TestClass {

use Singleton;
public function __construct($params){
echo "params count is ".count($params)."";
}

}

$params = array(
'test' => 'value'
);


TestClass::getInstance($params);


Expected result:

Expected result:

params count is 1
Ok





Actual result:
--
Actual result:

Warning: Missing argument 1 for TestClass::__construct(), called in 
/home/intahwebz/12345/vendor/intahwebz/utils/src/Intahwebz/Utils/Singleton.php 
on 
line 15 and defined in /home/intahwebz/12345/basereality/traitTestBroken.php on 
line 12
params count is 0
Ok






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64731&edit=1


[PHP-BUG] Bug #64731 [NEW]: Constructor called from trait gives warning message

2013-04-29 Thread Danack at basereality dot com
From: Danack at basereality dot com
Operating system: Ubuntu 12.04 LTS
PHP version:  5.5.0beta4
Package:  Compile Failure
Bug Type: Bug
Bug description:Constructor called from trait gives warning message

Description:

Calling a constructor that takes a parameter inside a trait, the parameter
isn't 
passed to the constructor and so a warning is generated and the constructor
is 
missing a parameter.

I was only able to get this to be repeatable when the trait is defined in a
file 
that is outside of the current directory i.e. the bug is dependent of file

location, so may be hard to replicate.

This was seen both against 5.5.0beta4 and the current 5.5 git head.

This issue isn't present on 5.4 (afaik).

Test script:
---
Code is a bit too long to post entirely, example files are here:

https://gist.github.com/Danack/5478333

with instructions of where to put the files to see the bug.


The relevant parts of the code are:

trait Singleton{

   public static function getInstance($data = array()){ 
  new static($data);
   }
}

class TestClass {

use Singleton;
public function __construct($params){
echo "params count is ".count($params)."";
}

}

$params = array(
'test' => 'value'
);


TestClass::getInstance($params);


Expected result:

Expected result:

params count is 1
Ok





Actual result:
--
Actual result:

Warning: Missing argument 1 for TestClass::__construct(), called in 
/home/intahwebz/12345/vendor/intahwebz/utils/src/Intahwebz/Utils/Singleton.php
on 
line 15 and defined in
/home/intahwebz/12345/basereality/traitTestBroken.php on 
line 12
params count is 0
Ok

-- 
Edit bug report at https://bugs.php.net/bug.php?id=64731&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64731&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64731&r=trysnapshot53
Try a snapshot (trunk): 
https://bugs.php.net/fix.php?id=64731&r=trysnapshottrunk
Fixed in SVN:   https://bugs.php.net/fix.php?id=64731&r=fixed
Fixed in release:   https://bugs.php.net/fix.php?id=64731&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64731&r=needtrace
Need Reproduce Script:  https://bugs.php.net/fix.php?id=64731&r=needscript
Try newer version:  https://bugs.php.net/fix.php?id=64731&r=oldversion
Not developer issue:https://bugs.php.net/fix.php?id=64731&r=support
Expected behavior:  https://bugs.php.net/fix.php?id=64731&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=64731&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=64731&r=submittedtwice
register_globals:   https://bugs.php.net/fix.php?id=64731&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64731&r=php4
Daylight Savings:   https://bugs.php.net/fix.php?id=64731&r=dst
IIS Stability:  https://bugs.php.net/fix.php?id=64731&r=isapi
Install GNU Sed:https://bugs.php.net/fix.php?id=64731&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64731&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64731&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64731&r=mysqlcfg



Req #64730 [Opn]: preg_replace_callback vs. preg_replace eval related

2013-04-29 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=64730&edit=1

 ID: 64730
 Updated by: larue...@php.net
 Reported by:imbolk at gmail dot com
 Summary:preg_replace_callback vs. preg_replace eval related
 Status: Open
 Type:   Feature/Change Request
 Package:Regexps related
 Operating System:   Mac OS X 10.8.3
 PHP Version:5.5.0beta4
 Block user comment: N
 Private report: N

 New Comment:

or, add a third argument to callback, which is the "regex self" or the regex 
index?


Previous Comments:

[2013-04-28 17:35:06] imbolk at gmail dot com

Description:

In PHP 5.5 'e' key preg_replace is deprecated: 
https://wiki.php.net/rfc/remove_preg_replace_eval_modifier

But I don't know how to replace evaled preg_replace with preg_replace_callback 
in 
some case.

For example:
$repl = [
'/(\d{2}|(? '$this->_op("$3", 
"$4", 
rtrim($this->_op("$1", "$2"), ";"))',

'/(\d{2}|)([MPmplrc])/e' => '$this->_op("$1", "$2")',
];

$str = preg_replace(array_keys($repl), array_values($repl), $str);

Test script:
---
$repl = [
'/(\d{2}|(? function($m) { return 
$this->_op($m[3], $m[4], rtrim($this->_op($m[1], $m[2]), ";"))'; },

'/(\d{2}|)([MPmplrc])/e' => function ($m) { return 
$this->_op($m[1], $m[2]); },
];

$str = preg_replace(array_keys($repl), array_values($repl), $str);

Expected result:

It works.

Actual result:
--
Warning: preg_replace_callback(): Requires argument 2, 'Array', to be a valid 
callback in my.php on line 359






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64730&edit=1


Bug #64731 [Opn->Fbk]: Constructor called from trait gives warning message

2013-04-29 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=64731&edit=1

 ID: 64731
 Updated by: larue...@php.net
 Reported by:Danack at basereality dot com
 Summary:Constructor called from trait gives warning message
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:Compile Failure
 Operating System:   Ubuntu 12.04 LTS
 PHP Version:5.5.0beta4
 Block user comment: N
 Private report: N

 New Comment:

I can not produce this: http://3v4l.org/KYfgY


Previous Comments:

[2013-04-28 22:49:42] Danack at basereality dot com

Forgot to post my configure settings.

 configure  \
  --disable-debug \
  --disable-rpath \
  --enable-fpm \
  --enable-inline-optimization \
  --enable-json \
  --enable-mbregex \
  --enable-mbstring \
  --enable-pcntl \
  --enable-sockets \
  --enable-sysvsem \
  --enable-sysvshm \
  --enable-zip \
  --with-bz2 \
  --with-config-file-path=/etc \
  --with-curl \
  --with-freetype-dir=/usr/lib \
  --with-gd \
  --with-jpeg-dir=/usr/lib \
  --with-mcrypt \
  --with-pecl=/usr/lib \
  --with-pic \
  --with-png-dir=/usr/lib \
  --with-zlib \
  --with-mhash \
  --with-mysql \
  --with-mysqli \
  --with-pcre-regex \
  --without-pdo-sqlite


[2013-04-28 22:42:08] Danack at basereality dot com

Description:

Calling a constructor that takes a parameter inside a trait, the parameter 
isn't 
passed to the constructor and so a warning is generated and the constructor is 
missing a parameter.

I was only able to get this to be repeatable when the trait is defined in a 
file 
that is outside of the current directory i.e. the bug is dependent of file 
location, so may be hard to replicate.

This was seen both against 5.5.0beta4 and the current 5.5 git head.

This issue isn't present on 5.4 (afaik).

Test script:
---
Code is a bit too long to post entirely, example files are here:

https://gist.github.com/Danack/5478333

with instructions of where to put the files to see the bug.


The relevant parts of the code are:

trait Singleton{

   public static function getInstance($data = array()){ 
  new static($data);
   }
}

class TestClass {

use Singleton;
public function __construct($params){
echo "params count is ".count($params)."";
}

}

$params = array(
'test' => 'value'
);


TestClass::getInstance($params);


Expected result:

Expected result:

params count is 1
Ok





Actual result:
--
Actual result:

Warning: Missing argument 1 for TestClass::__construct(), called in 
/home/intahwebz/12345/vendor/intahwebz/utils/src/Intahwebz/Utils/Singleton.php 
on 
line 15 and defined in /home/intahwebz/12345/basereality/traitTestBroken.php on 
line 12
params count is 0
Ok






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64731&edit=1


Req #64730 [PATCH]: preg_replace_callback vs. preg_replace eval related

2013-04-29 Thread larue...@php.net
Edit report at https://bugs.php.net/bug.php?id=64730&edit=1

 ID: 64730
 Patch added by: larue...@php.net
 Reported by:imbolk at gmail dot com
 Summary:preg_replace_callback vs. preg_replace eval related
 Status: Open
 Type:   Feature/Change Request
 Package:Regexps related
 Operating System:   Mac OS X 10.8.3
 PHP Version:5.5.0beta4
 Block user comment: N
 Private report: N

 New Comment:

The following patch has been added/updated:

Patch Name: sencode_argument.patch
Revision:   1367253036
URL:
https://bugs.php.net/patch-display.php?bug=64730&patch=sencode_argument.patch&revision=1367253036


Previous Comments:

[2013-04-29 15:52:38] larue...@php.net

or, add a third argument to callback, which is the "regex self" or the regex 
index?


[2013-04-28 17:35:06] imbolk at gmail dot com

Description:

In PHP 5.5 'e' key preg_replace is deprecated: 
https://wiki.php.net/rfc/remove_preg_replace_eval_modifier

But I don't know how to replace evaled preg_replace with preg_replace_callback 
in 
some case.

For example:
$repl = [
'/(\d{2}|(? '$this->_op("$3", 
"$4", 
rtrim($this->_op("$1", "$2"), ";"))',

'/(\d{2}|)([MPmplrc])/e' => '$this->_op("$1", "$2")',
];

$str = preg_replace(array_keys($repl), array_values($repl), $str);

Test script:
---
$repl = [
'/(\d{2}|(? function($m) { return 
$this->_op($m[3], $m[4], rtrim($this->_op($m[1], $m[2]), ";"))'; },

'/(\d{2}|)([MPmplrc])/e' => function ($m) { return 
$this->_op($m[1], $m[2]); },
];

$str = preg_replace(array_keys($repl), array_values($repl), $str);

Expected result:

It works.

Actual result:
--
Warning: preg_replace_callback(): Requires argument 2, 'Array', to be a valid 
callback in my.php on line 359






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64730&edit=1


Req #64730 [Opn]: preg_replace_callback vs. preg_replace eval related

2013-04-29 Thread imbolk at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=64730&edit=1

 ID: 64730
 User updated by:imbolk at gmail dot com
 Reported by:imbolk at gmail dot com
 Summary:preg_replace_callback vs. preg_replace eval related
 Status: Open
 Type:   Feature/Change Request
 Package:Regexps related
 Operating System:   Mac OS X 10.8.3
 PHP Version:5.5.0beta4
 Block user comment: N
 Private report: N

 New Comment:

Oops… sorry. My mistake. Test script is:

$repl = [
'/(\d{2}|(? function($m) { return 
$this->_op($m[3], $m[4], rtrim($this->_op($m[1], $m[2]), ";"))'; },

'/(\d{2}|)([MPmplrc])/e' => function ($m) { return 
$this->_op($m[1], 
$m[2]); },
];

$str = preg_replace_callback(array_keys($repl), array_values($repl), $str);


Previous Comments:

[2013-04-29 16:30:36] larue...@php.net

The following patch has been added/updated:

Patch Name: sencode_argument.patch
Revision:   1367253036
URL:
https://bugs.php.net/patch-display.php?bug=64730&patch=sencode_argument.patch&revision=1367253036


[2013-04-29 15:52:38] larue...@php.net

or, add a third argument to callback, which is the "regex self" or the regex 
index?


[2013-04-28 17:35:06] imbolk at gmail dot com

Description:

In PHP 5.5 'e' key preg_replace is deprecated: 
https://wiki.php.net/rfc/remove_preg_replace_eval_modifier

But I don't know how to replace evaled preg_replace with preg_replace_callback 
in 
some case.

For example:
$repl = [
'/(\d{2}|(? '$this->_op("$3", 
"$4", 
rtrim($this->_op("$1", "$2"), ";"))',

'/(\d{2}|)([MPmplrc])/e' => '$this->_op("$1", "$2")',
];

$str = preg_replace(array_keys($repl), array_values($repl), $str);

Test script:
---
$repl = [
'/(\d{2}|(? function($m) { return 
$this->_op($m[3], $m[4], rtrim($this->_op($m[1], $m[2]), ";"))'; },

'/(\d{2}|)([MPmplrc])/e' => function ($m) { return 
$this->_op($m[1], $m[2]); },
];

$str = preg_replace(array_keys($repl), array_values($repl), $str);

Expected result:

It works.

Actual result:
--
Warning: preg_replace_callback(): Requires argument 2, 'Array', to be a valid 
callback in my.php on line 359






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64730&edit=1


Req #64730 [Opn]: preg_replace_callback vs. preg_replace eval related

2013-04-29 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=64730&edit=1

 ID: 64730
 Updated by: larue...@php.net
 Reported by:imbolk at gmail dot com
 Summary:preg_replace_callback vs. preg_replace eval related
 Status: Open
 Type:   Feature/Change Request
 Package:Regexps related
 Operating System:   Mac OS X 10.8.3
 PHP Version:5.5.0beta4
 Block user comment: N
 Private report: N

 New Comment:

a simple patch attached, please also see my proposal: 
http://news.php.net/php.internals/67199


Previous Comments:

[2013-04-29 16:31:42] imbolk at gmail dot com

Oops… sorry. My mistake. Test script is:

$repl = [
'/(\d{2}|(? function($m) { return 
$this->_op($m[3], $m[4], rtrim($this->_op($m[1], $m[2]), ";"))'; },

'/(\d{2}|)([MPmplrc])/e' => function ($m) { return 
$this->_op($m[1], 
$m[2]); },
];

$str = preg_replace_callback(array_keys($repl), array_values($repl), $str);


[2013-04-29 16:30:36] larue...@php.net

The following patch has been added/updated:

Patch Name: sencode_argument.patch
Revision:   1367253036
URL:
https://bugs.php.net/patch-display.php?bug=64730&patch=sencode_argument.patch&revision=1367253036


[2013-04-29 15:52:38] larue...@php.net

or, add a third argument to callback, which is the "regex self" or the regex 
index?


[2013-04-28 17:35:06] imbolk at gmail dot com

Description:

In PHP 5.5 'e' key preg_replace is deprecated: 
https://wiki.php.net/rfc/remove_preg_replace_eval_modifier

But I don't know how to replace evaled preg_replace with preg_replace_callback 
in 
some case.

For example:
$repl = [
'/(\d{2}|(? '$this->_op("$3", 
"$4", 
rtrim($this->_op("$1", "$2"), ";"))',

'/(\d{2}|)([MPmplrc])/e' => '$this->_op("$1", "$2")',
];

$str = preg_replace(array_keys($repl), array_values($repl), $str);

Test script:
---
$repl = [
'/(\d{2}|(? function($m) { return 
$this->_op($m[3], $m[4], rtrim($this->_op($m[1], $m[2]), ";"))'; },

'/(\d{2}|)([MPmplrc])/e' => function ($m) { return 
$this->_op($m[1], $m[2]); },
];

$str = preg_replace(array_keys($repl), array_values($repl), $str);

Expected result:

It works.

Actual result:
--
Warning: preg_replace_callback(): Requires argument 2, 'Array', to be a valid 
callback in my.php on line 359






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64730&edit=1


[PHP-BUG] Bug #64735 [NEW]: PHP alternative syntax is not parsed correctly

2013-04-29 Thread nick at savvior dot com
From: nick at savvior dot com
Operating system: windows 7
PHP version:  5.4.14
Package:  *Programming Data Structures
Bug Type: Bug
Bug description:PHP alternative syntax is not parsed correctly

Description:

5.4.3 using WAMP

To reproduce

The bug occurs only when you include the else: portion.



result: 
syntax error: unexpected ':'






Test script:
---





Expected result:

I expect to be able to use a traditional control structure syntax within
the 
alternative syntax and have it parse correctly.

Actual result:
--
if else: is added after an if (): block that contains a traditional if
statement 
w/o adding ?>https://bugs.php.net/bug.php?id=64735&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64735&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64735&r=trysnapshot53
Try a snapshot (trunk): 
https://bugs.php.net/fix.php?id=64735&r=trysnapshottrunk
Fixed in SVN:   https://bugs.php.net/fix.php?id=64735&r=fixed
Fixed in release:   https://bugs.php.net/fix.php?id=64735&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64735&r=needtrace
Need Reproduce Script:  https://bugs.php.net/fix.php?id=64735&r=needscript
Try newer version:  https://bugs.php.net/fix.php?id=64735&r=oldversion
Not developer issue:https://bugs.php.net/fix.php?id=64735&r=support
Expected behavior:  https://bugs.php.net/fix.php?id=64735&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=64735&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=64735&r=submittedtwice
register_globals:   https://bugs.php.net/fix.php?id=64735&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64735&r=php4
Daylight Savings:   https://bugs.php.net/fix.php?id=64735&r=dst
IIS Stability:  https://bugs.php.net/fix.php?id=64735&r=isapi
Install GNU Sed:https://bugs.php.net/fix.php?id=64735&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64735&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64735&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64735&r=mysqlcfg



Req #64730 [Asn]: preg_replace_callback vs. preg_replace eval related

2013-04-29 Thread imbolk at gmail dot com
Edit report at https://bugs.php.net/bug.php?id=64730&edit=1

 ID: 64730
 User updated by:imbolk at gmail dot com
 Reported by:imbolk at gmail dot com
 Summary:preg_replace_callback vs. preg_replace eval related
 Status: Assigned
 Type:   Feature/Change Request
 Package:Regexps related
 Operating System:   Mac OS X 10.8.3
 PHP Version:5.5.0beta4
 Assigned To:laruence
 Block user comment: N
 Private report: N

 New Comment:

I think it would be better if prey_replace_callback function will accept array 
of 
callbacks as a 2nd argument.


Previous Comments:

[2013-04-29 16:49:45] larue...@php.net

a simple patch attached, please also see my proposal: 
http://news.php.net/php.internals/67199


[2013-04-29 16:31:42] imbolk at gmail dot com

Oops… sorry. My mistake. Test script is:

$repl = [
'/(\d{2}|(? function($m) { return 
$this->_op($m[3], $m[4], rtrim($this->_op($m[1], $m[2]), ";"))'; },

'/(\d{2}|)([MPmplrc])/e' => function ($m) { return 
$this->_op($m[1], 
$m[2]); },
];

$str = preg_replace_callback(array_keys($repl), array_values($repl), $str);


[2013-04-29 16:30:36] larue...@php.net

The following patch has been added/updated:

Patch Name: sencode_argument.patch
Revision:   1367253036
URL:
https://bugs.php.net/patch-display.php?bug=64730&patch=sencode_argument.patch&revision=1367253036


[2013-04-29 15:52:38] larue...@php.net

or, add a third argument to callback, which is the "regex self" or the regex 
index?


[2013-04-28 17:35:06] imbolk at gmail dot com

Description:

In PHP 5.5 'e' key preg_replace is deprecated: 
https://wiki.php.net/rfc/remove_preg_replace_eval_modifier

But I don't know how to replace evaled preg_replace with preg_replace_callback 
in 
some case.

For example:
$repl = [
'/(\d{2}|(? '$this->_op("$3", 
"$4", 
rtrim($this->_op("$1", "$2"), ";"))',

'/(\d{2}|)([MPmplrc])/e' => '$this->_op("$1", "$2")',
];

$str = preg_replace(array_keys($repl), array_values($repl), $str);

Test script:
---
$repl = [
'/(\d{2}|(? function($m) { return 
$this->_op($m[3], $m[4], rtrim($this->_op($m[1], $m[2]), ";"))'; },

'/(\d{2}|)([MPmplrc])/e' => function ($m) { return 
$this->_op($m[1], $m[2]); },
];

$str = preg_replace(array_keys($repl), array_values($repl), $str);

Expected result:

It works.

Actual result:
--
Warning: preg_replace_callback(): Requires argument 2, 'Array', to be a valid 
callback in my.php on line 359






-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64730&edit=1


[PHP-BUG] Bug #64736 [NEW]: Incorrect calculation in gdColorMatch

2013-04-29 Thread s...@php.net
From: sixd
Operating system: Linux
PHP version:  5.5Git-2013-04-29 (Git)
Package:  GD related
Bug Type: Bug
Bug description:Incorrect calculation in gdColorMatch

Description:

Compilations warnings in gd_crop.c flag a potential calculation issue in
gdColorMatch:

/home/cjones/php-5.5/ext/gd/libgd/gd_crop.c:340: warning: suggest
parentheses around arithmetic in operand of ^
/home/cjones/php-5.5/ext/gd/libgd/gd_crop.c:340: warning: suggest
parentheses around arithmetic in operand of ^

The code at line 340 is:

const double dist_perc = sqrt(dist / (255^2 + 255^2 + 255^2));

The denominator is currently evaluated as 253. Was it instead intended be
(3 * (255 * 255)) == 195075 ?


-- 
Edit bug report at https://bugs.php.net/bug.php?id=64736&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64736&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64736&r=trysnapshot53
Try a snapshot (trunk): 
https://bugs.php.net/fix.php?id=64736&r=trysnapshottrunk
Fixed in SVN:   https://bugs.php.net/fix.php?id=64736&r=fixed
Fixed in release:   https://bugs.php.net/fix.php?id=64736&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64736&r=needtrace
Need Reproduce Script:  https://bugs.php.net/fix.php?id=64736&r=needscript
Try newer version:  https://bugs.php.net/fix.php?id=64736&r=oldversion
Not developer issue:https://bugs.php.net/fix.php?id=64736&r=support
Expected behavior:  https://bugs.php.net/fix.php?id=64736&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=64736&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=64736&r=submittedtwice
register_globals:   https://bugs.php.net/fix.php?id=64736&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64736&r=php4
Daylight Savings:   https://bugs.php.net/fix.php?id=64736&r=dst
IIS Stability:  https://bugs.php.net/fix.php?id=64736&r=isapi
Install GNU Sed:https://bugs.php.net/fix.php?id=64736&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64736&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64736&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64736&r=mysqlcfg



[PHP-BUG] Bug #64738 [NEW]: No type for variable in _gdScaleRow

2013-04-29 Thread s...@php.net
From: sixd
Operating system: Linux
PHP version:  5.5Git-2013-04-30 (Git)
Package:  GD related
Bug Type: Bug
Bug description:No type for variable in _gdScaleRow

Description:

A compilation warning on gd_interpolation.c is:

/home/cjones/php-5.5/ext/gd/libgd/gd_interpolation.c:981: warning: type
defaults to ‘int’ in declaration of ‘left_channel’

The line is:

const left_channel = i - left;


-- 
Edit bug report at https://bugs.php.net/bug.php?id=64738&edit=1
-- 
Try a snapshot (PHP 5.4):   
https://bugs.php.net/fix.php?id=64738&r=trysnapshot54
Try a snapshot (PHP 5.3):   
https://bugs.php.net/fix.php?id=64738&r=trysnapshot53
Try a snapshot (trunk): 
https://bugs.php.net/fix.php?id=64738&r=trysnapshottrunk
Fixed in SVN:   https://bugs.php.net/fix.php?id=64738&r=fixed
Fixed in release:   https://bugs.php.net/fix.php?id=64738&r=alreadyfixed
Need backtrace: https://bugs.php.net/fix.php?id=64738&r=needtrace
Need Reproduce Script:  https://bugs.php.net/fix.php?id=64738&r=needscript
Try newer version:  https://bugs.php.net/fix.php?id=64738&r=oldversion
Not developer issue:https://bugs.php.net/fix.php?id=64738&r=support
Expected behavior:  https://bugs.php.net/fix.php?id=64738&r=notwrong
Not enough info:
https://bugs.php.net/fix.php?id=64738&r=notenoughinfo
Submitted twice:
https://bugs.php.net/fix.php?id=64738&r=submittedtwice
register_globals:   https://bugs.php.net/fix.php?id=64738&r=globals
PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64738&r=php4
Daylight Savings:   https://bugs.php.net/fix.php?id=64738&r=dst
IIS Stability:  https://bugs.php.net/fix.php?id=64738&r=isapi
Install GNU Sed:https://bugs.php.net/fix.php?id=64738&r=gnused
Floating point limitations: https://bugs.php.net/fix.php?id=64738&r=float
No Zend Extensions: https://bugs.php.net/fix.php?id=64738&r=nozend
MySQL Configuration Error:  https://bugs.php.net/fix.php?id=64738&r=mysqlcfg



Bug #64735 [Opn->Nab]: PHP alternative syntax is not parsed correctly

2013-04-29 Thread laruence
Edit report at https://bugs.php.net/bug.php?id=64735&edit=1

 ID: 64735
 Updated by: larue...@php.net
 Reported by:nick at savvior dot com
 Summary:PHP alternative syntax is not parsed correctly
-Status: Open
+Status: Not a bug
 Type:   Bug
 Package:*Programming Data Structures
 Operating System:   windows 7
 PHP Version:5.4.14
 Block user comment: N
 Private report: N

 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

"Mixing syntaxes in the same control block is not supported." 
http://www.php.net/manual/en/control-structures.alternative-syntax.php


Previous Comments:

[2013-04-29 17:31:45] nick at savvior dot com

Description:

5.4.3 using WAMP

To reproduce

The bug occurs only when you include the else: portion.



result: 
syntax error: unexpected ':'






Test script:
---





Expected result:

I expect to be able to use a traditional control structure syntax within the 
alternative syntax and have it parse correctly.

Actual result:
--
if else: is added after an if (): block that contains a traditional if 
statement 
w/o adding ?>https://bugs.php.net/bug.php?id=64735&edit=1


Bug #64736 [Opn->Fbk]: Incorrect calculation in gdColorMatch

2013-04-29 Thread pajoye
Edit report at https://bugs.php.net/bug.php?id=64736&edit=1

 ID: 64736
 Updated by: paj...@php.net
 Reported by:s...@php.net
 Summary:Incorrect calculation in gdColorMatch
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:GD related
 Operating System:   Linux
 PHP Version:5.5Git-2013-04-29 (Git)
 Block user comment: N
 Private report: N

 New Comment:

That's the classic distance calculation in the RGB cube, does ^ not have 
precedence with the compiler you use? It should (or has in all platforms I use) 
:).


Previous Comments:

[2013-04-29 23:05:06] s...@php.net

Description:

Compilations warnings in gd_crop.c flag a potential calculation issue in 
gdColorMatch:

/home/cjones/php-5.5/ext/gd/libgd/gd_crop.c:340: warning: suggest parentheses 
around arithmetic in operand of ^
/home/cjones/php-5.5/ext/gd/libgd/gd_crop.c:340: warning: suggest parentheses 
around arithmetic in operand of ^

The code at line 340 is:

const double dist_perc = sqrt(dist / (255^2 + 255^2 + 255^2));

The denominator is currently evaluated as 253. Was it instead intended be (3 * 
(255 * 255)) == 195075 ?







-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64736&edit=1


Bug #64738 [Opn->Csd]: No type for variable in _gdScaleRow

2013-04-29 Thread pajoye
Edit report at https://bugs.php.net/bug.php?id=64738&edit=1

 ID: 64738
 Updated by: paj...@php.net
 Reported by:s...@php.net
 Summary:No type for variable in _gdScaleRow
-Status: Open
+Status: Closed
 Type:   Bug
 Package:GD related
 Operating System:   Linux
 PHP Version:5.5Git-2013-04-30 (Git)
 Block user comment: N
 Private report: N

 New Comment:

Automatic comment on behalf of pierre@gmail.com
Revision: 
http://git.php.net/?p=php-src.git;a=commit;h=1a335d20a89d0e797c10092810c6134720560b01
Log: fix #64738, fix implicit type declaration


Previous Comments:

[2013-04-30 00:28:42] s...@php.net

Description:

A compilation warning on gd_interpolation.c is:

/home/cjones/php-5.5/ext/gd/libgd/gd_interpolation.c:981: warning: type 
defaults to ‘int’ in declaration of ‘left_channel’

The line is:

const left_channel = i - left;







-- 
Edit this bug report at https://bugs.php.net/bug.php?id=64738&edit=1