Bug #60624 [Com]: Incorrect Invalid variable used for bind error
Edit report at https://bugs.php.net/bug.php?id=60624&edit=1 ID: 60624 Comment by: 935c at itsynergy dot co dot uk Reported by:935c at itsynergy dot co dot uk Summary:Incorrect Invalid variable used for bind error Status: Open Type: Bug Package:OCI8 related Operating System: Scientific Linux 6.1 PHP Version:Irrelevant Block user comment: N Private report: N New Comment: OCI8 Supportenabled Version 1.4.6 Revision$Revision: 313688 $ Active Persistent Connections 0 Active Connections 0 Oracle Run-time Client Library Version 11.2.0.2.0 Oracle Version 11.2 Compile-time ORACLE_HOME/u01/app/oracle/product/11.2.0/xe Libraries Used -Wl,-rpath,/u01/app/oracle/product/11.2.0/xe/lib - L/u01/app/oracle/product/11.2.0/xe/lib -lclntsh Temporary Lob support enabled Collections support enabled Directive Local Value Master Value oci8.connection_class no valueno value oci8.default_prefetch 100 100 oci8.events Off Off oci8.max_persistent -1 -1 oci8.old_oci_close_semanticsOff Off oci8.persistent_timeout -1 -1 oci8.ping_interval 60 60 oci8.privileged_connect Off Off oci8.statement_cache_size 20 20 Previous Comments: [2011-12-29 11:35:30] 935c at itsynergy dot co dot uk Description: I am seeing the following errors generated for no apparent reason when a function is used as a string source: PHP Warning: oci_bind_by_name(): Invalid variable used for bind PHP Warning: oci_execute(): ORA-01008: not all variables bound If I replace the $sim_token parameter in my FS_ORA_NEW_SIMTOKEN call with a static string, e.g. "2", then it all works fine. Test script: --- -- The OCI8 Call -- function FS_ORA_NEW_SIMTOKEN($p_sess,$p_tkn) { $c = FS_ORA_CONNECT(); $s = oci_parse($c, "begin fs_pkg_X.new_auth(:p_sess,:p_sim);end;"); oci_bind_by_name($s,":p_sess",$p_sess,-1,SQLT_CHR); oci_bind_by_name($s,":p_sim",$p_tkn,-1,SQLT_CHR); $exec_status=oci_execute($s); oci_free_statement($s); return $exec_status; } -- The Token Generator-- function FS_SIMAPI_GETTOKEN() { $valid_time=time()+FS_SIM_TOKLEN; $sesskey=htmlspecialchars(sha1(X)); $qry_array=array( 'mode' => 'AUTH', 'user' => FS_SIM_UNA, 'clientip'=>FS_SIM_SRCIP, 'expiry' => $valid_time, 'key' => $sesskey ); $tokres=FS_SIMAPI_SIMPLEPOST("XXX AUTH",$qry_array); if ($tokres==false) { return false; } libxml_use_internal_errors(true); try { $xmlp=new SimpleXMLElement($tokres); } catch (Exception $e) { foreach(libxml_get_errors() as $error_line) { $error_msg = "SimpleXML: ".$error_line->message; FS_APPTOOL_LOGERR($error_msg); } return false; } return $xmlp->results->token; } -- The Application Call-- // 4 XX Token $sim_token=FS_SIMAPI_GETTOKEN(); if($sim_token!=false) { $sim_to_db=FS_ORA_NEW_SIMTOKEN($_COOKIE['fs_cookie'],$sim_token); if($sim_to_db==false) { header("Location: " . FS_APP_HOME_URI . "?autherr=" . urlencode(FS_ERR_SIMFAIL)); exit; } } else { header("Location: " . FS_APP_HOME_URI . "?autherr=" . urlencode($sim_token)); exit; } -- Edit this bug report at https://bugs.php.net/bug.php?id=60624&edit=1
[PHP-BUG] Req #60625 [NEW]: Emit notice for NOP statement
From: Operating system: N/A PHP version: Irrelevant Package: Scripting Engine problem Bug Type: Feature/Change Request Bug description:Emit notice for NOP statement Description: As a matter of convenience for PHP programmers, would it be possible to somehow detect NOP-type statements (see example below) and create a new notice to notify the programmer of their presence? When writing embedded code, NOP statements are often handy (or even required). However, in something as high-level as PHP, I can't see any situation where one would need such statements. Thus, whenever they DO occur it's most likely by accident (again see example below). Test script: --- Expected result: Notice: Statement has no effect in (path) on line 3 Notice: Statement has no effect in (path) on line 4 Notice: Statement has no effect in (path) on line 5 -- Edit bug report at https://bugs.php.net/bug.php?id=60625&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60625&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60625&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60625&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60625&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60625&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60625&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60625&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60625&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60625&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60625&r=support Expected behavior: https://bugs.php.net/fix.php?id=60625&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60625&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60625&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60625&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60625&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=60625&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60625&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60625&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60625&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60625&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60625&r=mysqlcfg
[PHP-BUG] Bug #60624 [NEW]: Incorrect Invalid variable used for bind error
From: Operating system: Scientific Linux 6.1 PHP version: Irrelevant Package: OCI8 related Bug Type: Bug Bug description:Incorrect Invalid variable used for bind error Description: I am seeing the following errors generated for no apparent reason when a function is used as a string source: PHP Warning: oci_bind_by_name(): Invalid variable used for bind PHP Warning: oci_execute(): ORA-01008: not all variables bound If I replace the $sim_token parameter in my FS_ORA_NEW_SIMTOKEN call with a static string, e.g. "2", then it all works fine. Test script: --- -- The OCI8 Call -- function FS_ORA_NEW_SIMTOKEN($p_sess,$p_tkn) { $c = FS_ORA_CONNECT(); $s = oci_parse($c, "begin fs_pkg_X.new_auth(:p_sess,:p_sim);end;"); oci_bind_by_name($s,":p_sess",$p_sess,-1,SQLT_CHR); oci_bind_by_name($s,":p_sim",$p_tkn,-1,SQLT_CHR); $exec_status=oci_execute($s); oci_free_statement($s); return $exec_status; } -- The Token Generator-- function FS_SIMAPI_GETTOKEN() { $valid_time=time()+FS_SIM_TOKLEN; $sesskey=htmlspecialchars(sha1(X)); $qry_array=array( 'mode' => 'AUTH', 'user' => FS_SIM_UNA, 'clientip'=>FS_SIM_SRCIP, 'expiry' => $valid_time, 'key' => $sesskey ); $tokres=FS_SIMAPI_SIMPLEPOST("XXX AUTH",$qry_array); if ($tokres==false) { return false; } libxml_use_internal_errors(true); try { $xmlp=new SimpleXMLElement($tokres); } catch (Exception $e) { foreach(libxml_get_errors() as $error_line) { $error_msg = "SimpleXML: ".$error_line->message; FS_APPTOOL_LOGERR($error_msg); } return false; } return $xmlp->results->token; } -- The Application Call-- // 4 XX Token $sim_token=FS_SIMAPI_GETTOKEN(); if($sim_token!=false) { $sim_to_db=FS_ORA_NEW_SIMTOKEN($_COOKIE['fs_cookie'],$sim_token); if($sim_to_db==false) { header("Location: " . FS_APP_HOME_URI . "?autherr=" . urlencode(FS_ERR_SIMFAIL)); exit; } } else { header("Location: " . FS_APP_HOME_URI . "?autherr=" . urlencode($sim_token)); exit; } -- Edit bug report at https://bugs.php.net/bug.php?id=60624&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60624&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60624&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60624&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60624&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60624&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60624&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60624&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60624&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60624&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60624&r=support Expected behavior: https://bugs.php.net/fix.php?id=60624&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60624&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60624&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60624&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60624&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=60624&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60624&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60624&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60624&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60624&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60624&r=mysqlcfg
Bug #52558 [Com]: multi curl fails to return response, where curl does.
Edit report at https://bugs.php.net/bug.php?id=52558&edit=1 ID: 52558 Comment by: jonathan dot bokobza at gmail dot com Reported by:malaimo at sesda2 dot com Summary:multi curl fails to return response, where curl does. Status: Open Type: Bug Package:cURL related Operating System: linux 2.6.32-24 libcurl 7.21.0 PHP Version:5.3.3 Block user comment: N Private report: N New Comment: same issue on windows 7 x64 with php 5.3.8 i think this might be related to curl version (7.22) according to : http://curl.haxx.se/changes.html#7_23_1 a new version was released with multiples bugs fixes Previous Comments: [2011-03-25 07:06:21] will at willolbrys dot com I think I encountered the same bug here: http://stackoverflow.com/questions/4780741/php-curl-multi-getcontent-partial-body-received/5429110#5429110 reprinted for simplicity: I encountered this bug while using the rolling-curl multicurl lib, but the underlying problem seems to be in php itself. Here's my php -v: PHP 5.3.3-1ubuntu9.3 with Suhosin-Patch (cli) (built: Jan 12 2011 16:07:38) Copyright (c) 1997-2009 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies Under some circumstances (in my case CURLOPT_TIMEOUT was being maxed) curl_error and curl_errno would not properly report an error in the curl. I had to use the 'result' key from the array returned by curl_multi_info_read. That result code gave me the actual error number when the curl_err* functions reported everything as normal. [2010-08-06 15:09:19] malaimo at sesda2 dot com Description: When using both curl and multi_curl i get a curl_errno of 0 for each handle while an curl_error results a string error. When using multi_curl the error string is: Failed connect to ftp.nmh.ac.uk:21; Operation now in progress When using curl the error string is: couldn't connect to host Using multi_curl results in a null body returned with curl_multi_getcontent Using curl yields the data of the file when using curl_exec Test script: --- two scripts are below to reproduce. # multi_curl method ftp://ftp.nmh.ac.uk/wdc/obsdata/hourval/single_year/1914/sod1914.wdc', 'http://spc.igpp.ucla.edu/uclamag/ffi/lal/B99300_LAL.ffd', 'ftp://ftp.nmh.ac.uk/wdc/obsdata/hourval/single_year/1922/hua1922.wdc', 'http://vmo.igpp.ucla.edu/data1/Weygand/ProcessedSolarWindGSE/ACE/mag/2000/acemag21.dat' ); foreach ($dlFiles as $x => $file) { $curls[$x] = curl_init(); curl_setopt($curls[$x], CURLOPT_URL, $file); curl_setopt($curls[$x], CURLOPT_RETURNTRANSFER, 1); curl_setopt($curls[$x], CURLOPT_FOLLOWLOCATION, 1); curl_multi_add_handle($cmh, $curls[$x]); } $active = null; do { $mrc = curl_multi_exec($cmh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); while ($active && $mrc == CURLM_OK) { if (curl_multi_select($cmh) != -1) { do { $mrc = curl_multi_exec($cmh, $active); } while ($mrc == CURLM_CALL_MULTI_PERFORM); } } foreach ($dlFiles as $x => $file) { var_dump(substr(curl_multi_getcontent($curls[$x]), 0, 10), curl_errno($curls[$x]), curl_error($curls[$x])); curl_multi_remove_handle($cmh, $curls[$x]); curl_close($curls[$x]); } curl_multi_close($cmh); ?> # curl method ftp://ftp.nmh.ac.uk/wdc/obsdata/hourval/single_year/1914/sod1914.wdc', 'http://spc.igpp.ucla.edu/uclamag/ffi/lal/B99300_LAL.ffd', 'ftp://ftp.nmh.ac.uk/wdc/obsdata/hourval/single_year/1922/hua1922.wdc', 'http://vmo.igpp.ucla.edu/data1/Weygand/ProcessedSolarWindGSE/ACE/mag/2000/acemag21.dat' ); foreach ($dlFiles as $x => $file) { $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $file); curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1); var_dump(substr(curl_exec($ch), 0, 10), curl_errno($ch), curl_error($ch)); curl_close($ch); } ?> Expected result: no errors at all and multi_curl letting me get the contents of the curl. Actual result: -- multi_curl bool(false) int(0) string(61) "Failed connect to ftp.nmh.ac.uk:21; Operation now in progress" string(10) "���� int(0) string(0) "" bool(false) int(0) string(61) "Failed connect to ftp.nmh.ac.uk:21; Operation now in progress" string(10) "01 01 2000" int(0) string(0) "" for curl string(10) "SOD1401X01" int(0) string(24) "couldn't connect to host" string(10) "���� int(0) string(0) "" string(10) "HUA22 1D 1" int(0) string(24) "couldn't connect to host" string(10) "01 01 2000" int(0) string(0) "" -- Edit this bug report at https://bugs.php.net/bug.php?id=52558&edit=1
Req #55815 [Com]: PUT request data should be parsed just like POST
Edit report at https://bugs.php.net/bug.php?id=55815&edit=1 ID: 55815 Comment by: thomas dot mery at gmail dot com Reported by:catch dot dave at gmail dot com Summary:PUT request data should be parsed just like POST Status: Open Type: Feature/Change Request Package:Streams related Operating System: All PHP Version:5.4.0beta1 Block user comment: N Private report: N New Comment: Hi, was wondering if this had been considered thanks Previous Comments: [2011-09-29 16:51:39] catch dot dave at gmail dot com Description: Data that is posted to PHP via the PUT method is not parsed at all and is not available to PHP. This is particularly problematic for data sent encoded as 'multipart/form-data'. Basically, a request sent (with files and/or non-file data) via PUT should be parsed using the same functions used for requests sent via POST. Ideally, $_FILES and *either* $_POST or a new $_PUT superglobals should be populated in PUT requests. The answer is *not* to simply use parse_str() because that does not handle multipart/form-data requests. This is something that would help every RESTful interface that people are trying to do with PHP. There are many people who have these problems and have to implement (usually incomplete and/or buggy) PHP solutions, eg: * Example of someone's wrong and incomplete solution: http://stackoverflow.com/questions/5483851/manually-parse-raw- http-data-with-php * Example of other people having problems: http://drupal.org/node/1270190 I ended up having to write half a page of code just to parse file and normal data out of php://input stream which is not going to be as well tested or as stable as PHP's existing C code that parses the data when using the POST method. This could (possibly) be as simple as changing lines such as: `if(!strcmp(SG(request_info).request_method, "POST"))` to `if(!strcmp(SG(request_info).request_method, "POST") || !strcmp(SG(request_info).request_method, "PUT"))` or even adding a new superglobal called $_PUT (but still re-using $_FILES). Test script: --- The request: #!/bin/sh curl "https://localhost/restful_server/"; -X PUT -F "photo=@my_image.jpg;type=image/jpg" -F "foo=bar" The php code: string(3) "bar" } FILES: array(1) { ["photo"]=> array(5) { ["name"]=> string(6) "my_image.jpg" ["type"]=> string(9) "image/jpg" ["tmp_name"]=> string(26) "/private/var/tmp/my_image.jpg" ["error"]=> int(0) ["size"]=> int(1) } } Actual result: -- POST: array(0) { } PUT: NULL FILES: array(0) { } -- Edit this bug report at https://bugs.php.net/bug.php?id=55815&edit=1
Bug #46463 [Com]: fgetcsv() omits empty fields
Edit report at https://bugs.php.net/bug.php?id=46463&edit=1 ID: 46463 Comment by: php at zeguigui dot com Reported by:php-bugs at christoph-jeschke dot de Summary:fgetcsv() omits empty fields Status: No Feedback Type: Bug Package:Filesystem function related Operating System: GNU/Linux PHP Version:5.2CVS-2008-11-01 Block user comment: N Private report: N New Comment: In fact I have the #55674 bug Previous Comments: [2011-12-29 12:38:06] php at zeguigui dot com I have the same issue using \t as a delimiter and " as an enclosure. php -v PHP 5.3.8-pl0-gentoo (cli) (built: Dec 5 2011 22:34:55) Please not that § is a valid ascii character (\u00A7) [2009-09-27 01:00:02] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". [2009-09-19 19:08:07] sjo...@php.net Thank you for your bug report. Your example uses a strange delimeter. First, it contains multiple characters. Second, it contains non-ASCII characters. The documentation says that the delimeter should be one character. When I try your example, the lines are not split at all, so I can not reproduce the problem. Can you reproduce the problem with an ASCII-delimeter consisting of multiple characters? Can you reproduce the problem with a delimiter which is a single non-ASCII character? Can you still reproduce the problem with the latest PHP version? [2008-11-02 13:53:59] php-bugs at christoph-jeschke dot de # php -v PHP 5.2.7RC3-dev (cli) (built: Nov 2 2008 14:49:46) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologie Returns: array(3) { [0]=> string(7) "line1f1" [1]=> string(7) "line1f2" [2]=> string(7) "line1f3" } array(3) { [0]=> string(7) "line2f1" [1]=> string(7) "line2f2" [2]=> string(7) "line2f3" } array(2) { [0]=> string(7) "line3f1" [1]=> string(7) "line3f3" } The empty field is still omitted. [2008-11-02 09:26:57] php-bugs at christoph-jeschke dot de Description: Since PHP5, fgetcsv() omits empty fields instead returning a empty string as did in PHP4. Reproduce code: --- csv.php === paragraph.csv = line1f1§line1f2§line1f3 line2f1§line2f2§line2f3 line3f1§§line3f3 Expected result: array(3) { [0]=> string(7) "line1f1" [1]=> string(7) "line1f2" [2]=> string(7) "line1f3" } array(3) { [0]=> string(7) "line2f1" [1]=> string(7) "line2f2" [2]=> string(7) "line2f3" } array(3) { [0]=> string(7) "line3f1" [1]=> string(0) "" [2]=> string(7) "line3f3" } Actual result: -- array(3) { [0]=> string(7) "line1f1" [1]=> string(7) "line1f2" [2]=> string(7) "line1f3" } array(3) { [0]=> string(7) "line2f1" [1]=> string(7) "line2f2" [2]=> string(7) "line2f3" } array(2) { [0]=> string(7) "line3f1" [1]=> string(7) "line3f3" } -- Edit this bug report at https://bugs.php.net/bug.php?id=46463&edit=1
Bug #60574 [Opn]: range() returns array of integers when arguments are numeric strings
Edit report at https://bugs.php.net/bug.php?id=60574&edit=1 ID: 60574 User updated by:login dot naitsirch at arcor dot de Reported by:login dot naitsirch at arcor dot de Summary:range() returns array of integers when arguments are numeric strings Status: Open Type: Bug Package:Scripting Engine problem Operating System: Windows 7 PHP Version:5.3.8 Block user comment: N Private report: N New Comment: This is not clear enough, in my opinion. Another question: Why should numeric strings be seen as integers and not as strings? Previous Comments: [2011-12-29 01:16:14] hanskrentel at yahoo dot de This is already documented: 4.1.0 to 4.3.2 In PHP versions 4.1.0 through 4.3.2, range() sees numeric strings as strings and not integers. Instead, they will be used for character sequences. For example, "4242" is treated as "4". [2011-12-20 11:39:15] login dot naitsirch at arcor dot de Description: Hi. I think the 'range()' function should return an array with strings, if the 'start' and 'limit' arguments are numeric strings. Otherwise it should be mentioned in the documentation. Test script: --- string(1) "0" [1]=> string(1) "1" [2]=> string(1) "2" [3]=> string(1) "3" [4]=> string(1) "4" [5]=> string(1) "5" [6]=> string(1) "6" [7]=> string(1) "7" [8]=> string(1) "8" [9]=> string(1) "9" } Actual result: -- array(10) { [0]=> int(0) [1]=> int(1) [2]=> int(2) [3]=> int(3) [4]=> int(4) [5]=> int(5) [6]=> int(6) [7]=> int(7) [8]=> int(8) [9]=> int(9) } -- Edit this bug report at https://bugs.php.net/bug.php?id=60574&edit=1
Bug #60624 [Opn]: Incorrect Invalid variable used for bind error
Edit report at https://bugs.php.net/bug.php?id=60624&edit=1 ID: 60624 User updated by:935c at itsynergy dot co dot uk Reported by:935c at itsynergy dot co dot uk Summary:Incorrect Invalid variable used for bind error Status: Open Type: Bug Package:OCI8 related Operating System: Scientific Linux 6.1 -PHP Version:Irrelevant +PHP Version:5.3.8 Block user comment: N Private report: N New Comment: update php version Previous Comments: [2011-12-29 11:37:52] 935c at itsynergy dot co dot uk OCI8 Supportenabled Version 1.4.6 Revision$Revision: 313688 $ Active Persistent Connections 0 Active Connections 0 Oracle Run-time Client Library Version 11.2.0.2.0 Oracle Version 11.2 Compile-time ORACLE_HOME/u01/app/oracle/product/11.2.0/xe Libraries Used -Wl,-rpath,/u01/app/oracle/product/11.2.0/xe/lib - L/u01/app/oracle/product/11.2.0/xe/lib -lclntsh Temporary Lob support enabled Collections support enabled Directive Local Value Master Value oci8.connection_class no valueno value oci8.default_prefetch 100 100 oci8.events Off Off oci8.max_persistent -1 -1 oci8.old_oci_close_semanticsOff Off oci8.persistent_timeout -1 -1 oci8.ping_interval 60 60 oci8.privileged_connect Off Off oci8.statement_cache_size 20 20 [2011-12-29 11:35:30] 935c at itsynergy dot co dot uk Description: I am seeing the following errors generated for no apparent reason when a function is used as a string source: PHP Warning: oci_bind_by_name(): Invalid variable used for bind PHP Warning: oci_execute(): ORA-01008: not all variables bound If I replace the $sim_token parameter in my FS_ORA_NEW_SIMTOKEN call with a static string, e.g. "2", then it all works fine. Test script: --- -- The OCI8 Call -- function FS_ORA_NEW_SIMTOKEN($p_sess,$p_tkn) { $c = FS_ORA_CONNECT(); $s = oci_parse($c, "begin fs_pkg_X.new_auth(:p_sess,:p_sim);end;"); oci_bind_by_name($s,":p_sess",$p_sess,-1,SQLT_CHR); oci_bind_by_name($s,":p_sim",$p_tkn,-1,SQLT_CHR); $exec_status=oci_execute($s); oci_free_statement($s); return $exec_status; } -- The Token Generator-- function FS_SIMAPI_GETTOKEN() { $valid_time=time()+FS_SIM_TOKLEN; $sesskey=htmlspecialchars(sha1(X)); $qry_array=array( 'mode' => 'AUTH', 'user' => FS_SIM_UNA, 'clientip'=>FS_SIM_SRCIP, 'expiry' => $valid_time, 'key' => $sesskey ); $tokres=FS_SIMAPI_SIMPLEPOST("XXX AUTH",$qry_array); if ($tokres==false) { return false; } libxml_use_internal_errors(true); try { $xmlp=new SimpleXMLElement($tokres); } catch (Exception $e) { foreach(libxml_get_errors() as $error_line) { $error_msg = "SimpleXML: ".$error_line->message; FS_APPTOOL_LOGERR($error_msg); } return false; } return $xmlp->results->token; } -- The Application Call-- // 4 XX Token $sim_token=FS_SIMAPI_GETTOKEN(); if($sim_token!=false) { $sim_to_db=FS_ORA_NEW_SIMTOKEN($_COOKIE['fs_cookie'],$sim_token); if($sim_to_db==false) { header("Location: " . FS_APP_HOME_URI . "?autherr=" . urlencode(FS_ERR_SIMFAIL)); exit; } } else { header("Location: " . FS_APP_HOME_URI . "?autherr=" . urlencode($sim_token)); exit; } -- Edit this bug report at https://bugs.php.net/bug.php?id=60624&edit=1
Bug #46463 [Com]: fgetcsv() omits empty fields
Edit report at https://bugs.php.net/bug.php?id=46463&edit=1 ID: 46463 Comment by: php at zeguigui dot com Reported by:php-bugs at christoph-jeschke dot de Summary:fgetcsv() omits empty fields Status: No Feedback Type: Bug Package:Filesystem function related Operating System: GNU/Linux PHP Version:5.2CVS-2008-11-01 Block user comment: N Private report: N New Comment: I have the same issue using \t as a delimiter and " as an enclosure. php -v PHP 5.3.8-pl0-gentoo (cli) (built: Dec 5 2011 22:34:55) Please not that § is a valid ascii character (\u00A7) Previous Comments: [2009-09-27 01:00:02] php-bugs at lists dot php dot net No feedback was provided for this bug for over a week, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open". [2009-09-19 19:08:07] sjo...@php.net Thank you for your bug report. Your example uses a strange delimeter. First, it contains multiple characters. Second, it contains non-ASCII characters. The documentation says that the delimeter should be one character. When I try your example, the lines are not split at all, so I can not reproduce the problem. Can you reproduce the problem with an ASCII-delimeter consisting of multiple characters? Can you reproduce the problem with a delimiter which is a single non-ASCII character? Can you still reproduce the problem with the latest PHP version? [2008-11-02 13:53:59] php-bugs at christoph-jeschke dot de # php -v PHP 5.2.7RC3-dev (cli) (built: Nov 2 2008 14:49:46) Copyright (c) 1997-2008 The PHP Group Zend Engine v2.2.0, Copyright (c) 1998-2008 Zend Technologie Returns: array(3) { [0]=> string(7) "line1f1" [1]=> string(7) "line1f2" [2]=> string(7) "line1f3" } array(3) { [0]=> string(7) "line2f1" [1]=> string(7) "line2f2" [2]=> string(7) "line2f3" } array(2) { [0]=> string(7) "line3f1" [1]=> string(7) "line3f3" } The empty field is still omitted. [2008-11-02 09:26:57] php-bugs at christoph-jeschke dot de Description: Since PHP5, fgetcsv() omits empty fields instead returning a empty string as did in PHP4. Reproduce code: --- csv.php === paragraph.csv = line1f1§line1f2§line1f3 line2f1§line2f2§line2f3 line3f1§§line3f3 Expected result: array(3) { [0]=> string(7) "line1f1" [1]=> string(7) "line1f2" [2]=> string(7) "line1f3" } array(3) { [0]=> string(7) "line2f1" [1]=> string(7) "line2f2" [2]=> string(7) "line2f3" } array(3) { [0]=> string(7) "line3f1" [1]=> string(0) "" [2]=> string(7) "line3f3" } Actual result: -- array(3) { [0]=> string(7) "line1f1" [1]=> string(7) "line1f2" [2]=> string(7) "line1f3" } array(3) { [0]=> string(7) "line2f1" [1]=> string(7) "line2f2" [2]=> string(7) "line2f3" } array(2) { [0]=> string(7) "line3f1" [1]=> string(7) "line3f3" } -- Edit this bug report at https://bugs.php.net/bug.php?id=46463&edit=1
[PHP-BUG] Bug #60626 [NEW]: filter_var crash
From: Operating system: Win 7 x64 PHP version: 5.4.0RC4 Package: *General Issues Bug Type: Bug Bug description:filter_var crash Description: Crash when a string longer than 225 characters (while containing @) is passed to filter_var Test script: --- filter_var('the-total-len...@of-an-entire-address.cannot-be-longer-than-two-hundred-and-fifty-four-characters.and-this-address-is-254-characters-exactly.so-it-should-be-valid.and-im-going-to-add-some-more-words-here.to-increase-the-lenght-blah-blah-blah-blah-bla.org', FILTER_VALIDATE_EMAIL); Expected result: return the input given Actual result: -- crash -- Edit bug report at https://bugs.php.net/bug.php?id=60626&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=60626&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=60626&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=60626&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=60626&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=60626&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=60626&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=60626&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=60626&r=needscript Try newer version: https://bugs.php.net/fix.php?id=60626&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=60626&r=support Expected behavior: https://bugs.php.net/fix.php?id=60626&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=60626&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=60626&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=60626&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=60626&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=60626&r=dst IIS Stability: https://bugs.php.net/fix.php?id=60626&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=60626&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=60626&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=60626&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=60626&r=mysqlcfg
Req #60485 [Com]: in_array insensitive string comparison
Edit report at https://bugs.php.net/bug.php?id=60485&edit=1 ID: 60485 Comment by: phristen at yahoo dot com Reported by:Hast4656 at gmail dot com Summary:in_array insensitive string comparison Status: Open Type: Feature/Change Request Package:Arrays related Operating System: linux PHP Version:Irrelevant Block user comment: N Private report: N New Comment: How about adding a comparitor callback then? Maybe even overload the third argument (e.g. if it's not a boolean, then assume callback), so we can do something like: in_array('a', array('A', 'b'), function($a, $b) { return !strcasecmp($a, $b); }); Previous Comments: [2011-12-14 18:01:34] ppad...@php.net Since in_array() handles different types, I don't think it would make sense to add a parameter that is exclusive to handling strings. [2011-12-09 16:48:11] Hast4656 at gmail dot com Description: Can you please add parameter for in_array that let this function to compare strings insensitive? Test script: --- // something like in_array('a', Array('a', 'A'), true, true); // 4th bool param says should the function compare string in a case-sensitive manner or not -- Edit this bug report at https://bugs.php.net/bug.php?id=60485&edit=1
Req #60372 [Com]: Context call feature
Edit report at https://bugs.php.net/bug.php?id=60372&edit=1 ID: 60372 Comment by: phristen at yahoo dot com Reported by:ninzya at inbox dot lv Summary:Context call feature Status: Open Type: Feature/Change Request Package:Scripting Engine problem Operating System: Any PHP Version:Irrelevant Block user comment: N Private report: N New Comment: I still hope that PHP will get named parameters one day, and since : is usually used for that, this will create a lot of confusion :) Previous Comments: [2011-11-24 15:06:39] ninzya at inbox dot lv So basically if the feature gets support from the community, I could then prepare an RFC describing the proposal in detail. [2011-11-24 14:59:23] ninzya at inbox dot lv An example on how the proposed syntactic sugar would improve code readability. Before: if( $user->hasPermission( $user::PERM_EDIT, $user->getProfile())) { // has access to edit own profile } After: if( $user->hasPermission( :PERM_EDIT, :getProfile())) { // has access to edit own profile } Before: $config->setSettings([ $config::SOME_TTL =>10, $config::SOME_PATH =>"/var/www/...", $config::SOMETHING_OTHER =>0xFF ]); After: $config->setSettings([ :SOME_TTL =>10, :SOME_PATH =>"/var/www/...", :SOMETHING_OTHER =>0xFF ]); Note that use of ":" inside array definition contextually resolves arguments as well. In the last example the ":SOME_TTL" syntax refers to the "SOME_TTL" class constant of $config object (i.e. same as "$config::SOME_TTL") [2011-11-24 14:50:08] ninzya at inbox dot lv Description: I'd like to propose an extension to PHP syntax, that would allow programmer to avoid code duplication in some cases and, therefore, would make PHP code more readable. My idea is to extend dynamic call operator ("->method()") add a "context" syntax to it's arguments. The syntax would mean that the argument's value is located in context of a specific object - the argument is either a property or method. The syntax could be as follows: $obj->area( :$x, :$y); Note the ":" (colon) character in front of argument. The colon means that the argument for the call is a property of object that the invoked method belongs to. In this case both arguments are actually "$obj->x" and "$obj->y" values. Syntax for method calls is as follows: $obj->area( :x(), :y()); In this case both arguments are "$obj->x()" and "$obj->x()". The following more complex example: $obj->area( :mt_rand( 1, :$x), $y); Here mt_rand() is a method of $obj (i.e. "$obj->mt_rand()", because colon character is preceding the function name)) and since ":mt_rand()" is resolved to "$obj->mt_rand()", it's ":$x" argument is resolved to "$obj->x" as well. However, a call like this: mt_rand( :$x); should yield a runtime error because this is not a dynamic call and the argument can not be resolved. Test script: --- class Test { public $x =5; public function y() { return 10; } public function area( $x, $y, $name) { echo $name .': ' .$x .' x ' .$y; } public function makeName( $name) { return '#' .$name; } } $test =new Test; $test->area( :$x, :y(), :makeName( 'test')); Expected result: #test: 5 x 10 Actual result: -- Not implemented yet. -- Edit this bug report at https://bugs.php.net/bug.php?id=60372&edit=1
Req #55853 [Com]: provide an array_diff equivalent for undetermined numbers of array
Edit report at https://bugs.php.net/bug.php?id=55853&edit=1 ID: 55853 Comment by: phristen at yahoo dot com Reported by:netmosfera at gmail dot com Summary:provide an array_diff equivalent for undetermined numbers of array Status: Open Type: Feature/Change Request Package:Arrays related Operating System: irrelevant PHP Version:Irrelevant Block user comment: N Private report: N New Comment: I agree, BUT this is opening a big can of worms because there are plenty other functions that could use the same treatment, like array_merge and the likes. Previous Comments: [2011-10-05 17:32:53] netmosfera at gmail dot com Description: hi if I have an undetermined number of array I can't use array_diff to get the differences a function like: array_diff_array() would be really nice "green", "red", "blue", "red"); $myarrays[] = array("b" => "green", "yellow", "red"); // undetermined number of arrays print_r(array_diff_array($myarrays)); ?> I think that the only way to do this now, is using eval! thank you! -- Edit this bug report at https://bugs.php.net/bug.php?id=55853&edit=1