Bug #53959 [Csd]: Reflection data for fgetcsv out-of-date

2011-02-08 Thread robbert at persc dot nl
Edit report at http://bugs.php.net/bug.php?id=53959&edit=1

 ID: 53959
 User updated by:robbert at persc dot nl
 Reported by:robbert at persc dot nl
 Summary:Reflection data for fgetcsv out-of-date
 Status: Closed
 Type:   Bug
 Package:Reflection related
 PHP Version:Irrelevant
 Assigned To:cataphract
 Block user comment: N
 Private report: N

 New Comment:

Thanks for the answers!


Previous Comments:

[2011-02-08 17:29:36] cataphr...@php.net

Automatic comment from SVN on behalf of cataphract
Revision: http://svn.php.net/viewvc/?view=revision&revision=308127
Log: - Fixed bug #53959 (reflection data for fgetcsv out-of-date).


[2011-02-08 16:57:45] rquadl...@php.net

There is a bug here with the reflection of fgetcsv.



php -n --rf fgetcsv shows ...



Function [  function fgetcsv ] {



  - Parameters [4] {

Parameter #0 [  $fp ]

Parameter #1 [  $length ]

Parameter #2 [  $delimiter ]

Parameter #3 [  $enclosure ]

  }

}



The attached patch fixes the reflection.


[2011-02-08 16:37:04] sala...@php.net

As documented on that page, there are five parameters and the fifth
parameter 

"escape" was added with PHP 5.3.0 (see the Changelog section).


[2011-02-08 16:06:35] robbert at persc dot nl

Description:

---

>From manual page: http://www.php.net/function.fgetcsv#Description

---



The documentation says you can use 5 different parameters, but there are
only 4 allowed.



So is this a feature or something from an older php version?







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


Bug #53963 [Ver->Asn]: Failed to decode, yet json_last_error() is JSON_ERROR_NONE

2011-02-08 Thread scottmac
Edit report at http://bugs.php.net/bug.php?id=53963&edit=1

 ID: 53963
 Updated by: scott...@php.net
 Reported by:h...@php.net
 Summary:Failed to decode, yet json_last_error() is
 JSON_ERROR_NONE
-Status: Verified
+Status: Assigned
 Type:   Bug
 Package:JSON related
 PHP Version:5.3.5
-Assigned To:
+Assigned To:scottmac
 Block user comment: N
 Private report: N



Previous Comments:

[2011-02-09 08:00:50] ahar...@php.net

Here's a much simpler test case based on the munged JSON from

atsearch.autotrader.co.uk:







Obviously json_last_error() should return something other than 0,

presumably JSON_ERROR_SYNTAX (4), since it's not syntactically

valid JSON.


[2011-02-08 20:23:48] h...@php.net

Description:

I'm trying the json_decode() function on real world strings, not just
from strings 

produced using json_encode().



I have included the test case from bug #52262 as well to show that this
issue is 

different.



Thanks.

Test script:
---


http://dealerservices.autotrader.co.uk/14184/cars.htm */

$urls[]='http://atsearch.autotrader.co.uk/js/uvl/InlineServlet.js?did=14184&configfile=http://dealerservices.autotrader.co.uk/dealers/14184/14184_config.xml&csslocation=http://dealerservices.autotrader.co.uk/dealers/14184/14184&dropdowntype=uvl&partner=TMG&postcode=me86ad&miles=1500&sort=5&action=searchresults';

/* from http://api.jquery.com/jQuery.getJSON/ */

$urls[]='http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=jQuery15094986786483787_1297190250272&tags=cat&tagmode=any&format=json&_=1297190250280';

/* from
http://code.google.com/apis/base/samples/javascript/tutorial.html */

$urls[]='http://www.google.com/base/feeds/attributes/-/vehicles?max-values=30&bq=[target%20country:GB]&alt=json-in-script&callback=showMake';

/* from http://code.google.com/apis/gdata/docs/json.html */

$urls[]='http://www.google.com/calendar/feeds/developer-calen...@google.com/public/full?alt=json';

/* from http://code.google.com/apis/gdata/docs/json.html */

$urls[]='http://www.google.com/calendar/feeds/developer-calen...@google.com/public/full?alt=json-in-script&callback=myFunction';

/* from http://bugs.php.net/bug.php?id=52262 */

$urls[]='http://api.steampowered.com/ISteamUserStats/GetGlobalAchievementPercentagesForApp/v0001/?gameid=440';



/* from http://php.net/manual/en/function.json-last-error.php */

$json_errors=array( -1 => 'An unknown error occured',


JSON_ERROR_NONE => 'No error has occurred',


JSON_ERROR_DEPTH => 'The maximum stack depth has been
exceeded',


JSON_ERROR_CTRL_CHAR => 'Control character error, possibly
incorrectly encoded',


JSON_ERROR_STATE_MISMATCH => 'Invalid or malformed JSON',


JSON_ERROR_SYNTAX => 'Syntax error',


JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly
incorrectly encoded');



/* main loop */

foreach($urls as $url) {

echo PHP_EOL;



//call the json

$json=file_get_contents($url);

echo 'Decoding... ' . $url . PHP_EOL;



//convert from jsonp to json

$json=preg_replace('/.+?({.+}).+/','$1',$json);



//get a result

$result=json_decode($json);

if ($result) {

echo 'Decoded.';

} else {

  echo 'Failed to decode.';

}

echo PHP_EOL;



$err=json_last_error();

if ($err != JSON_ERROR_NONE) {

echo 'Error: ';

echo 
isset($json_errors[$err])?$json_errors[$err]:$json_errors[-1];

} else {

echo 'No error.';

}

echo PHP_EOL;

}



//eof

Expected result:

The first result should either:



* Decode successfully and have no error (preferable)

Or

* Fail to decode and have an error which explains why

Actual result:
--


Decoding... http://atsearch.autotrader.co.uk/js/uvl/InlineServlet.js?

did=14184&configfile=http://dealerservices.autotrader.co.uk/dealers/14184/14184_

config.xml&csslocation=http://dealerservices.autotrader.co.uk/dealers/14184/1418

4&dropdowntype=uvl&partner=TMG&postcode=me86ad&miles=1500&sort=5&action=searchre

sults

Failed to decode.

No error.



Decoding... http://api.flickr.com/services/feeds/photos_public.gne?

jsonc

Bug #53963 [Opn->Ver]: Failed to decode, yet json_last_error() is JSON_ERROR_NONE

2011-02-08 Thread aharvey
Edit report at http://bugs.php.net/bug.php?id=53963&edit=1

 ID: 53963
 Updated by: ahar...@php.net
 Reported by:h...@php.net
 Summary:Failed to decode, yet json_last_error() is
 JSON_ERROR_NONE
-Status: Open
+Status: Verified
 Type:   Bug
 Package:JSON related
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Here's a much simpler test case based on the munged JSON from

atsearch.autotrader.co.uk:







Obviously json_last_error() should return something other than 0,

presumably JSON_ERROR_SYNTAX (4), since it's not syntactically

valid JSON.


Previous Comments:

[2011-02-08 20:23:48] h...@php.net

Description:

I'm trying the json_decode() function on real world strings, not just
from strings 

produced using json_encode().



I have included the test case from bug #52262 as well to show that this
issue is 

different.



Thanks.

Test script:
---


http://dealerservices.autotrader.co.uk/14184/cars.htm */

$urls[]='http://atsearch.autotrader.co.uk/js/uvl/InlineServlet.js?did=14184&configfile=http://dealerservices.autotrader.co.uk/dealers/14184/14184_config.xml&csslocation=http://dealerservices.autotrader.co.uk/dealers/14184/14184&dropdowntype=uvl&partner=TMG&postcode=me86ad&miles=1500&sort=5&action=searchresults';

/* from http://api.jquery.com/jQuery.getJSON/ */

$urls[]='http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=jQuery15094986786483787_1297190250272&tags=cat&tagmode=any&format=json&_=1297190250280';

/* from
http://code.google.com/apis/base/samples/javascript/tutorial.html */

$urls[]='http://www.google.com/base/feeds/attributes/-/vehicles?max-values=30&bq=[target%20country:GB]&alt=json-in-script&callback=showMake';

/* from http://code.google.com/apis/gdata/docs/json.html */

$urls[]='http://www.google.com/calendar/feeds/developer-calen...@google.com/public/full?alt=json';

/* from http://code.google.com/apis/gdata/docs/json.html */

$urls[]='http://www.google.com/calendar/feeds/developer-calen...@google.com/public/full?alt=json-in-script&callback=myFunction';

/* from http://bugs.php.net/bug.php?id=52262 */

$urls[]='http://api.steampowered.com/ISteamUserStats/GetGlobalAchievementPercentagesForApp/v0001/?gameid=440';



/* from http://php.net/manual/en/function.json-last-error.php */

$json_errors=array( -1 => 'An unknown error occured',


JSON_ERROR_NONE => 'No error has occurred',


JSON_ERROR_DEPTH => 'The maximum stack depth has been
exceeded',


JSON_ERROR_CTRL_CHAR => 'Control character error, possibly
incorrectly encoded',


JSON_ERROR_STATE_MISMATCH => 'Invalid or malformed JSON',


JSON_ERROR_SYNTAX => 'Syntax error',


JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly
incorrectly encoded');



/* main loop */

foreach($urls as $url) {

echo PHP_EOL;



//call the json

$json=file_get_contents($url);

echo 'Decoding... ' . $url . PHP_EOL;



//convert from jsonp to json

$json=preg_replace('/.+?({.+}).+/','$1',$json);



//get a result

$result=json_decode($json);

if ($result) {

echo 'Decoded.';

} else {

  echo 'Failed to decode.';

}

echo PHP_EOL;



$err=json_last_error();

if ($err != JSON_ERROR_NONE) {

echo 'Error: ';

echo 
isset($json_errors[$err])?$json_errors[$err]:$json_errors[-1];

} else {

echo 'No error.';

}

echo PHP_EOL;

}



//eof

Expected result:

The first result should either:



* Decode successfully and have no error (preferable)

Or

* Fail to decode and have an error which explains why

Actual result:
--


Decoding... http://atsearch.autotrader.co.uk/js/uvl/InlineServlet.js?

did=14184&configfile=http://dealerservices.autotrader.co.uk/dealers/14184/14184_

config.xml&csslocation=http://dealerservices.autotrader.co.uk/dealers/14184/1418

4&dropdowntype=uvl&partner=TMG&postcode=me86ad&miles=1500&sort=5&action=searchre

sults

Failed to decode.

No error.



Decoding... http://api.flickr.com/services/feeds/photos_public.gne?

jsoncallback=jQuery15094986786483787_1297190250272&tags=cat&tagmode=any&format=j

son&_=1297190250280

Failed to decode.

Error: Syntax error



Decoding... htt

Bug #53967 [Opn]: ReflectionClass::isCloneable reports false positives

2011-02-08 Thread sebastian
Edit report at http://bugs.php.net/bug.php?id=53967&edit=1

 ID: 53967
 Updated by: sebast...@php.net
 Reported by:whatthejeff at gmail dot com
 Summary:ReflectionClass::isCloneable reports false positives
 Status: Open
 Type:   Bug
 Package:Reflection related
 PHP Version:trunk-SVN-2011-02-09 (snap)
 Block user comment: N
 Private report: N

 New Comment:

I do not think that this is limited to SplFileObject. Have a look at



sb@thinkpad ~ % php
-r'print_r(array_filter(get_declared_classes(),function($n){$c=new
ReflectionClass($n);return $c->isCloneable();}));'

Array

(

[0] => stdClass

[3] => Closure

[4] => DateTime

[5] => DateTimeZone

[6] => DateInterval

[7] => DatePeriod

[8] => LibXMLError

[13] => DOMStringList

[14] => DOMNameList

[15] => DOMImplementationList

[16] => DOMImplementationSource

[17] => DOMImplementation

[18] => DOMNode

[19] => DOMNameSpaceNode

[20] => DOMDocumentFragment

[21] => DOMDocument

[22] => DOMNodeList

[23] => DOMNamedNodeMap

[24] => DOMCharacterData

[25] => DOMAttr

[26] => DOMElement

[27] => DOMText

[28] => DOMComment

[29] => DOMTypeinfo

[30] => DOMUserDataHandler

[31] => DOMDomError

[32] => DOMErrorHandler

[33] => DOMLocator

[34] => DOMConfiguration

[35] => DOMCdataSection

[36] => DOMDocumentType

[37] => DOMNotation

[38] => DOMEntity

[39] => DOMEntityReference

[40] => DOMProcessingInstruction

[41] => DOMStringExtend

[42] => DOMXPath

[43] => finfo

[70] => EmptyIterator

[72] => ArrayObject

[73] => ArrayIterator

[74] => RecursiveArrayIterator

[75] => SplFileInfo

[76] => DirectoryIterator

[77] => FilesystemIterator

[78] => RecursiveDirectoryIterator

[79] => GlobIterator

[80] => SplFileObject

[81] => SplTempFileObject

[82] => SplDoublyLinkedList

[83] => SplQueue

[84] => SplStack

[86] => SplMinHeap

[87] => SplMaxHeap

[88] => SplPriorityQueue

[89] => SplFixedArray

[90] => SplObjectStorage

[91] => MultipleIterator

[93] => PDO

[94] => PDOStatement

[97] => Reflection

[107] => __PHP_Incomplete_Class

[108] => php_user_filter

[109] => Directory

[110] => SimpleXMLElement

[111] => SimpleXMLIterator

[112] => SoapClient

[113] => SoapVar

[114] => SoapServer

[116] => SoapParam

[117] => SoapHeader

[119] => Phar

[120] => PharData

[121] => PharFileInfo

[124] => XMLReader

)



I am sure that there are more false positives in there.


Previous Comments:

[2011-02-09 04:30:41] whatthejeff at gmail dot com

Description:

ReflectionClass::isCloneable returns true on some classes which are not
actually 

cloneable.

Test script:
---
isCloneable());



$reflection = new ReflectionClass('SplTempFileObject');

var_dump($reflection->isCloneable());



?>

Expected result:

bool(false)

bool(false)

Actual result:
--
bool(true)

bool(true)






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


Bug #53716 [Com]: segfault in $stmt->execute()

2011-02-08 Thread max at axismedia dot ru
Edit report at http://bugs.php.net/bug.php?id=53716&edit=1

 ID: 53716
 Comment by: max at axismedia dot ru
 Reported by:anthon dot pang at gmail dot com
 Summary:segfault in $stmt->execute()
 Status: Open
 Type:   Bug
 Package:PDO related
 Operating System:   Ubuntu 10.04
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

In update to my previous message:



5. If i switch persistent connection off (PDO::ATTR_PERSISTENT => false)


everithing is fine too.


Previous Comments:

[2011-02-09 05:15:32] max at axismedia dot ru

Looks like I have very similar problem. In short php 5.3 in CLI or Apach
module 

mode, PDO compiled againt mysqlnd crashes when using MySQL native
prepared 

queries with segmentation fault.



EXAMPLE SCRIPT




PDO::ERRMODE_EXCEPTION,.

PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES
'UTF8';",

PDO::ATTR_PERSISTENT => true,

PDO::MYSQL_ATTR_DIRECT_QUERY => false);



$sql = 'SELECT NOW()';



$pdo = new PDO('mysql:host=localhost;dbname=m_shop', 'max', null, 

$driver_options);

$st = $pdo->prepare($sql, array(PDO::ATTR_CURSOR =>
PDO::CURSOR_FWDONLY));

print "before execute\n";

$st->execute();

print "after execute\n";

$st->closeCursor();



$pdo = null;



?>



Output:



office tmp # php bug.php

before execute

after execute

Segmentation fault (core dumped)



BACKTRACE



(gdb) bt

#0  0xb6acb02d in free () from /lib/libc.so.6

#1  0x082f8208 in _mysqlnd_pefree (ptr=0x0, persistent=1 '\001',
tsrm_ls=0x0) at 

/var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/ext/mysqlnd/mysqlnd_debug.c:1062

#2  0x082e97c8 in php_mysqlnd_stmt_free_result_bind_pub (s=0x8b56024, 

result_bind=0x8b24a60, tsrm_ls=0x891e280)

at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/ext/mysqlnd/mysqlnd_ps.c:2296

#3  0x082e9856 in mysqlnd_stmt_separate_result_bind (s=0x8b56024,
tsrm_ls=)

at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/ext/mysqlnd/mysqlnd_ps.c:2029

#4  0x082e98d3 in php_mysqlnd_stmt_free_result_pub (s=0x8b56024, 

tsrm_ls=0x891e280) at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/ext/mysqlnd/mysqlnd_ps.c:1961

#5  0x081e8e11 in pdo_mysql_stmt_cursor_closer (stmt=0x8b24240, 

tsrm_ls=0x891e280) at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/ext/pdo_mysql/mysql_statement.c:906

#6  0x081e4471 in zim_PDOStatement_closeCursor (ht=0,
return_value=0x8b24154, 

return_value_ptr=0x0, this_ptr=0x8b24170, return_value_used=0, 

tsrm_ls=0x891e280)

at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/ext/pdo/pdo_stmt.c:2141

#7  0x0839edf1 in zend_do_fcall_common_helper_SPEC
(execute_data=0x8b56058, 

tsrm_ls=0x891e280)

at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/Zend/zend_vm_execute.h:316

#8  0x0839f2f1 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=0x1,


tsrm_ls=0x8b24a54) at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/Zend/zend_vm_execute.h:421

#9  0x083786a6 in execute (op_array=0x8b23124, tsrm_ls=0x891e280) at 

/var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/Zend/zend_vm_execute.h:107

#10 0x08353317 in zend_execute_scripts (type=8, tsrm_ls=0x891e280,
retval=0x0, 

file_count=3) at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/Zend/zend.c:1194

#11 0x082fcee9 in php_execute_script (primary_file=0xbfbfa920, 

tsrm_ls=0x891e280) at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/main/main.c:2265

#12 0x083d6fe6 in main (argc=2, argv=0xbfbfaa24) at
/var/tmp/portage/dev-

lang/php-5.3.5/work/sapis-build/cli/sapi/cli/php_cli.c:1193



NOTES



1. If i do not call $st->closeCursor() i still get segmentation fault
but with a 

bit different backtrace (same problem but on php environment shutdown):



#0  0xe424 in __kernel_vsyscall ()

#1  0xb6a4c401 in raise () from /lib/libc.so.6

#2  0xb6a4db42 in abort () from /lib/libc.so.6

#3  0xb6a87815 in ?? () from /lib/libc.so.6

#4  0xb6a8d6d1 in ?? () from /lib/libc.so.6

#5  0xb6a8ef38 in ?? () from /lib/libc.so.6

#6  0xb6a9203d in free () from /lib/libc.so.6

#7  0x082f8208 in _mysqlnd_pefree (ptr=0x0, persistent=48 '0',
tsrm_ls=0x400) at 

/var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/ext/mysqlnd/mysqlnd_debug.c:1062

#8  0x082e97c8 in php_mysqlnd_stmt_free_result_bind_pub (s=0x8b56024, 

result_bind=0x8b24a4c, tsrm_ls=0x891e280)

at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/ext/mysqlnd/mysqlnd_ps.c:2296

#9  0x082e9856 in mysqlnd_stmt_separate_result_bind (s=0x8b56024,
tsrm_ls=)

at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/ext/mysqlnd/mysqlnd_ps.c:2029

#10 0x082e99a3 in php_mysqlnd_stmt_free_stmt_content_pub (s=0x8b56024, 

tsrm_ls=0x891e280) at /var/tmp/portage/dev

Bug #53716 [Com]: segfault in $stmt->execute()

2011-02-08 Thread max at axismedia dot ru
Edit report at http://bugs.php.net/bug.php?id=53716&edit=1

 ID: 53716
 Comment by: max at axismedia dot ru
 Reported by:anthon dot pang at gmail dot com
 Summary:segfault in $stmt->execute()
 Status: Open
 Type:   Bug
 Package:PDO related
 Operating System:   Ubuntu 10.04
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Looks like I have very similar problem. In short php 5.3 in CLI or Apach
module 

mode, PDO compiled againt mysqlnd crashes when using MySQL native
prepared 

queries with segmentation fault.



EXAMPLE SCRIPT




PDO::ERRMODE_EXCEPTION,.

PDO::MYSQL_ATTR_INIT_COMMAND => "SET NAMES
'UTF8';",

PDO::ATTR_PERSISTENT => true,

PDO::MYSQL_ATTR_DIRECT_QUERY => false);



$sql = 'SELECT NOW()';



$pdo = new PDO('mysql:host=localhost;dbname=m_shop', 'max', null, 

$driver_options);

$st = $pdo->prepare($sql, array(PDO::ATTR_CURSOR =>
PDO::CURSOR_FWDONLY));

print "before execute\n";

$st->execute();

print "after execute\n";

$st->closeCursor();



$pdo = null;



?>



Output:



office tmp # php bug.php

before execute

after execute

Segmentation fault (core dumped)



BACKTRACE



(gdb) bt

#0  0xb6acb02d in free () from /lib/libc.so.6

#1  0x082f8208 in _mysqlnd_pefree (ptr=0x0, persistent=1 '\001',
tsrm_ls=0x0) at 

/var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/ext/mysqlnd/mysqlnd_debug.c:1062

#2  0x082e97c8 in php_mysqlnd_stmt_free_result_bind_pub (s=0x8b56024, 

result_bind=0x8b24a60, tsrm_ls=0x891e280)

at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/ext/mysqlnd/mysqlnd_ps.c:2296

#3  0x082e9856 in mysqlnd_stmt_separate_result_bind (s=0x8b56024,
tsrm_ls=)

at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/ext/mysqlnd/mysqlnd_ps.c:2029

#4  0x082e98d3 in php_mysqlnd_stmt_free_result_pub (s=0x8b56024, 

tsrm_ls=0x891e280) at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/ext/mysqlnd/mysqlnd_ps.c:1961

#5  0x081e8e11 in pdo_mysql_stmt_cursor_closer (stmt=0x8b24240, 

tsrm_ls=0x891e280) at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/ext/pdo_mysql/mysql_statement.c:906

#6  0x081e4471 in zim_PDOStatement_closeCursor (ht=0,
return_value=0x8b24154, 

return_value_ptr=0x0, this_ptr=0x8b24170, return_value_used=0, 

tsrm_ls=0x891e280)

at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/ext/pdo/pdo_stmt.c:2141

#7  0x0839edf1 in zend_do_fcall_common_helper_SPEC
(execute_data=0x8b56058, 

tsrm_ls=0x891e280)

at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/Zend/zend_vm_execute.h:316

#8  0x0839f2f1 in ZEND_DO_FCALL_BY_NAME_SPEC_HANDLER (execute_data=0x1,


tsrm_ls=0x8b24a54) at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/Zend/zend_vm_execute.h:421

#9  0x083786a6 in execute (op_array=0x8b23124, tsrm_ls=0x891e280) at 

/var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/Zend/zend_vm_execute.h:107

#10 0x08353317 in zend_execute_scripts (type=8, tsrm_ls=0x891e280,
retval=0x0, 

file_count=3) at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/Zend/zend.c:1194

#11 0x082fcee9 in php_execute_script (primary_file=0xbfbfa920, 

tsrm_ls=0x891e280) at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/main/main.c:2265

#12 0x083d6fe6 in main (argc=2, argv=0xbfbfaa24) at
/var/tmp/portage/dev-

lang/php-5.3.5/work/sapis-build/cli/sapi/cli/php_cli.c:1193



NOTES



1. If i do not call $st->closeCursor() i still get segmentation fault
but with a 

bit different backtrace (same problem but on php environment shutdown):



#0  0xe424 in __kernel_vsyscall ()

#1  0xb6a4c401 in raise () from /lib/libc.so.6

#2  0xb6a4db42 in abort () from /lib/libc.so.6

#3  0xb6a87815 in ?? () from /lib/libc.so.6

#4  0xb6a8d6d1 in ?? () from /lib/libc.so.6

#5  0xb6a8ef38 in ?? () from /lib/libc.so.6

#6  0xb6a9203d in free () from /lib/libc.so.6

#7  0x082f8208 in _mysqlnd_pefree (ptr=0x0, persistent=48 '0',
tsrm_ls=0x400) at 

/var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/ext/mysqlnd/mysqlnd_debug.c:1062

#8  0x082e97c8 in php_mysqlnd_stmt_free_result_bind_pub (s=0x8b56024, 

result_bind=0x8b24a4c, tsrm_ls=0x891e280)

at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/ext/mysqlnd/mysqlnd_ps.c:2296

#9  0x082e9856 in mysqlnd_stmt_separate_result_bind (s=0x8b56024,
tsrm_ls=)

at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/ext/mysqlnd/mysqlnd_ps.c:2029

#10 0x082e99a3 in php_mysqlnd_stmt_free_stmt_content_pub (s=0x8b56024, 

tsrm_ls=0x891e280) at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/ext/mysqlnd/mysqlnd_ps.c:2125

#11 0x082eb441 in php_mysqlnd_stmt_net_close_priv (s=0x8b56024,
implicit=0 

'\000', tsrm_ls=0x891e280)

at /var/tmp/portage/dev-lang/php-5.3.5/work/sapis-

build/cli/ext/mysqlnd/mysqlnd_ps.c:2212

#12 0

[PHP-BUG] Bug #53967 [NEW]: ReflectionClass::isCloneable reports false positives

2011-02-08 Thread whatthejeff at gmail dot com
From: 
Operating system: 
PHP version:  trunk-SVN-2011-02-09 (snap)
Package:  Reflection related
Bug Type: Bug
Bug description:ReflectionClass::isCloneable reports false positives

Description:

ReflectionClass::isCloneable returns true on some classes which are not
actually 

cloneable.

Test script:
---
isCloneable());



$reflection = new ReflectionClass('SplTempFileObject');

var_dump($reflection->isCloneable());



?>

Expected result:

bool(false)

bool(false)

Actual result:
--
bool(true)

bool(true)

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



Bug #52258 [Com]: Fails to compile phar with LC_CTYPE=tr_TR.UTF-8

2011-02-08 Thread cankoy at ymail dot com
Edit report at http://bugs.php.net/bug.php?id=52258&edit=1

 ID: 52258
 Comment by: cankoy at ymail dot com
 Reported by:mabi at gentoo dot org
 Summary:Fails to compile phar with LC_CTYPE=tr_TR.UTF-8
 Status: Open
 Type:   Bug
 Package:PHAR related
 Operating System:   Gentoo Linux
 PHP Version:5.3.2
 Block user comment: N
 Private report: N

 New Comment:

This is the infamous bug http://bugs.php.net/bug.php?id=18556

Any name that's allowed to be case insensitive and have letter I suffers
from this issue.


Previous Comments:

[2010-10-24 18:08:36] mabi at gentoo dot org

Code's unchanged in 5.3.3


[2010-07-06 01:39:45] mabi at gentoo dot org

Description:

This is from http://bugs.gentoo.org/show_bug.cgi?id=327049:

php-5.3.2 fails to compile the phar extension when using tr_TR.UTF-8 as
a locale. When using LANG=C everything's fine.



Do we need to enforce a particular LANG or is this considered a bug in
php/phar?







Expected result:

Compiles && installs

Actual result:
--
Generating phar.php

Generating phar.phar



Parse error: syntax error, unexpected '/', expecting ')' in

/var/tmp/portage/dev-lang/php-5.3.2/work/php-5.3.2/ext/phar/phar.php on
line 20

make: *** [ext/phar/phar.phar] Error 255



phar.php:

17  if (!class_exists('DirectoryTreeIterator', 0))

18  {

19  

20  Warning:

file(/var/tmp/portage/dev-lang/php-5.3.2/work/php-5.3.2/ext/phar/phar/directorytreeIterator.inc):

failed to open stream: No such file or directory in

/var/tmp/portage/dev-lang/php-5.3.2/work/php-5.3.2/ext/phar/build_precommand.php

on line 31

21  

22  Warning: join(): Invalid arguments passed in

/var/tmp/portage/dev-lang/php-5.3.2/work/php-5.3.2/ext/phar/build_precommand.php

on line 49

23  

24  }



build_precommand.php:

21  $classes = array(

22  'DirectoryTreeIterator',

23  'DirectoryGraphIterator',

24  'InvertedRegexIterator',

25  'CLICommand',

26  'PharCommand',

27  );

28  

29  foreach($classes as $name) {

30  echo "if (!class_exists('$name', 0))\n{\n";

31  $f = file(dirname(__FILE__) . '/phar/' .
strtolower($name) .

'.inc');



This assumes that strtolower('DirectoryTreeIterator') is

'directorytreeiterator', which is not true in a Turkish locale

(LC_CTYPE=tr_TR.UTF-8).








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


Bug #53844 [Com]: PHP built from source on Solaris gets SIGSEGV with libiconv

2011-02-08 Thread phil at quizlet dot com
Edit report at http://bugs.php.net/bug.php?id=53844&edit=1

 ID: 53844
 Comment by: phil at quizlet dot com
 Reported by:r at rcrowley dot org
 Summary:PHP built from source on Solaris gets SIGSEGV with
 libiconv
 Status: Feedback
 Type:   Bug
 Package:ICONV related
 Operating System:   Solaris
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

No luck...



With the original configuration, I tried:



# LD_LIBRARY_PATH=/opt/local/lib ; export LD_LIBRARY_PATH ; php -r 'echo


iconv("UTF-8", "UTF-8", "Hello, world.\n");'



as well as:



# LD_LIBRARY_PATH=/opt/local/lib php -r 'echo iconv("UTF-8", "UTF-8",
"Hello, 

world.\n");'



as well as reconfiguring with:



# ./configure --disable-iconv --with-iconv



and also tried:



# ./configure LDFLAGS=/opt/local/lib --with-iconv



and:



# ./configure LDFLAGS=/opt/local/lib --disable-iconv --with-iconv



Note: I did get a "Notice: Following unknown configure options were
used: --

disable-iconv" when trying to follow johannes advice, and
--disable-iconv isn't 

listed in ./configure --help.



In ALL of the above cases when testing PHP's iconv() I got a segfault
and 

checked the backtrace with gdb after each and they were all identical:



(gdb) bt

#0  0xec835356 in ?? ()

#1  0xfe8d68ab in iconv () from /lib/libc.so.1

#2  0x0815a2b1 in php_iconv_string (in_p=0x8653484 "Hello, world.\n",
in_len=14, 

out=0x8047580, out_len=0x8047584, out_charset=0x8653458 "UTF-8", 

in_charset=0x8654900 "UTF-8")

at /tmp/tmp..Aa4sh/php-5.3.5/ext/iconv/iconv.c:501

#3  0x0815d274 in php_if_iconv (ht=3, return_value=0x865349c, 

return_value_ptr=0x0, this_ptr=0x0, return_value_used=1) at
/tmp/tmp..Aa4sh/php-

5.3.5/ext/iconv/iconv.c:2327

#4  0x083147de in zend_do_fcall_common_helper_SPEC
(execute_data=0x8793f70) at 

zend_vm_execute.h:316

#5  0x0831385d in execute (op_array=0x8653384) at zend_vm_execute.h:107

#6  0x082e6e29 in zend_eval_stringl (str=0x8047ccb "echo
iconv(\"UTF-8\", \"UTF-

8\", \"Hello, world.\\n\");", str_len=48, retval_ptr=0x0,
string_name=0x85c30ae 

"Command line code")

at /tmp/tmp..Aa4sh/php-5.3.5/Zend/zend_execute_API.c:1193

#7  0x082e6fe2 in zend_eval_stringl_ex (str=0x8047ccb "echo
iconv(\"UTF-8\", 

\"UTF-8\", \"Hello, world.\\n\");", str_len=48, retval_ptr=0x0, 

string_name=0x85c30ae "Command line code", 

handle_exceptions=1) at /tmp/tmp..Aa4sh/php-

5.3.5/Zend/zend_execute_API.c:1235

#8  0x082e705a in zend_eval_string_ex (str=0x8047540 "\016",
retval_ptr=0x0, 

string_name=0x85c30ae "Command line code", handle_exceptions=1) at 

/tmp/tmp..Aa4sh/php-5.3.5/Zend/zend_execute_API.c:1246

#9  0x08376724 in main (argc=3, argv=0x8047bdc) at /tmp/tmp..Aa4sh/php-

5.3.5/sapi/cli/php_cli.c:1282



Any other ideas?


Previous Comments:

[2011-02-08 03:23:32] srina...@php.net

what happens when you do some thing like

LD_LIBRARY_PATH=/opt/local/lib ; export LD_LIBRARY_PATH ; php -r 'echo
iconv("UTF-8", "UTF-8", "Hello, world.\n");'


[2011-02-07 20:55:49] phil at quizlet dot com

(I'm working with Richard on this...)



[root@gnp2b7ak ~]# showrev

Hostname: ...

Hostid: c54426

Release: 5.11

Kernel architecture: i86pc

Application architecture: i386

Hardware provider: 

Domain: 

Kernel version: SunOS 5.11 snv_121



Joyent (the hosting provider) has kindly offered a free Joyent Solaris
instance 

for you to test against, if you'd like. Just email me and I'll get it
set up.


[2011-02-07 19:46:23] johan...@php.net

Which version of solaris are you using? My Solaris 11 express works
fine. Could you also try doing a



./configure --disable-iconv --with-iconv



build? Yor stacktrace shows 

   #1  0xfe8d68ab in iconv () from /lib/libc.so.1

so the libc's iconv is being used. My assumption is that another library
is using iconv from /opt/local and so the linker pulls the libs in the
wrong order so one version is used for compiling PHP the other for
running ...


[2011-02-07 17:16:45] r at rcrowley dot org

# iconv --version

iconv (GNU libiconv 1.11)

Copyright (C) 2000-2007 Free Software Foundation, Inc.

License GPLv2+: GNU GPL version 2 or later


This is free software: you are free to change and redistribute it.

There is NO WARRANTY, to the extent permitted by law.

Written by Bruno Haible.

# pkgin list | grep iconv

libiconv-1.12nb1 Character set conversion library

#


[2011-02-01 21:48:13] jacq...@php.net

Hi Richard,



Can you confirm which versions of iconv you have installed?



pkg_info | grep i

Bug #53961 [Opn->Bgs]: soap over https with custom port does work

2011-02-08 Thread cataphract
Edit report at http://bugs.php.net/bug.php?id=53961&edit=1

 ID: 53961
 Updated by: cataphr...@php.net
 Reported by:bender at digitalbase dot de
 Summary:soap over https with custom port does work
-Status: Open
+Status: Bogus
 Type:   Bug
 Package:OpenSSL related
 Operating System:   WinXP 32bit
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Well, if the current version works, I'm closing this bug.


Previous Comments:

[2011-02-08 19:44:10] bender at digitalbase dot de

the current version does work PHP 5.3.5


[2011-02-08 18:30:09] cataphr...@php.net

I have no problems with 0.9.8o-1ubuntu4.3



I can test on Windows, but to be clear: which version does not work? Is
it available through windows.php.net? Which package is it?


[2011-02-08 17:28:55] bender at digitalbase dot de

Description:

SoapClient does work with https over custom port.



If one version is the OpenSSl.dll (OpenSSL 0.9.8l) from an earlier PHP
take it to work. With the current, it does not work.











Test script:
---
// does work

$client = new SoapClient("https://localhost:21081/test_13?wsdl";);







// works

$client = new SoapClient("https://localhost/test_13?wsdl";);





Actual result:
--
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing
WSDL: Couldn't load from 'https://localhost:21081/test_13?wsdl' : Start
tag expected, '<' not found in C:\htdocs\wwwroot\test.php:4 Stack trace:
#0 C:\htdocs\wwwroot\test.php(4):
SoapClient->SoapClient('https://local...') #1 {main} thrown in
C:\htdocs\wwwroot\test.php on line 4






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


[PHP-BUG] Bug #53966 [NEW]: convertion NULL value in integer 0

2011-02-08 Thread julien dot fabre at pg-soft dot fr
From: 
Operating system:  Windows XP SP3
PHP version:  5.2.17
Package:  MSSQL related
Bug Type: Bug
Bug description:convertion NULL value in integer 0

Description:

---

>From manual page: http://www.php.net/function.mssql-fetch-object#Valeurs de
retour

---



System  Windows NT BLISS 5.1 build 2600

Build Date  Jul 21 2010 18:41:42

Configure Command   cscript /nologo configure.js "--enable-snapshot-build"
"--enable-debug-pack"
"--with-snapshot-template=d:\php-sdk\snap_5_2\vc6\x86\template"
"--with-php-build=d:\php-sdk\snap_5_2\vc6\x86\php_build"
"--with-pdo-oci=D:\php-sdk\oracle\instantclient10\sdk,shared"
"--with-oci8=D:\php-sdk\oracle\instantclient10\sdk,shared"
"--without-pi3web"

Server API  Apache 2.0 Handler

Virtual Directory Support   enabled

Configuration File (php.ini) Path   C:\WINDOWS

Loaded Configuration File   C:\WINDOWS\php.ini

Scan this dir for additional .ini files (none)

additional .ini files parsed(none)

PHP API 20041225

PHP Extension   20060613

Zend Extension  220060519

Debug Build no

Thread Safety   enabled

Zend Memory Manager enabled

IPv6 Supportenabled

Registered PHP Streams  php, file, data, http, ftp, compress.zlib, zip,
sqlsrv

Registered Stream Socket Transports tcp, udp

Registered Stream Filters   convert.iconv.*, string.rot13, string.toupper,
string.tolower, string.strip_tags, convert.*, consumed, zlib.*





Test script:
---
in MS SQL server 2000 :

Foo bit null authorised

Bar integer null authorised



select Foo , Bar from BF 



result  in MS SQL: 

 , 





in php you have  0,NULL 



a bit at NULL is automaticly convert to 0 

Expected result:

you must have 



result   in MS SQL: 

 , 





in php you have  NULL,NULL 




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



[PHP-BUG] Bug #53965 [NEW]: cannot find files w/ relative paths when loaded w/ "file://"

2011-02-08 Thread clarkwise at gmail dot com
From: 
Operating system: Windows XP
PHP version:  5.2.17
Package:  XSLT related
Bug Type: Bug
Bug description: cannot find files w/ relative paths when loaded 
w/ "file://"

Description:

I upgraded from PHP 5.2.5 (using binaries from windows.php.net), and now
the s in some of my stylesheets stopped working. Testing each
version in succession, I discovered that it worked up through 5.2.8 and
does not work in 5.2.9+. I now get the following three errors for each
.



Warning: XSLTProcessor::importStylesheet(): I/O warning : failed to load
external entity "file%3A/C%3A/xsltest/include.xsl" in C:\xsltest\xsl.php on
line 11



Warning: XSLTProcessor::importStylesheet(): compilation error: file
file%3A//C%3A/xsltest/collection.xsl line 3 element include in
C:\xsltest\xsl.php on line 11



Warning: XSLTProcessor::importStylesheet(): xsl:include : unable to load
file%3A/C%3A/xsltest/include.xsl in C:\xsltest\xsl.php on line 11



Interestingly, in the first and third

errors, it is displaying the file:// protocol with only one slash

instead of the correct two.



IMPORTANT NOTE: This problem only occurs when the primary XSL document is
loaded with the "file://" protocol with one too few slashes. (See sample
PHP file.) Correctly, there should be three slashes when loading a local
file, where my existing code only has two (i.e., "file://C:/path"). Files
used to load, but now they don't. I don't see what changed in 5.2.9 to
cause that.



Ultimately, the question is why the main stylesheet loads but its
s do not, as they are in the same directory. Either they
should both load or neither should load.



---

Another thing I noticed is that the up until PHP 5.2.9, libxslt was
compiled against the same version of

libxml that was included with PHP. But starting with PHP 5.2.9,

libxslt was compiled against an older version of libxml than that

which was included with PHP. See below:



5.2.5

libxml Version => 2.6.26

libxslt compiled against libxml Version => 2.6.26



5.2.8



libxml Version => 2.6.32

libxslt compiled against libxml Version => 2.6.32



=== versions differ starting at 5.2.9 ===

5.2.9

libxml Version => 2.7.3

libxslt compiled against libxml Version => 2.6.32



5.2.16

libxml Version => 2.7.7

libxslt compiled against libxml Version => 2.6.32



It might be a mere coincidence that in 5.2.9 both my code stopped working
and these versions differ, but it seemed worth noting.

Test script:
---
(based on XSL example at
http://us.php.net/manual/en/xsl.examples-collection.php)



C:\xsltest\xsl.php

=

load('collection.xml');



$xsl = new DOMDocument();

$xsl->load('file://C:/xsltest/collection.xsl'); // s fail

//$xsl->load('file:///C:/xsltest/collection.xsl'); // s work



$proc = new XSLTProcessor;

$proc->importStyleSheet($xsl);



echo $proc->transformToXML($xml);





=

C:\xsltest\collection.xsl

=

http://www.w3.org/1999/XSL/Transform";>



 



 

 

 

  Hey! Welcome to 's sweet CD collection! 

  

 





=

C:\xsltest\include.xsl

=

http://www.w3.org/1999/XSL/Transform";>

 

  

  by  - 

  

 





=

C:\xsltest\collection.xml (same as on example page above)

=





 

  Fight for your mind

  Ben Harper

  1995

 

 

  Electric Ladyland

  Jimi Hendrix

  1997

 



Expected result:

include.xsl is loaded, and the script works, yielding:



  Hey! Welcome to Nicolas Eliaszewicz's sweet CD collection!



 Fight for your mindby Ben Harper - 1995

 Electric Ladylandby Jimi Hendrix - 1997

Actual result:
--
include.xsl is not loaded (despite the fact that collection.xsl is loaded),
yielding these errors:



Warning: XSLTProcessor::importStylesheet(): I/O warning : failed to load
external entity "file%3A/C%3A/xsltest/include.xsl" in C:\xsltest\xsl.php on
line 11



Warning: XSLTProcessor::importStylesheet(): compilation error: file
file%3A//C%3A/xsltest/collection.xsl line 3 element include in
C:\xsltest\xsl.php on line 11



Warning: XSLTProcessor::importStylesheet(): xsl:include : unable to load
file%3A/C%3A/xsltest/include.xsl in C:\xsltest\xsl.php on line 11





-- 
Edit bug report at http://bugs.php.net/bug.php?id=53965&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53965&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53965&r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=53965&r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=53965&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53965&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=53965&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=53965&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=53965&r=needscri

Bug #53956 [Bgs]: Zero Width Space is not replaced by ordinary space

2011-02-08 Thread rasmus
Edit report at http://bugs.php.net/bug.php?id=53956&edit=1

 ID: 53956
 Updated by: ras...@php.net
 Reported by:skyboy at mail dot ru
 Summary:Zero Width Space is not replaced by ordinary space
 Status: Bogus
 Type:   Bug
 Package:PCRE related
 Operating System:   Ubuntu 10.10
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

You should ask the PCRE guys about that.


Previous Comments:

[2011-02-08 21:40:18] skyboy at mail dot ru

oh!sorry for this. this is my mistake.

but why "zero width *space*" does not belong to [s]pace symbols' group?


[2011-02-08 11:15:39] ahar...@php.net

Your arguments to preg_replace are swapped, ie:



preg_replace('#\s+#', $str, '-');



should be:



preg_replace('#\s+#', '-', $str);



Also note that Unicode zero width spaces aren't included in \s, but

you can match them directly with the u modifier (replace <200b> with

an actual zero width space character):



preg_replace('#<200b>+#u', '-', $str);



Not a bug: closing.


[2011-02-08 10:45:51] skyboy at mail dot ru

Description:

Group of zero width spaces is succesfully replaced by any character but
ordinary space.

Test script:
---
$str = "​​‎​​‎​​‎"; // 27 zero width spaces with
unicode code of u200B 

var_dump($str);

var_dump(preg_replace('#\s+#', $str, '-'));

var_dump(preg_replace('#\s+#', $str, ' '));

Expected result:

string(27) "​​‎​​‎​​‎" string(1) "-" string(1)
"​​‎​​‎​​‎-" 

Actual result:
--
string(27) "​​‎​​‎​​‎" string(1) "-" string(27)
"​​‎​​‎​​‎" 








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


Bug #53956 [Com]: Zero Width Space is not replaced by ordinary space

2011-02-08 Thread skyboy at mail dot ru
Edit report at http://bugs.php.net/bug.php?id=53956&edit=1

 ID: 53956
 Comment by: skyboy at mail dot ru
 Reported by:skyboy at mail dot ru
 Summary:Zero Width Space is not replaced by ordinary space
 Status: Bogus
 Type:   Bug
 Package:PCRE related
 Operating System:   Ubuntu 10.10
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

oh!sorry for this. this is my mistake.

but why "zero width *space*" does not belong to [s]pace symbols' group?


Previous Comments:

[2011-02-08 11:15:39] ahar...@php.net

Your arguments to preg_replace are swapped, ie:



preg_replace('#\s+#', $str, '-');



should be:



preg_replace('#\s+#', '-', $str);



Also note that Unicode zero width spaces aren't included in \s, but

you can match them directly with the u modifier (replace <200b> with

an actual zero width space character):



preg_replace('#<200b>+#u', '-', $str);



Not a bug: closing.


[2011-02-08 10:45:51] skyboy at mail dot ru

Description:

Group of zero width spaces is succesfully replaced by any character but
ordinary space.

Test script:
---
$str = "​​‎​​‎​​‎"; // 27 zero width spaces with
unicode code of u200B 

var_dump($str);

var_dump(preg_replace('#\s+#', $str, '-'));

var_dump(preg_replace('#\s+#', $str, ' '));

Expected result:

string(27) "​​‎​​‎​​‎" string(1) "-" string(1)
"​​‎​​‎​​‎-" 

Actual result:
--
string(27) "​​‎​​‎​​‎" string(1) "-" string(27)
"​​‎​​‎​​‎" 








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


Bug #53789 [Com]: Setting session.hash_function doesn't change hash function used.

2011-02-08 Thread henno at schooljan dot nl
Edit report at http://bugs.php.net/bug.php?id=53789&edit=1

 ID: 53789
 Comment by: henno at schooljan dot nl
 Reported by:richard at blueapex dot co dot uk
 Summary:Setting session.hash_function doesn't change hash
 function used.
 Status: Open
 Type:   Bug
 Package:Session related
 Operating System:   Freebsd 8.1
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

It does work when compiling in both hash and session modules into the
main PHP 

executable (by use of --enable-hash and --enable-session on the
configure line).



The FreeBSD Ports strategy is to provide a slim PHP base package with a
lot of 

extra modules as extra packages to choose. Fine of course, but
apparently the 

has_function option breaks when one of the relevant modules are
externally 

loaded.



I found this out because I also run a Gentoo machine where this bug does
not 

manifest itself, and there the package strategy is to compile everything
into 

one big PHP executable.



So a quick temporary workaround for FreeBSD users is adding both
--enable-hash 

and --enable-session in the FreeBSD port Makefile for lang/php5 (and
disable the 

external modules to prevent 'already loaded' warnings).











To summarize:



Steps to reproduce:

---

Use either hash or session modules as external loadable module, setting
reverts 

to 0 when choosing a hash algo.



Workaround:

---

Compile both hash and session modules into the main PHP executable.


Previous Comments:

[2011-02-01 15:11:08] richard at blueapex dot co dot uk

I have the hash extension enabled.



Doing print_r(hash_algos()) gives a fair few hashes. I'm using
hash('SHA512', $foo) for encrypting passwords so it defiantly is
available to PHP.


[2011-02-01 14:39:16] il...@php.net

Do you have the hash extension enabled? Without that extension, hashing
algorithms 

other than md5/sha1 will not be available.


[2011-01-30 14:07:14] datahell at elxis dot org

I face the same problem on PHP 5.2.5 (x64) on my local installation
Windows Vista 64bit.


[2011-01-19 14:23:34] richard at blueapex dot co dot uk

Description:

This may be an apache bug, though I'll start with putting it down as
php. There is a similar bug: Bug #49469 submitted in 2009 with advice
try the latest snapshot, that was version 5.3.0 and I'm using version
5.3.5 so assuming that advice isn't valid and the bug still exists.



Setting session.hash_function variable in php.ini doesn't change the
value used to generate the hash function.



I've tried sha512, sha1, whirlpool. All of these don't change the hash
delivered to the browser (PHPSESSID) and still the standard md5() hash
is used.



All the hash algos tried are on the system when the output of
hash_algos() is examined.



Specifying 1 does make the system use SHA1 to generate the session
hash.



##



Revelant. php.ini



session.save_handler = files

session.use_cookies = 1

session.use_only_cookies = 1

session.name = PHPSESSID

session.auto_start = 0

session.cookie_lifetime = 0

session.cookie_path = /

session.cookie_domain =

session.cookie_httponly =

session.serialize_handler = php

session.gc_probability = 1

session.gc_divisor = 1000

session.gc_maxlifetime = 1440

session.bug_compat_42 = On

session.bug_compat_warn = On

session.referer_check =

session.entropy_length = 0

session.entropy_file =

session.cache_limiter = nocache

session.cache_expire = 180

session.use_trans_sid = 0

session.hash_function = sha512

session.hash_bits_per_character = 5

url_rewriter.tags =
"a=href,area=href,frame=src,input=src,form=fakeentry"

Test script:
---
session_start()

Expected result:

sha512 generated PHPSESSID

Actual result:
--
md5 generated PHPSESSID






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


Bug #53964 [Com]: minutes on date function incorrect; see examples

2011-02-08 Thread greg at pwsdb dot com
Edit report at http://bugs.php.net/bug.php?id=53964&edit=1

 ID: 53964
 Comment by: greg at pwsdb dot com
 Reported by:greg at pswdb dot com
 Summary:minutes on date function incorrect; see examples
 Status: Bogus
 Type:   Bug
 Package:*General Issues
 Operating System:   fedora 13
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

echo  '' . date("h:m:s a");

produces 

02:02:26 pm 

and (4 sec. later) 

my interactive fedora 14 command $ date 

produced 

Tue Feb  8 14:58:30 EST 2011

which is correct: It is 58 minutes after the hour, not 2 right now. 

... therefor, it is the date function in PHP, not linux, and it is not

the strtotime function. this time, it was not involved.


Previous Comments:

[2011-02-08 20:45:28] johan...@php.net

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

Your format string includes "m" as in month twice. You need an "i" for
minutes.



date("Y-m-d h:i:s",$i);


[2011-02-08 20:40:57] greg at pswdb dot com

Description:

---

>From manual page: http://www.php.net/function.date

---

  $d="2010-01-31 09:06:09"; 

  $i= strtotime($d);

  echo  '' . $d  ; 

  echo  '' . date("Y-m-d h:m:s",$i); 

produces this:

2010-01-31 09:06:09

2010-01-31 09:01:09





  $d="2011-01-20 09:48:00"; 

  $i= strtotime($d);

  echo  '' . $d  ; 

  echo  '' . date("Y-m-d h:m:s",$i); 

produces this:

2011-01-20 09:48:00

2011-01-20 09:01:00





  $d="2010-06-26 01:29:39"; 

  $i= strtotime($d);

  echo  '' . $d  ; 

  echo  '' . date("Y-m-d h:m:s",$i); 

produces this:

2010-06-26 01:29:39

2010-06-26 01:06:39 







Expected result:

2010-01-31 09:06:09

2010-01-31 09:06:09



2011-01-20 09:48:00

2011-01-20 09:48:00



2010-06-26 01:29:39

2010-06-26 01:29:39













Actual result:
--




2010-01-31 09:06:09

2010-01-31 09:01:09



2011-01-20 09:48:00

2011-01-20 09:01:00



2010-06-26 01:29:39

2010-06-26 01:06:39












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


Bug #53964 [Opn->Bgs]: minutes on date function incorrect; see examples

2011-02-08 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=53964&edit=1

 ID: 53964
 Updated by: johan...@php.net
 Reported by:greg at pswdb dot com
 Summary:minutes on date function incorrect; see examples
-Status: Open
+Status: Bogus
 Type:   Bug
 Package:*General Issues
 Operating System:   fedora 13
 PHP Version:5.3.5
 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

Your format string includes "m" as in month twice. You need an "i" for
minutes.



date("Y-m-d h:i:s",$i);


Previous Comments:

[2011-02-08 20:40:57] greg at pswdb dot com

Description:

---

>From manual page: http://www.php.net/function.date

---

  $d="2010-01-31 09:06:09"; 

  $i= strtotime($d);

  echo  '' . $d  ; 

  echo  '' . date("Y-m-d h:m:s",$i); 

produces this:

2010-01-31 09:06:09

2010-01-31 09:01:09





  $d="2011-01-20 09:48:00"; 

  $i= strtotime($d);

  echo  '' . $d  ; 

  echo  '' . date("Y-m-d h:m:s",$i); 

produces this:

2011-01-20 09:48:00

2011-01-20 09:01:00





  $d="2010-06-26 01:29:39"; 

  $i= strtotime($d);

  echo  '' . $d  ; 

  echo  '' . date("Y-m-d h:m:s",$i); 

produces this:

2010-06-26 01:29:39

2010-06-26 01:06:39 







Expected result:

2010-01-31 09:06:09

2010-01-31 09:06:09



2011-01-20 09:48:00

2011-01-20 09:48:00



2010-06-26 01:29:39

2010-06-26 01:29:39













Actual result:
--




2010-01-31 09:06:09

2010-01-31 09:01:09



2011-01-20 09:48:00

2011-01-20 09:01:00



2010-06-26 01:29:39

2010-06-26 01:06:39












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


[PHP-BUG] Bug #53964 [NEW]: minutes on date function incorrect; see examples

2011-02-08 Thread greg at pswdb dot com
From: 
Operating system: fedora 13
PHP version:  5.3.5
Package:  *General Issues
Bug Type: Bug
Bug description:minutes on date function incorrect; see examples

Description:

---

>From manual page: http://www.php.net/function.date

---

  $d="2010-01-31 09:06:09"; 

  $i= strtotime($d);

  echo  '' . $d  ; 

  echo  '' . date("Y-m-d h:m:s",$i); 

produces this:

2010-01-31 09:06:09

2010-01-31 09:01:09





  $d="2011-01-20 09:48:00"; 

  $i= strtotime($d);

  echo  '' . $d  ; 

  echo  '' . date("Y-m-d h:m:s",$i); 

produces this:

2011-01-20 09:48:00

2011-01-20 09:01:00





  $d="2010-06-26 01:29:39"; 

  $i= strtotime($d);

  echo  '' . $d  ; 

  echo  '' . date("Y-m-d h:m:s",$i); 

produces this:

2010-06-26 01:29:39

2010-06-26 01:06:39 







Expected result:

2010-01-31 09:06:09

2010-01-31 09:06:09



2011-01-20 09:48:00

2011-01-20 09:48:00



2010-06-26 01:29:39

2010-06-26 01:29:39













Actual result:
--




2010-01-31 09:06:09

2010-01-31 09:01:09



2011-01-20 09:48:00

2011-01-20 09:01:00



2010-06-26 01:29:39

2010-06-26 01:06:39







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



[PHP-BUG] Bug #53963 [NEW]: Failed to decode, yet json_last_error() is JSON_ERROR_NONE

2011-02-08 Thread h...@php.net
From: hm2k
Operating system: 
PHP version:  5.3.5
Package:  JSON related
Bug Type: Bug
Bug description:Failed to decode, yet json_last_error() is JSON_ERROR_NONE

Description:

I'm trying the json_decode() function on real world strings, not just from
strings 

produced using json_encode().



I have included the test case from bug #52262 as well to show that this
issue is 

different.



Thanks.

Test script:
---


http://dealerservices.autotrader.co.uk/14184/cars.htm */

$urls[]='http://atsearch.autotrader.co.uk/js/uvl/InlineServlet.js?did=14184&configfile=http://dealerservices.autotrader.co.uk/dealers/14184/14184_config.xml&csslocation=http://dealerservices.autotrader.co.uk/dealers/14184/14184&dropdowntype=uvl&partner=TMG&postcode=me86ad&miles=1500&sort=5&action=searchresults';

/* from http://api.jquery.com/jQuery.getJSON/ */

$urls[]='http://api.flickr.com/services/feeds/photos_public.gne?jsoncallback=jQuery15094986786483787_1297190250272&tags=cat&tagmode=any&format=json&_=1297190250280';

/* from http://code.google.com/apis/base/samples/javascript/tutorial.html
*/

$urls[]='http://www.google.com/base/feeds/attributes/-/vehicles?max-values=30&bq=[target%20country:GB]&alt=json-in-script&callback=showMake';

/* from http://code.google.com/apis/gdata/docs/json.html */

$urls[]='http://www.google.com/calendar/feeds/developer-calen...@google.com/public/full?alt=json';

/* from http://code.google.com/apis/gdata/docs/json.html */

$urls[]='http://www.google.com/calendar/feeds/developer-calen...@google.com/public/full?alt=json-in-script&callback=myFunction';

/* from http://bugs.php.net/bug.php?id=52262 */

$urls[]='http://api.steampowered.com/ISteamUserStats/GetGlobalAchievementPercentagesForApp/v0001/?gameid=440';



/* from http://php.net/manual/en/function.json-last-error.php */

$json_errors=array( -1 => 'An unknown error occured',


JSON_ERROR_NONE => 'No error has occurred',


JSON_ERROR_DEPTH => 'The maximum stack depth has been exceeded',


JSON_ERROR_CTRL_CHAR => 'Control character error, possibly
incorrectly encoded',


JSON_ERROR_STATE_MISMATCH => 'Invalid or malformed JSON',


JSON_ERROR_SYNTAX => 'Syntax error',


JSON_ERROR_UTF8 => 'Malformed UTF-8 characters, possibly
incorrectly encoded');



/* main loop */

foreach($urls as $url) {

echo PHP_EOL;



//call the json

$json=file_get_contents($url);

echo 'Decoding... ' . $url . PHP_EOL;



//convert from jsonp to json

$json=preg_replace('/.+?({.+}).+/','$1',$json);



//get a result

$result=json_decode($json);

if ($result) {

echo 'Decoded.';

} else {

  echo 'Failed to decode.';

}

echo PHP_EOL;



$err=json_last_error();

if ($err != JSON_ERROR_NONE) {

echo 'Error: ';

echo 
isset($json_errors[$err])?$json_errors[$err]:$json_errors[-1];

} else {

echo 'No error.';

}

echo PHP_EOL;

}



//eof

Expected result:

The first result should either:



* Decode successfully and have no error (preferable)

Or

* Fail to decode and have an error which explains why

Actual result:
--


Decoding... http://atsearch.autotrader.co.uk/js/uvl/InlineServlet.js?

did=14184&configfile=http://dealerservices.autotrader.co.uk/dealers/14184/14184_

config.xml&csslocation=http://dealerservices.autotrader.co.uk/dealers/14184/1418

4&dropdowntype=uvl&partner=TMG&postcode=me86ad&miles=1500&sort=5&action=searchre

sults

Failed to decode.

No error.



Decoding... http://api.flickr.com/services/feeds/photos_public.gne?

jsoncallback=jQuery15094986786483787_1297190250272&tags=cat&tagmode=any&format=j

son&_=1297190250280

Failed to decode.

Error: Syntax error



Decoding... http://www.google.com/base/feeds/attributes/-/vehicles?max-

values=30&bq=[target%20country:GB]&alt=json-in-script&callback=showMake

Decoded.

No error.



Decoding... http://www.google.com/calendar/feeds/developer-

calen...@google.com/public/full?alt=json

Decoded.

No error.



Decoding... http://www.google.com/calendar/feeds/developer-

calen...@google.com/public/full?alt=json-in-script&callback=myFunction

Decoded.

No error.



Decoding... 

http://api.steampowered.com/ISteamUserStats/GetGlobalAchievementPercentagesForAp

p/v0001/?gameid=440

Decoded.

No error.

-- 
Edit bug report at http://bugs.php.net/bug.php?id=53963&edit

Bug #53962 [Bgs]: Persistent connections

2011-02-08 Thread tiago dot duarte at softconcept dot pt
Edit report at http://bugs.php.net/bug.php?id=53962&edit=1

 ID: 53962
 User updated by:tiago dot duarte at softconcept dot pt
 Reported by:tiago dot duarte at softconcept dot pt
 Summary:Persistent connections
 Status: Bogus
 Type:   Bug
 Package:OCI8 related
 Operating System:   Windows 7
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

What do you recomend is to upgrade to oracle 11, using Database Resident
Connection Pooling?

I do not understand how this is not a bug, because the TCP between
apache and oracle remains ESTABLISHED.

Is there any way to resolve my problem?


Previous Comments:

[2011-02-08 19:32:30] johan...@php.net

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

Mind the notes on http://php.net/oci8.persistent-timeout


[2011-02-08 18:55:03] tiago dot duarte at softconcept dot pt

Description:

I would aspect to see TCP connection between the apache and the Oracle
server to die, after 10seconds the script ends. What i see, is that the
connections stays ESTABLISHED until i restart apache.



//php.ini changes

oci8.max_persistent = 2



oci8.persistent_timeout = 10



oci8.ping_interval = -1

Test script:
---
  $sql = "SELECT nome FROM f_pessoa";

  $conn = oci_pconnect($user_oracle, $password_db_oracle,
$database_oracle);

  $stid = oci_parse($conn, $sql);

  $r = oci_execute($stid, OCI_DEFAULT);

  if (!$r) {

$e = oci_error($stid);

echo htmlentities($e['message']);

exit;

  }

  while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS)) {

foreach ($row as $item) {

$table_2 .= ($item?htmlentities($item):' ');

}

  }

  oci_close($conn);

  oci_free_statement($stid);



Expected result:

I would expect that TCP connections will die 10s after the script ends.

Actual result:
--
The TCP connection between the apache and the Oracle Server stays
ESTABLISHED for ever...






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


Bug #53961 [Fbk->Opn]: soap over https with custom port does work

2011-02-08 Thread bender at digitalbase dot de
Edit report at http://bugs.php.net/bug.php?id=53961&edit=1

 ID: 53961
 User updated by:bender at digitalbase dot de
 Reported by:bender at digitalbase dot de
 Summary:soap over https with custom port does work
-Status: Feedback
+Status: Open
 Type:   Bug
 Package:OpenSSL related
 Operating System:   WinXP 32bit
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

the current version does work PHP 5.3.5


Previous Comments:

[2011-02-08 18:30:09] cataphr...@php.net

I have no problems with 0.9.8o-1ubuntu4.3



I can test on Windows, but to be clear: which version does not work? Is
it available through windows.php.net? Which package is it?


[2011-02-08 17:28:55] bender at digitalbase dot de

Description:

SoapClient does work with https over custom port.



If one version is the OpenSSl.dll (OpenSSL 0.9.8l) from an earlier PHP
take it to work. With the current, it does not work.











Test script:
---
// does work

$client = new SoapClient("https://localhost:21081/test_13?wsdl";);







// works

$client = new SoapClient("https://localhost/test_13?wsdl";);





Actual result:
--
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing
WSDL: Couldn't load from 'https://localhost:21081/test_13?wsdl' : Start
tag expected, '<' not found in C:\htdocs\wwwroot\test.php:4 Stack trace:
#0 C:\htdocs\wwwroot\test.php(4):
SoapClient->SoapClient('https://local...') #1 {main} thrown in
C:\htdocs\wwwroot\test.php on line 4






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


Bug #53962 [Opn->Bgs]: Persistent connections

2011-02-08 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=53962&edit=1

 ID: 53962
 Updated by: johan...@php.net
 Reported by:tiago dot duarte at softconcept dot pt
 Summary:Persistent connections
-Status: Open
+Status: Bogus
 Type:   Bug
 Package:OCI8 related
 Operating System:   Windows 7
 PHP Version:5.3.5
 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

Mind the notes on http://php.net/oci8.persistent-timeout


Previous Comments:

[2011-02-08 18:55:03] tiago dot duarte at softconcept dot pt

Description:

I would aspect to see TCP connection between the apache and the Oracle
server to die, after 10seconds the script ends. What i see, is that the
connections stays ESTABLISHED until i restart apache.



//php.ini changes

oci8.max_persistent = 2



oci8.persistent_timeout = 10



oci8.ping_interval = -1

Test script:
---
  $sql = "SELECT nome FROM f_pessoa";

  $conn = oci_pconnect($user_oracle, $password_db_oracle,
$database_oracle);

  $stid = oci_parse($conn, $sql);

  $r = oci_execute($stid, OCI_DEFAULT);

  if (!$r) {

$e = oci_error($stid);

echo htmlentities($e['message']);

exit;

  }

  while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS)) {

foreach ($row as $item) {

$table_2 .= ($item?htmlentities($item):' ');

}

  }

  oci_close($conn);

  oci_free_statement($stid);



Expected result:

I would expect that TCP connections will die 10s after the script ends.

Actual result:
--
The TCP connection between the apache and the Oracle Server stays
ESTABLISHED for ever...






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


Req #53950 [Opn]: Add a way to configure where libxml searches for Catalog Files

2011-02-08 Thread rrichards
Edit report at http://bugs.php.net/bug.php?id=53950&edit=1

 ID: 53950
 Updated by: rricha...@php.net
 Reported by:gordon at onlinehome dot de
 Summary:Add a way to configure where libxml searches for
 Catalog Files
 Status: Open
 Type:   Feature/Change Request
 Package:*XML functions
 Operating System:   any
 PHP Version:Irrelevant
-Assigned To:
+Assigned To:rrichards
 Block user comment: N
 Private report: N

 New Comment:

Assign to self as I asked him to open this


Previous Comments:

[2011-02-08 19:18:43] cataphr...@php.net

> This, by itself, makes it inviable to write a PHP function that
allows

> replacing the default catalog unless some (probably expensive, since
a

> catalog file must be read) on request startup/shutdown is used.



The unless part doesn't actually make sense in the multi-threading
versions of PHP.


[2011-02-08 19:14:49] cataphr...@php.net

I know very little of libxml2, but as far as I infer from
http://xmlsoft.org/catalog.html and from the code in catalog.c, there is
no way to specify a global catalog in a thread-local manner. This, by
itself, makes it inviable to write a PHP function that allows replacing
the default catalog unless some (probably expensive, since a catalog
file must be read) on request startup/shutdown is used.



libxml2 supports per-document catalogs, but from what I see, your
document must contain an oasis-xml-catalog processing instruction, like
this:





http://example.com/catalog.xml";?>

http://www.example.com/schema/doc.dtd";>



There is another alternative, which is using an external entity loader
(see
http://xmlsoft.org/html/libxml-parser.html#xmlSetExternalEntityLoader ),
but this is less convenient, though probably we could also expose some
functions to deal with catalogs for use in the user-supplied callback.



I could implement this, but I'm hopping someone else with more libxml2
knowledge could tell if my analysis is correct.


[2011-02-07 17:16:37] gordon at onlinehome dot de

Description:

Libxml can use catalog files to provide a local cache mechanism allowing
to load the entities associated to public identifiers or remote
resources. There is currently no way to configure the catalog file path
from PHP. Configuring the path in libxml itself seems possible:



> The user can change the default catalog behaviour by redirecting
queries to its own set of catalogs. This can be done by setting the
XML_CATALOG_FILES environment variable to a list of catalogs, an empty
one should deactivate loading the default /etc/xml/catalog default
catalog.



It would be nice if PHP's libxml extension would provide a way to set
the path somehow. This could be helpful when validating documents with
remote System Identifiers, like any HTML DTD. Or simply to bundle files
with an application.



Related Resources:



- http://xmlsoft.org/catalog.html

- http://www.w3.org/blog/systeam/2008/02/08/w3c_s_excessive_dtd_traffic

- http://bugs.php.net/48080

- http://bugs.php.net/32426







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


Req #53950 [Opn]: Add a way to configure where libxml searches for Catalog Files

2011-02-08 Thread cataphract
Edit report at http://bugs.php.net/bug.php?id=53950&edit=1

 ID: 53950
 Updated by: cataphr...@php.net
 Reported by:gordon at onlinehome dot de
 Summary:Add a way to configure where libxml searches for
 Catalog Files
 Status: Open
 Type:   Feature/Change Request
 Package:*XML functions
 Operating System:   any
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

> This, by itself, makes it inviable to write a PHP function that
allows

> replacing the default catalog unless some (probably expensive, since
a

> catalog file must be read) on request startup/shutdown is used.



The unless part doesn't actually make sense in the multi-threading
versions of PHP.


Previous Comments:

[2011-02-08 19:14:49] cataphr...@php.net

I know very little of libxml2, but as far as I infer from
http://xmlsoft.org/catalog.html and from the code in catalog.c, there is
no way to specify a global catalog in a thread-local manner. This, by
itself, makes it inviable to write a PHP function that allows replacing
the default catalog unless some (probably expensive, since a catalog
file must be read) on request startup/shutdown is used.



libxml2 supports per-document catalogs, but from what I see, your
document must contain an oasis-xml-catalog processing instruction, like
this:





http://example.com/catalog.xml";?>

http://www.example.com/schema/doc.dtd";>



There is another alternative, which is using an external entity loader
(see
http://xmlsoft.org/html/libxml-parser.html#xmlSetExternalEntityLoader ),
but this is less convenient, though probably we could also expose some
functions to deal with catalogs for use in the user-supplied callback.



I could implement this, but I'm hopping someone else with more libxml2
knowledge could tell if my analysis is correct.


[2011-02-07 17:16:37] gordon at onlinehome dot de

Description:

Libxml can use catalog files to provide a local cache mechanism allowing
to load the entities associated to public identifiers or remote
resources. There is currently no way to configure the catalog file path
from PHP. Configuring the path in libxml itself seems possible:



> The user can change the default catalog behaviour by redirecting
queries to its own set of catalogs. This can be done by setting the
XML_CATALOG_FILES environment variable to a list of catalogs, an empty
one should deactivate loading the default /etc/xml/catalog default
catalog.



It would be nice if PHP's libxml extension would provide a way to set
the path somehow. This could be helpful when validating documents with
remote System Identifiers, like any HTML DTD. Or simply to bundle files
with an application.



Related Resources:



- http://xmlsoft.org/catalog.html

- http://www.w3.org/blog/systeam/2008/02/08/w3c_s_excessive_dtd_traffic

- http://bugs.php.net/48080

- http://bugs.php.net/32426







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


Req #53950 [Opn]: Add a way to configure where libxml searches for Catalog Files

2011-02-08 Thread cataphract
Edit report at http://bugs.php.net/bug.php?id=53950&edit=1

 ID: 53950
 Updated by: cataphr...@php.net
 Reported by:gordon at onlinehome dot de
 Summary:Add a way to configure where libxml searches for
 Catalog Files
 Status: Open
 Type:   Feature/Change Request
 Package:*XML functions
 Operating System:   any
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

I know very little of libxml2, but as far as I infer from
http://xmlsoft.org/catalog.html and from the code in catalog.c, there is
no way to specify a global catalog in a thread-local manner. This, by
itself, makes it inviable to write a PHP function that allows replacing
the default catalog unless some (probably expensive, since a catalog
file must be read) on request startup/shutdown is used.



libxml2 supports per-document catalogs, but from what I see, your
document must contain an oasis-xml-catalog processing instruction, like
this:





http://example.com/catalog.xml";?>

http://www.example.com/schema/doc.dtd";>



There is another alternative, which is using an external entity loader
(see
http://xmlsoft.org/html/libxml-parser.html#xmlSetExternalEntityLoader ),
but this is less convenient, though probably we could also expose some
functions to deal with catalogs for use in the user-supplied callback.



I could implement this, but I'm hopping someone else with more libxml2
knowledge could tell if my analysis is correct.


Previous Comments:

[2011-02-07 17:16:37] gordon at onlinehome dot de

Description:

Libxml can use catalog files to provide a local cache mechanism allowing
to load the entities associated to public identifiers or remote
resources. There is currently no way to configure the catalog file path
from PHP. Configuring the path in libxml itself seems possible:



> The user can change the default catalog behaviour by redirecting
queries to its own set of catalogs. This can be done by setting the
XML_CATALOG_FILES environment variable to a list of catalogs, an empty
one should deactivate loading the default /etc/xml/catalog default
catalog.



It would be nice if PHP's libxml extension would provide a way to set
the path somehow. This could be helpful when validating documents with
remote System Identifiers, like any HTML DTD. Or simply to bundle files
with an application.



Related Resources:



- http://xmlsoft.org/catalog.html

- http://www.w3.org/blog/systeam/2008/02/08/w3c_s_excessive_dtd_traffic

- http://bugs.php.net/48080

- http://bugs.php.net/32426







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


[PHP-BUG] Bug #53962 [NEW]: Persistent connections

2011-02-08 Thread tiago dot duarte at softconcept dot pt
From: 
Operating system: Windows 7
PHP version:  5.3.5
Package:  OCI8 related
Bug Type: Bug
Bug description:Persistent connections

Description:

I would aspect to see TCP connection between the apache and the Oracle
server to die, after 10seconds the script ends. What i see, is that the
connections stays ESTABLISHED until i restart apache.



//php.ini changes

oci8.max_persistent = 2



oci8.persistent_timeout = 10



oci8.ping_interval = -1

Test script:
---
  $sql = "SELECT nome FROM f_pessoa";

  $conn = oci_pconnect($user_oracle, $password_db_oracle,
$database_oracle);

  $stid = oci_parse($conn, $sql);

  $r = oci_execute($stid, OCI_DEFAULT);

  if (!$r) {

$e = oci_error($stid);

echo htmlentities($e['message']);

exit;

  }

  while ($row = oci_fetch_array($stid, OCI_RETURN_NULLS)) {

foreach ($row as $item) {

$table_2 .= ($item?htmlentities($item):' ');

}

  }

  oci_close($conn);

  oci_free_statement($stid);



Expected result:

I would expect that TCP connections will die 10s after the script ends.

Actual result:
--
The TCP connection between the apache and the Oracle Server stays
ESTABLISHED for ever...

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



Bug #53961 [Opn->Fbk]: soap over https with custom port does work

2011-02-08 Thread cataphract
Edit report at http://bugs.php.net/bug.php?id=53961&edit=1

 ID: 53961
 Updated by: cataphr...@php.net
 Reported by:bender at digitalbase dot de
 Summary:soap over https with custom port does work
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:OpenSSL related
 Operating System:   WinXP 32bit
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

I have no problems with 0.9.8o-1ubuntu4.3



I can test on Windows, but to be clear: which version does not work? Is
it available through windows.php.net? Which package is it?


Previous Comments:

[2011-02-08 17:28:55] bender at digitalbase dot de

Description:

SoapClient does work with https over custom port.



If one version is the OpenSSl.dll (OpenSSL 0.9.8l) from an earlier PHP
take it to work. With the current, it does not work.











Test script:
---
// does work

$client = new SoapClient("https://localhost:21081/test_13?wsdl";);







// works

$client = new SoapClient("https://localhost/test_13?wsdl";);





Actual result:
--
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing
WSDL: Couldn't load from 'https://localhost:21081/test_13?wsdl' : Start
tag expected, '<' not found in C:\htdocs\wwwroot\test.php:4 Stack trace:
#0 C:\htdocs\wwwroot\test.php(4):
SoapClient->SoapClient('https://local...') #1 {main} thrown in
C:\htdocs\wwwroot\test.php on line 4






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


Bug #53958 [Opn->Ver]: Closures can't 'use' shared variables by value and by reference

2011-02-08 Thread cataphract
Edit report at http://bugs.php.net/bug.php?id=53958&edit=1

 ID: 53958
 Updated by: cataphr...@php.net
 Reported by:php at maisqi dot com
 Summary:Closures can't 'use' shared variables by value and
 by reference
-Status: Open
+Status: Verified
 Type:   Bug
 Package:Scripting Engine problem
 Operating System:   Windows XP 32
 PHP Version:5.3.5
 Block user comment: N
 Private report: N



Previous Comments:

[2011-02-08 14:00:00] php at maisqi dot com

Description:

When the same variable is 'used' by one closure by reference an another
closure 'uses' the same variable by value, both behave like were 'using'
the var by value. I think the demonstration code will help making things
clear for you.

Not less stranger is the fact that the order you declare the closures
matters.

Test script:
---
"; };

$fn2 = function () use ($a) { echo $a . "\n"; };



$a = 123;



$fn1 ();

$fn2 ();

//

// Analisys:

//  In PHP 5.3.5 under Windows, outputs:

//  123, 123

//  Ok.

///

///

/// TEST 3

///

// Let's repeat TEST 1, but this time both closures 'use' $a by
reference.

echo "-\n";

$a = 123;

$fn1 = function () use (&$a) { echo $a . "\n"; };

$fn2 = function () use (&$a) { echo $a . "\n"; };



$a = 456;



$fn1 ();

$fn2 ();

//

// Analisys:

//  In PHP 5.3.5 under Windows, outputs:

//  456, 456

//  Ok.

///

///

/// TEST 3

///

/// Let's repeat TEST 1, but this time closure 1 'uses' $a by reference

/// closure 2 uses it by value.

///

echo "-\n";

$a = 123;

$fn1 = function () use (&$a) { echo $a . "\n"; };

$fn2 = function () use ($a) { echo $a . "\n"; };



$a = 456;



$fn1 ();

$fn2 ();

//

// Analisys:

//  In PHP 5.3.5 under Windows, outputs:

//  123, 123

//  Wrong! It should output 456, 123.

///

///

/// TEST 4

///

/// Let's do same as in TEST 3 but now closure 1 'uses' by value and
closure 2

/// 'uses' by reference.

///

echo "-\n";

$a = 123;

$fn1 = function () use ($a) { echo $a . "\n"; };

$fn2 = function () use (&$a) { echo $a . "\n"; };



$a = 456;



$fn1 ();

$fn2 ();

//

// Analisys:

//  In PHP 5.3.5 under Windows, outputs:

//  123, 456

//  Ok. What the hell?



Expected result:

It should output:



123

123

-

456

456

-

456

123

-

123

456 

Actual result:
--
Only Test 3 fails. The others are for helping finding the problem.





123

123

-

456

456

-

123

123

-

123

456






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


Bug #53959 [ReO->Csd]: feature or something old?

2011-02-08 Thread cataphract
Edit report at http://bugs.php.net/bug.php?id=53959&edit=1

 ID: 53959
 Updated by: cataphr...@php.net
 Reported by:robbert at persc dot nl
 Summary:feature or something old?
-Status: Re-Opened
+Status: Closed
 Type:   Bug
 Package:Reflection related
 PHP Version:Irrelevant
-Assigned To:
+Assigned To:cataphract
 Block user comment: N
 Private report: N



Previous Comments:

[2011-02-08 17:29:36] cataphr...@php.net

Automatic comment from SVN on behalf of cataphract
Revision: http://svn.php.net/viewvc/?view=revision&revision=308127
Log: - Fixed bug #53959 (reflection data for fgetcsv out-of-date).


[2011-02-08 16:57:45] rquadl...@php.net

There is a bug here with the reflection of fgetcsv.



php -n --rf fgetcsv shows ...



Function [  function fgetcsv ] {



  - Parameters [4] {

Parameter #0 [  $fp ]

Parameter #1 [  $length ]

Parameter #2 [  $delimiter ]

Parameter #3 [  $enclosure ]

  }

}



The attached patch fixes the reflection.


[2011-02-08 16:37:04] sala...@php.net

As documented on that page, there are five parameters and the fifth
parameter 

"escape" was added with PHP 5.3.0 (see the Changelog section).


[2011-02-08 16:06:35] robbert at persc dot nl

Description:

---

>From manual page: http://www.php.net/function.fgetcsv#Description

---



The documentation says you can use 5 different parameters, but there are
only 4 allowed.



So is this a feature or something from an older php version?







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


[PHP-BUG] Bug #53961 [NEW]: soap over https with custom port does work

2011-02-08 Thread bender at digitalbase dot de
From: 
Operating system: WinXP 32bit
PHP version:  5.3.5
Package:  OpenSSL related
Bug Type: Bug
Bug description:soap over https with custom port does work

Description:

SoapClient does work with https over custom port.



If one version is the OpenSSl.dll (OpenSSL 0.9.8l) from an earlier PHP take
it to work. With the current, it does not work.











Test script:
---
// does work

$client = new SoapClient("https://localhost:21081/test_13?wsdl";);







// works

$client = new SoapClient("https://localhost/test_13?wsdl";);





Actual result:
--
Fatal error: Uncaught SoapFault exception: [WSDL] SOAP-ERROR: Parsing WSDL:
Couldn't load from 'https://localhost:21081/test_13?wsdl' : Start tag
expected, '<' not found in C:\htdocs\wwwroot\test.php:4 Stack trace: #0
C:\htdocs\wwwroot\test.php(4): SoapClient->SoapClient('https://local...')
#1 {main} thrown in C:\htdocs\wwwroot\test.php on line 4

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



[PHP-BUG] Bug #53960 [NEW]: "Invalid parameter number" for multiple params equals in query

2011-02-08 Thread contato at andersonfraga dot net
From: 
Operating system: Windows
PHP version:  5.3.5
Package:  PDO related
Bug Type: Bug
Bug description:"Invalid parameter number" for multiple params equals in query

Description:

This error is occurring when I use the same parameter several times in the
query.

In PHP 5.2.14, using Gentoo, it works perfectly. Already in versions 5.3.0
and 5.3.3 (using Windows on both), returns an exception.



Bug or 'feature'?

Test script:
---
 PDO::ERRMODE_EXCEPTION,

PDO::ATTR_EMULATE_PREPARES => false,

));



$select = "SELECT * FROM PR_CLIENTE

   WHERE DELETADO = 'N'

 AND (NOME_CLIENTE LIKE :hash_1

OR ENDERECO_CLIENTE LIKE :hash_1)

   ORDER BY ID_CLIENTE DESC

   LIMIT :hash_2;";



$statement = $dbh->prepare($select);

$statement->execute(Array(

':hash_1' => '%Anderson%',

':hash_2' => 0,

));



$fetch = $statement->fetchAll(PDO::FETCH_ASSOC);

print_r($fetch);

}

catch(PDOException $e) {

print_r($e->getMessage());

}

?>

Expected result:

Array

(

[0] => Array

(

[ID_CLIENTE] => 29

(...)

)



)



Actual result:
--
SQLSTATE[HY093]: Invalid parameter number

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



Doc->Bug #53959 [Bgs->ReO]: feature or something old?

2011-02-08 Thread rquadling
Edit report at http://bugs.php.net/bug.php?id=53959&edit=1

 ID: 53959
 Updated by: rquadl...@php.net
 Reported by:robbert at persc dot nl
 Summary:feature or something old?
-Status: Bogus
+Status: Re-Opened
-Type:   Documentation Problem
+Type:   Bug
-Package:Unknown/Other Function
+Package:Reflection related
 PHP Version:Irrelevant
 Block user comment: N
 Private report: N

 New Comment:

There is a bug here with the reflection of fgetcsv.



php -n --rf fgetcsv shows ...



Function [  function fgetcsv ] {



  - Parameters [4] {

Parameter #0 [  $fp ]

Parameter #1 [  $length ]

Parameter #2 [  $delimiter ]

Parameter #3 [  $enclosure ]

  }

}



The attached patch fixes the reflection.


Previous Comments:

[2011-02-08 16:37:04] sala...@php.net

As documented on that page, there are five parameters and the fifth
parameter 

"escape" was added with PHP 5.3.0 (see the Changelog section).


[2011-02-08 16:06:35] robbert at persc dot nl

Description:

---

>From manual page: http://www.php.net/function.fgetcsv#Description

---



The documentation says you can use 5 different parameters, but there are
only 4 allowed.



So is this a feature or something from an older php version?







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


Bug #53149 [Com]: cURL extension crashes Apache server on start-up

2011-02-08 Thread info at cybrax dot com
Edit report at http://bugs.php.net/bug.php?id=53149&edit=1

 ID: 53149
 Comment by: info at cybrax dot com
 Reported by:Jondor at GMX dot net
 Summary:cURL extension crashes Apache server on start-up
 Status: Bogus
 Type:   Bug
 Package:cURL related
 Operating System:   Windows 7
 PHP Version:5.3.3
 Block user comment: N
 Private report: N

 New Comment:

Updating to PHP 5.2.17 Fixes this problem.



Thank you.


Previous Comments:

[2011-02-08 16:52:10] paj...@php.net

Right, many people seems to have issue to correctly set their PATH or
where to put 

DLLs. Not sure what we can do at this point. But there is no bug here.


[2011-02-08 16:24:11] info at cybrax dot com

Same problem on Win XP SP3, Apache 2.2 and PHP 5 CuRL will crash apache
on 

startup, everything runs fine except when loading the curl extension.



Also tried to create a backtrace, sadly failed, Visual Studio debugger
reports the 

problem occures in php5ts.dll.



Tried Both MSI and ZIP, According to google this is a problem that more
people 

have.


[2010-10-27 17:41:54] paj...@php.net

Not a bug in PHP > config error.


[2010-10-27 11:33:00] Jondor at GMX dot net

I tried that already before submitting the original report. However,
meanwhile I identified the cause of the problem. In my system's search
path (%PATH% environment variable), the PHP directory was preceded by
another directory which also included the libeay32.dll that the cURL
extension depends on. Therefore it loaded that other version of
libeay32.dll which apparently isn't compatible with this PHP build.
Changing the search order fixed the problem.


[2010-10-26 17:47:27] paj...@php.net

Duplicated, you can try using the zip version please? Not the MSI.
Simply replace the php_curl.dll




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

http://bugs.php.net/bug.php?id=53149


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


Bug #53149 [Bgs]: cURL extension crashes Apache server on start-up

2011-02-08 Thread pajoye
Edit report at http://bugs.php.net/bug.php?id=53149&edit=1

 ID: 53149
 Updated by: paj...@php.net
 Reported by:Jondor at GMX dot net
 Summary:cURL extension crashes Apache server on start-up
 Status: Bogus
 Type:   Bug
 Package:cURL related
 Operating System:   Windows 7
 PHP Version:5.3.3
 Block user comment: N
 Private report: N

 New Comment:

Right, many people seems to have issue to correctly set their PATH or
where to put 

DLLs. Not sure what we can do at this point. But there is no bug here.


Previous Comments:

[2011-02-08 16:24:11] info at cybrax dot com

Same problem on Win XP SP3, Apache 2.2 and PHP 5 CuRL will crash apache
on 

startup, everything runs fine except when loading the curl extension.



Also tried to create a backtrace, sadly failed, Visual Studio debugger
reports the 

problem occures in php5ts.dll.



Tried Both MSI and ZIP, According to google this is a problem that more
people 

have.


[2010-10-27 17:41:54] paj...@php.net

Not a bug in PHP > config error.


[2010-10-27 11:33:00] Jondor at GMX dot net

I tried that already before submitting the original report. However,
meanwhile I identified the cause of the problem. In my system's search
path (%PATH% environment variable), the PHP directory was preceded by
another directory which also included the libeay32.dll that the cURL
extension depends on. Therefore it loaded that other version of
libeay32.dll which apparently isn't compatible with this PHP build.
Changing the search order fixed the problem.


[2010-10-26 17:47:27] paj...@php.net

Duplicated, you can try using the zip version please? Not the MSI.
Simply replace the php_curl.dll


[2010-10-26 17:37:13] Jondor at GMX dot net

Tried to generate the backtrace using the Microsoft Debug Diagnostic
Tools. Couldn't get it to work for the Apache2.2 service (instructions
are for php.exe). I'm probably not savvy enough. Sorry.




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

http://bugs.php.net/bug.php?id=53149


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


Bug #53149 [Com]: cURL extension crashes Apache server on start-up

2011-02-08 Thread info at cybrax dot com
Edit report at http://bugs.php.net/bug.php?id=53149&edit=1

 ID: 53149
 Comment by: info at cybrax dot com
 Reported by:Jondor at GMX dot net
 Summary:cURL extension crashes Apache server on start-up
 Status: Bogus
 Type:   Bug
 Package:cURL related
 Operating System:   Windows 7
 PHP Version:5.3.3
 Block user comment: N
 Private report: N

 New Comment:

Same problem on Win XP SP3, Apache 2.2 and PHP 5 CuRL will crash apache
on 

startup, everything runs fine except when loading the curl extension.



Also tried to create a backtrace, sadly failed, Visual Studio debugger
reports the 

problem occures in php5ts.dll.



Tried Both MSI and ZIP, According to google this is a problem that more
people 

have.


Previous Comments:

[2010-10-27 17:41:54] paj...@php.net

Not a bug in PHP > config error.


[2010-10-27 11:33:00] Jondor at GMX dot net

I tried that already before submitting the original report. However,
meanwhile I identified the cause of the problem. In my system's search
path (%PATH% environment variable), the PHP directory was preceded by
another directory which also included the libeay32.dll that the cURL
extension depends on. Therefore it loaded that other version of
libeay32.dll which apparently isn't compatible with this PHP build.
Changing the search order fixed the problem.


[2010-10-26 17:47:27] paj...@php.net

Duplicated, you can try using the zip version please? Not the MSI.
Simply replace the php_curl.dll


[2010-10-26 17:37:13] Jondor at GMX dot net

Tried to generate the backtrace using the Microsoft Debug Diagnostic
Tools. Couldn't get it to work for the Apache2.2 service (instructions
are for php.exe). I'm probably not savvy enough. Sorry.


[2010-10-25 16:20:59] cataphr...@php.net

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.






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

http://bugs.php.net/bug.php?id=53149


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


[PHP-BUG] Bug #53958 [NEW]: Closures can't 'use' shared variables by value and by reference

2011-02-08 Thread php at maisqi dot com
From: 
Operating system: Windows XP 32
PHP version:  5.3.5
Package:  Scripting Engine problem
Bug Type: Bug
Bug description:Closures can't 'use' shared variables by value and by reference

Description:

When the same variable is 'used' by one closure by reference an another
closure 'uses' the same variable by value, both behave like were 'using'
the var by value. I think the demonstration code will help making things
clear for you.

Not less stranger is the fact that the order you declare the closures
matters.

Test script:
---
"; };

$fn2 = function () use ($a) { echo $a . "\n"; };



$a = 123;



$fn1 ();

$fn2 ();

//

// Analisys:

//  In PHP 5.3.5 under Windows, outputs:

//  123, 123

//  Ok.

///

///

/// TEST 3

///

// Let's repeat TEST 1, but this time both closures 'use' $a by reference.

echo "-\n";

$a = 123;

$fn1 = function () use (&$a) { echo $a . "\n"; };

$fn2 = function () use (&$a) { echo $a . "\n"; };



$a = 456;



$fn1 ();

$fn2 ();

//

// Analisys:

//  In PHP 5.3.5 under Windows, outputs:

//  456, 456

//  Ok.

///

///

/// TEST 3

///

/// Let's repeat TEST 1, but this time closure 1 'uses' $a by reference

/// closure 2 uses it by value.

///

echo "-\n";

$a = 123;

$fn1 = function () use (&$a) { echo $a . "\n"; };

$fn2 = function () use ($a) { echo $a . "\n"; };



$a = 456;



$fn1 ();

$fn2 ();

//

// Analisys:

//  In PHP 5.3.5 under Windows, outputs:

//  123, 123

//  Wrong! It should output 456, 123.

///

///

/// TEST 4

///

/// Let's do same as in TEST 3 but now closure 1 'uses' by value and
closure 2

/// 'uses' by reference.

///

echo "-\n";

$a = 123;

$fn1 = function () use ($a) { echo $a . "\n"; };

$fn2 = function () use (&$a) { echo $a . "\n"; };



$a = 456;



$fn1 ();

$fn2 ();

//

// Analisys:

//  In PHP 5.3.5 under Windows, outputs:

//  123, 456

//  Ok. What the hell?



Expected result:

It should output:



123

123

-

456

456

-

456

123

-

123

456 

Actual result:
--
Only Test 3 fails. The others are for helping finding the problem.





123

123

-

456

456

-

123

123

-

123

456

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



Req #53957 [Com]: Unloading Extentions OR Overriding Native Functions OR Importing Functions

2011-02-08 Thread landeholm at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=53957&edit=1

 ID: 53957
 Comment by: landeholm at gmail dot com
 Reported by:landeholm at gmail dot com
 Summary:Unloading Extentions OR Overriding Native Functions
 OR Importing Functions
 Status: Wont fix
 Type:   Feature/Change Request
 Package:Scripting Engine problem
 Operating System:   Irrelevant
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Some workaround notes: I'm currently solving this by the workaround
previously described as "dumb and ugly" by a little twist. I'm
dynamically adding forwarders for the functions that needs to be
imported by using a routine that goes trough all namespace locations and
creates a forwarder function by evaluating generated PHP code that looks
something like:



namespace source_ns; function source_fn() { return
call_user_func_array('target_ns\target_fn', get_func_args()) } ...



Eval is slow though... If I could populate the symbol table directly
instead doing it by eval() this would be acceptable. What I want is
dynamic function declaration like declare_function($name, function() {
... });



The eval method however works temporary since the low amount of function
imports only makes this routine use a couple of ms.


Previous Comments:

[2011-02-08 11:46:40] landeholm at gmail dot com

Thanks for your reply. Yes, I understand that it's unrealistic to expect
a feature that allows dynamic extension unloading. But how about
allowing function importing with the "use" statement? Regards~


[2011-02-08 11:34:56] ras...@php.net

extension unloading on a per-request basis simply isn't feasible from a


performance point of view.  And you obviously can't unload and leave it
unloaded 

for the next request because that next request may be for a page that
expects the 

extension to be there.


[2011-02-08 11:27:16] landeholm at gmail dot com

Description:

I'm building a framework which has a custom gettext implementation since
the gettext extension of PHP is poorly designed for my needs and it's
not installed in all environments so relying on it reduces
compatibility. The problem however is that it's installed in some
environments and since it claims the global "_" function which is pretty
much a gettext standard alias (and other gettext functions), it's
preventing me from implementing the gettext standard. There are no
possible way for me to solve this problem nicely today because PHP does
not have the ability to either:



A. Override/undeclare/rename native functions. (Okay, I can do it via
APD but that makes extension dependability even WORSE.)

B. Unloading extensions at runtime. (Most preferable... I don't want it
at all)

C. Importing functions. (My framework uses namespaces. The fact that
functions cannot be imported by the "use" keyword really spoils this
feature. Otherwise it could actually have fix this problem.)



Note that this problem assumes a context where you can't control the
environment in which you install your application in. This is a very
real scenario for a lot of people including me. This is a practical
problem, not a theoretical one.



Also note that declaring the "_" function in a namespace would be
pointless:

1. it would no longer be compatible with the gettext standard

2. it would require refactoring of all existing string wrapped code

3. it would no longer be compatible with existing string wrapped code

4. a longer name like \foo\translate_lib\_() defeats the point of having
a short function name



Another workaround is to declare a _ forwarding function in every
possible namespace, but that solution is dumb and ugly.



As a temporary workaround I might declare something like t\s() but I
don't like that solution and it doesn't solve 1, 2 and 3 above.

Test script:
---
/** EITHER A: */

undeclare_function("_");



/** OR B: */

unload_extension("gettext");



/** OR C: */

namespace foo;

use foo\translate_lib;



/** Test: */



// My gettext implementation.

function _($msgid) {

   return translate($msgid);

}



echo _("hello");

Expected result:

bonjour

Actual result:
--
Fatal error: Cannot redeclare _()






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


Bug #53821 [Asn->Csd]: go-pear installs PEAR 1.9.0 instead of 1.9.1

2011-02-08 Thread pajoye
Edit report at http://bugs.php.net/bug.php?id=53821&edit=1

 ID: 53821
 Updated by: paj...@php.net
 Reported by:tyra3l at gmail dot com
 Summary:go-pear installs PEAR 1.9.0 instead of 1.9.1
-Status: Assigned
+Status: Closed
 Type:   Bug
 Package:Windows Installer
 Operating System:   Windows
 PHP Version:5.3.5
 Assigned To:pajoye
 Block user comment: N
 Private report: N

 New Comment:

This bug has been fixed in SVN.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Fixed on the build boxes.



You can test snaps using http://rmtools.php.net/snaps/



Thanks for the report!


Previous Comments:

[2011-01-24 14:46:58] paj...@php.net

I already answered this question in my comment.



And yes it is automated. No idea why 5.3.4 did not take it, but reading
the log it 

did fetch it from pear.php.net.


[2011-01-24 14:09:41] tyra3l at gmail dot com

So this will be fixed in 5.3.6?

Judging from the PEAR repository, it seems, that the 1.9.1 was tagged 7
month ago.

What was the reason that the last 2 release was shipped with the 1.9.0?

Do you update this manually? Maybe this could be automated in the
build/release 

process, so it won't be forgotten.



Tyrael


[2011-01-24 01:07:39] paj...@php.net

We take the one available at http://pear.php.net/go-pear.phar by the
time of the 

1st RC for a given release.



Next release(s) will have the new ones, or the snapshots for the
impatient.



In the mean time, simply replace the go-pear.phar in the pear directory
before 

running go-pear and it should work well.


[2011-01-23 17:53:15] tyra3l at gmail dot com

I don't think we need any more info than already present, it's clear
that the go-

pear.phar in the latest windows builds contains the 1.9.0 pear, and
other old PEAR 

libs, as I mentioned in the bugreport. 



Tyrael


[2011-01-23 17:42:48] bulk at janoszen dot hu

I tried to extract the URL's the PEAR installer accesses and came up
with nothing. My installation log can be found here:
http://pastebin.com/4yMJQiQP




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

http://bugs.php.net/bug.php?id=53821


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


Req #53957 [Com]: Unloading Extentions OR Overriding Native Functions OR Importing Functions

2011-02-08 Thread landeholm at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=53957&edit=1

 ID: 53957
 Comment by: landeholm at gmail dot com
 Reported by:landeholm at gmail dot com
 Summary:Unloading Extentions OR Overriding Native Functions
 OR Importing Functions
 Status: Wont fix
 Type:   Feature/Change Request
 Package:Scripting Engine problem
 Operating System:   Irrelevant
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Thanks for your reply. Yes, I understand that it's unrealistic to expect
a feature that allows dynamic extension unloading. But how about
allowing function importing with the "use" statement? Regards~


Previous Comments:

[2011-02-08 11:34:56] ras...@php.net

extension unloading on a per-request basis simply isn't feasible from a


performance point of view.  And you obviously can't unload and leave it
unloaded 

for the next request because that next request may be for a page that
expects the 

extension to be there.


[2011-02-08 11:27:16] landeholm at gmail dot com

Description:

I'm building a framework which has a custom gettext implementation since
the gettext extension of PHP is poorly designed for my needs and it's
not installed in all environments so relying on it reduces
compatibility. The problem however is that it's installed in some
environments and since it claims the global "_" function which is pretty
much a gettext standard alias (and other gettext functions), it's
preventing me from implementing the gettext standard. There are no
possible way for me to solve this problem nicely today because PHP does
not have the ability to either:



A. Override/undeclare/rename native functions. (Okay, I can do it via
APD but that makes extension dependability even WORSE.)

B. Unloading extensions at runtime. (Most preferable... I don't want it
at all)

C. Importing functions. (My framework uses namespaces. The fact that
functions cannot be imported by the "use" keyword really spoils this
feature. Otherwise it could actually have fix this problem.)



Note that this problem assumes a context where you can't control the
environment in which you install your application in. This is a very
real scenario for a lot of people including me. This is a practical
problem, not a theoretical one.



Also note that declaring the "_" function in a namespace would be
pointless:

1. it would no longer be compatible with the gettext standard

2. it would require refactoring of all existing string wrapped code

3. it would no longer be compatible with existing string wrapped code

4. a longer name like \foo\translate_lib\_() defeats the point of having
a short function name



Another workaround is to declare a _ forwarding function in every
possible namespace, but that solution is dumb and ugly.



As a temporary workaround I might declare something like t\s() but I
don't like that solution and it doesn't solve 1, 2 and 3 above.

Test script:
---
/** EITHER A: */

undeclare_function("_");



/** OR B: */

unload_extension("gettext");



/** OR C: */

namespace foo;

use foo\translate_lib;



/** Test: */



// My gettext implementation.

function _($msgid) {

   return translate($msgid);

}



echo _("hello");

Expected result:

bonjour

Actual result:
--
Fatal error: Cannot redeclare _()






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


Req #53957 [Opn->Wfx]: Unloading Extentions OR Overriding Native Functions OR Importing Functions

2011-02-08 Thread rasmus
Edit report at http://bugs.php.net/bug.php?id=53957&edit=1

 ID: 53957
 Updated by: ras...@php.net
 Reported by:landeholm at gmail dot com
 Summary:Unloading Extentions OR Overriding Native Functions
 OR Importing Functions
-Status: Open
+Status: Wont fix
 Type:   Feature/Change Request
 Package:Scripting Engine problem
 Operating System:   Irrelevant
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

extension unloading on a per-request basis simply isn't feasible from a


performance point of view.  And you obviously can't unload and leave it
unloaded 

for the next request because that next request may be for a page that
expects the 

extension to be there.


Previous Comments:

[2011-02-08 11:27:16] landeholm at gmail dot com

Description:

I'm building a framework which has a custom gettext implementation since
the gettext extension of PHP is poorly designed for my needs and it's
not installed in all environments so relying on it reduces
compatibility. The problem however is that it's installed in some
environments and since it claims the global "_" function which is pretty
much a gettext standard alias (and other gettext functions), it's
preventing me from implementing the gettext standard. There are no
possible way for me to solve this problem nicely today because PHP does
not have the ability to either:



A. Override/undeclare/rename native functions. (Okay, I can do it via
APD but that makes extension dependability even WORSE.)

B. Unloading extensions at runtime. (Most preferable... I don't want it
at all)

C. Importing functions. (My framework uses namespaces. The fact that
functions cannot be imported by the "use" keyword really spoils this
feature. Otherwise it could actually have fix this problem.)



Note that this problem assumes a context where you can't control the
environment in which you install your application in. This is a very
real scenario for a lot of people including me. This is a practical
problem, not a theoretical one.



Also note that declaring the "_" function in a namespace would be
pointless:

1. it would no longer be compatible with the gettext standard

2. it would require refactoring of all existing string wrapped code

3. it would no longer be compatible with existing string wrapped code

4. a longer name like \foo\translate_lib\_() defeats the point of having
a short function name



Another workaround is to declare a _ forwarding function in every
possible namespace, but that solution is dumb and ugly.



As a temporary workaround I might declare something like t\s() but I
don't like that solution and it doesn't solve 1, 2 and 3 above.

Test script:
---
/** EITHER A: */

undeclare_function("_");



/** OR B: */

unload_extension("gettext");



/** OR C: */

namespace foo;

use foo\translate_lib;



/** Test: */



// My gettext implementation.

function _($msgid) {

   return translate($msgid);

}



echo _("hello");

Expected result:

bonjour

Actual result:
--
Fatal error: Cannot redeclare _()






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


[PHP-BUG] Req #53957 [NEW]: Unloading Extentions OR Overriding Native Functions OR Importing Functions

2011-02-08 Thread landeholm at gmail dot com
From: 
Operating system: Irrelevant
PHP version:  5.3.5
Package:  Scripting Engine problem
Bug Type: Feature/Change Request
Bug description:Unloading Extentions OR Overriding Native Functions OR 
Importing Functions

Description:

I'm building a framework which has a custom gettext implementation since
the gettext extension of PHP is poorly designed for my needs and it's not
installed in all environments so relying on it reduces compatibility. The
problem however is that it's installed in some environments and since it
claims the global "_" function which is pretty much a gettext standard
alias (and other gettext functions), it's preventing me from implementing
the gettext standard. There are no possible way for me to solve this
problem nicely today because PHP does not have the ability to either:



A. Override/undeclare/rename native functions. (Okay, I can do it via APD
but that makes extension dependability even WORSE.)

B. Unloading extensions at runtime. (Most preferable... I don't want it at
all)

C. Importing functions. (My framework uses namespaces. The fact that
functions cannot be imported by the "use" keyword really spoils this
feature. Otherwise it could actually have fix this problem.)



Note that this problem assumes a context where you can't control the
environment in which you install your application in. This is a very real
scenario for a lot of people including me. This is a practical problem, not
a theoretical one.



Also note that declaring the "_" function in a namespace would be
pointless:

1. it would no longer be compatible with the gettext standard

2. it would require refactoring of all existing string wrapped code

3. it would no longer be compatible with existing string wrapped code

4. a longer name like \foo\translate_lib\_() defeats the point of having a
short function name



Another workaround is to declare a _ forwarding function in every possible
namespace, but that solution is dumb and ugly.



As a temporary workaround I might declare something like t\s() but I don't
like that solution and it doesn't solve 1, 2 and 3 above.

Test script:
---
/** EITHER A: */

undeclare_function("_");



/** OR B: */

unload_extension("gettext");



/** OR C: */

namespace foo;

use foo\translate_lib;



/** Test: */



// My gettext implementation.

function _($msgid) {

   return translate($msgid);

}



echo _("hello");

Expected result:

bonjour

Actual result:
--
Fatal error: Cannot redeclare _()

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



Bug #53939 [Opn->Csd]: [intl] IntlDateFormatter::format fails to escape M in "'y-'M"

2011-02-08 Thread igor at wiedler dot ch
Edit report at http://bugs.php.net/bug.php?id=53939&edit=1

 ID: 53939
 User updated by:igor at wiedler dot ch
 Reported by:igor at wiedler dot ch
 Summary:[intl] IntlDateFormatter::format fails to escape M
 in "'y-'M"
-Status: Open
+Status: Closed
 Type:   Bug
 Package:*Languages/Translation
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Invalid, closing.


Previous Comments:

[2011-02-08 11:18:50] igor at wiedler dot ch

I discovered this in the ICU documentation:



> Any characters in the pattern that are not in the ranges of ['a'..'z']
and 

['A'..'Z'] will be treated as quoted text. For instance, characters like
':', 

'.', ' ', '#' and '@' will appear in the resulting time text even they
are not 

enclosed within single quotes.The single quote is used to 'escape'
letters. Two 

single quotes in a row, whether inside or outside a quoted sequence,
represent a 

'real' single quote.



Example:



> .MM.dd G 'at' HH:mm:ss zzz

> 1996.07.10 AD at 15:08:56 PDT



http://userguide.icu-project.org/formatparse/datetime



So the escaping is always between two quote characters, and not an
escape 

character before each escaped character (like with date).



Thus, this report is invalid and may be closed.


[2011-02-06 18:02:45] igor at wiedler dot ch

Oops, the last expected is of course:



string(1) "n-M"


[2011-02-06 17:52:33] igor at wiedler dot ch

Perhaps also worth noting:



Script:



$fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, 

IntlDateFormatter::FULL,

'UTC', IntlDateFormatter::GREGORIAN  ,"WTF 'y-'M");

var_dump($fmt->format(0));



$fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, 

IntlDateFormatter::FULL,

'UTC', IntlDateFormatter::GREGORIAN  ,"n-'M");

var_dump($fmt->format(0));





Actual:



string(1) "0"

string(1) "-"





Expected:



string(1) "0T1 1970-1"

string(1) "n-1"


[2011-02-06 17:42:28] igor at wiedler dot ch

Description:

When calling IntlDateFormatter::format with the format "'y-'M-'d", it
fails to 

escape the M properly. ' is the escape character of ICU's dateformat.

Test script:
---
format(0));



$fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL,
IntlDateFormatter::FULL,

'UTC', IntlDateFormatter::GREGORIAN  ,"'M");

var_dump($fmt->format(0));



$fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL,
IntlDateFormatter::FULL,

'UTC', IntlDateFormatter::GREGORIAN  ,"'y-'M");

var_dump($fmt->format(0));

Expected result:

string(1) "1"

string(1) "M"

string(3) "y-M"

Actual result:
--
string(1) "1"

string(1) "M"

string(3) "y-1"






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


Bug #53939 [Com]: [intl] IntlDateFormatter::format fails to escape M in "'y-'M"

2011-02-08 Thread igor at wiedler dot ch
Edit report at http://bugs.php.net/bug.php?id=53939&edit=1

 ID: 53939
 Comment by: igor at wiedler dot ch
 Reported by:igor at wiedler dot ch
 Summary:[intl] IntlDateFormatter::format fails to escape M
 in "'y-'M"
 Status: Open
 Type:   Bug
 Package:*Languages/Translation
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

I discovered this in the ICU documentation:



> Any characters in the pattern that are not in the ranges of ['a'..'z']
and 

['A'..'Z'] will be treated as quoted text. For instance, characters like
':', 

'.', ' ', '#' and '@' will appear in the resulting time text even they
are not 

enclosed within single quotes.The single quote is used to 'escape'
letters. Two 

single quotes in a row, whether inside or outside a quoted sequence,
represent a 

'real' single quote.



Example:



> .MM.dd G 'at' HH:mm:ss zzz

> 1996.07.10 AD at 15:08:56 PDT



http://userguide.icu-project.org/formatparse/datetime



So the escaping is always between two quote characters, and not an
escape 

character before each escaped character (like with date).



Thus, this report is invalid and may be closed.


Previous Comments:

[2011-02-06 18:02:45] igor at wiedler dot ch

Oops, the last expected is of course:



string(1) "n-M"


[2011-02-06 17:52:33] igor at wiedler dot ch

Perhaps also worth noting:



Script:



$fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, 

IntlDateFormatter::FULL,

'UTC', IntlDateFormatter::GREGORIAN  ,"WTF 'y-'M");

var_dump($fmt->format(0));



$fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL, 

IntlDateFormatter::FULL,

'UTC', IntlDateFormatter::GREGORIAN  ,"n-'M");

var_dump($fmt->format(0));





Actual:



string(1) "0"

string(1) "-"





Expected:



string(1) "0T1 1970-1"

string(1) "n-1"


[2011-02-06 17:42:28] igor at wiedler dot ch

Description:

When calling IntlDateFormatter::format with the format "'y-'M-'d", it
fails to 

escape the M properly. ' is the escape character of ICU's dateformat.

Test script:
---
format(0));



$fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL,
IntlDateFormatter::FULL,

'UTC', IntlDateFormatter::GREGORIAN  ,"'M");

var_dump($fmt->format(0));



$fmt = new IntlDateFormatter('en' ,IntlDateFormatter::FULL,
IntlDateFormatter::FULL,

'UTC', IntlDateFormatter::GREGORIAN  ,"'y-'M");

var_dump($fmt->format(0));

Expected result:

string(1) "1"

string(1) "M"

string(3) "y-M"

Actual result:
--
string(1) "1"

string(1) "M"

string(3) "y-1"






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


Bug #53956 [Opn->Bgs]: Zero Width Space is not replaced by ordinary space

2011-02-08 Thread aharvey
Edit report at http://bugs.php.net/bug.php?id=53956&edit=1

 ID: 53956
 Updated by: ahar...@php.net
 Reported by:skyboy at mail dot ru
 Summary:Zero Width Space is not replaced by ordinary space
-Status: Open
+Status: Bogus
 Type:   Bug
 Package:PCRE related
 Operating System:   Ubuntu 10.10
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Your arguments to preg_replace are swapped, ie:



preg_replace('#\s+#', $str, '-');



should be:



preg_replace('#\s+#', '-', $str);



Also note that Unicode zero width spaces aren't included in \s, but

you can match them directly with the u modifier (replace <200b> with

an actual zero width space character):



preg_replace('#<200b>+#u', '-', $str);



Not a bug: closing.


Previous Comments:

[2011-02-08 10:45:51] skyboy at mail dot ru

Description:

Group of zero width spaces is succesfully replaced by any character but
ordinary space.

Test script:
---
$str = "​​‎​​‎​​‎"; // 27 zero width spaces with
unicode code of u200B 

var_dump($str);

var_dump(preg_replace('#\s+#', $str, '-'));

var_dump(preg_replace('#\s+#', $str, ' '));

Expected result:

string(27) "​​‎​​‎​​‎" string(1) "-" string(1)
"​​‎​​‎​​‎-" 

Actual result:
--
string(27) "​​‎​​‎​​‎" string(1) "-" string(27)
"​​‎​​‎​​‎" 








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


[PHP-BUG] Bug #53956 [NEW]: Zero Width Space is not replaced by ordinary space

2011-02-08 Thread skyboy at mail dot ru
From: 
Operating system: Ubuntu 10.10
PHP version:  5.3.5
Package:  PCRE related
Bug Type: Bug
Bug description:Zero Width Space is not replaced by ordinary space

Description:

Group of zero width spaces is succesfully replaced by any character but
ordinary space.

Test script:
---
$str = "​​‎​​‎​​‎"; // 27 zero width spaces with unicode
code of u200B 

var_dump($str);

var_dump(preg_replace('#\s+#', $str, '-'));

var_dump(preg_replace('#\s+#', $str, ' '));

Expected result:

string(27) "​​‎​​‎​​‎" string(1) "-" string(1)
"​​‎​​‎​​‎-" 

Actual result:
--
string(27) "​​‎​​‎​​‎" string(1) "-" string(27)
"​​‎​​‎​​‎" 



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



Bug #37675 [Com]: OOP -> Maximum function nesting error

2011-02-08 Thread nishith_saraswat at worldkonex dot com
Edit report at http://bugs.php.net/bug.php?id=37675&edit=1

 ID: 37675
 Comment by: nishith_saraswat at worldkonex dot com
 Reported by:thomas at ecommerce dot com
 Summary:OOP -> Maximum function nesting error
 Status: Bogus
 Type:   Bug
 Package:Unknown/Other Function
 Operating System:   SuSE Linux 10,0
 PHP Version:5.1.4
 Block user comment: N
 Private report: N

 New Comment:

Just turn off your zend engine. You will not get this error and the code
will run fine. 



To turn Off zend engine go to php.ini file find the line: (in this line
the path may be different according to your installation.)

zend_extension =
"c:/wamp/bin/php/php5.3.5/zend_ext/php_xdebug-2.1.0-5.3-vc6.dll"



Then put a semicolon in front off the line to comment it. so now your
line will look like.





;zend_extension =
"c:/wamp/bin/php/php5.3.5/zend_ext/php_xdebug-2.1.0-5.3-vc6.dll"



This is a limit in zend engine disabling it allows you to run the code
perfectly.


Previous Comments:

[2010-03-03 10:18:27] boukeversteegh at gmail dot com

This arbitrary limit is set by xDebug. If you disable it you will find
out that PHP aborts when the stack is exhausted ("Segmentation fault"),
rather than after 100 function calls.



I reply to this old thread because I couldn't find this simple sollution
anywhere on the internets. Hopefully it helps someone.


[2006-06-02 11:00:48] der...@php.net

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

$this doesn\'t move to the static scope after calling it...


[2006-06-02 11:00:10] thomas at ecommerce dot com

You didn't test it at all. I have xDebug installed, yea, but also
without acitvated any special modul/extension i get:



 php test.php



Fatal error: Allowed memory size of 62914560 bytes exhausted (tried to
allocate 12 bytes) in /home/Thomas/test.php on line 10



because of endless loop


[2006-06-02 10:55:30] tony2...@php.net

Do not file bugs when you have Zend extensions (zend_extension=)
loaded. Examples are Zend Optimizer, Zend Debugger, Turck MM Cache,
APC, Xdebug and ionCube loader.  These extensions often modify engine
behavior which is not related to PHP itself.

There is no such error message in PHP itself.


[2006-06-02 10:46:40] thomas at ecommerce dot com

Description:

PHP 5.1.4 seams like running an endless loop here with this code. When
running the bottom code, i get following error message:



Fatal error: Maximum function nesting level of '100' reached, aborting!
in /home/Thomas/test.php on line 11



Its not possibe, that this cause an endless loop. $this is setted, when
created with 'new', so checkthis() should only be called 2 times.

Reproduce code:
---
anyVar)) {

$obj = new Test1();

return $obj->checkThis($var);

}



echo "$var\n";

}

}



$return = Test1::checkThis("Works!");



var_dump($return);

Expected result:

Output of script should be:



Works!

NULL

Actual result:
--
Fatal error: Maximum function nesting level of '100' reached, aborting!
in /home/Thomas/test.php on line 11






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


Bug #53955 [Opn->Fbk]: preg_match_all missing results

2011-02-08 Thread rasmus
Edit report at http://bugs.php.net/bug.php?id=53955&edit=1

 ID: 53955
 Updated by: ras...@php.net
 Reported by:rick at lavoo dot com
 Summary:preg_match_all missing results
-Status: Open
+Status: Feedback
 Type:   Bug
 Package:*Regular Expressions
 Operating System:   FreeBSD 7.2-RELEASE
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Without a test script we can actually run, we have no way of checking if
this is 

actually a bug.



Simplify the script down to a smaller set of documents, embed them in a
standalone 

script that we can download somewhere, and we can have a look.


Previous Comments:

[2011-02-08 09:06:08] rick at lavoo dot com

Description:

phpinfo(); http://corgfx.com/info.php



preg_match_all is missing valid results while running in a loop of
documents. There are 12 valid matches per document, but starting from
document 5 only 11 results are returned. When the script is run "only"
on document 5 or 6 or 7 etc, all 12 results are returned properly.



The script returns no warnings or errors when running in the loop and
missing the 12th result.

Test script:
---
This is an example of the code being used:



for ($i = 0; $i <= $pages; $i++) {

shell_exec(" /usr/local/bin/curl -o /tmp/coffee_process_ajax.tmp
-b PHPSESSID=$cookie -d \"category_id=$cat&page_index=$i\"
http://www..com/html/results_ajax.php";);

$filename = "/tmp/coffee_process_ajax.tmp";

$handle = fopen($filename, "r");

$adata = fread($handle, filesize($filename));

fclose($handle);

preg_match_all("/(.*?)<\/table>/",
str_replace("\n","",$adata), $ajarray);

$saveThis[]=$ajarray[0];

}

Expected result:

The expected result is all 12 results to be returned with and without
the loop.

Actual result:
--
Returns only 11 results starting at $page=4 (the 5th document) while
running in the loop. Returns all 12 results for $page=4 when not running
in the loop.






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