Bug #65888 [Opn->Fbk]: dst database incorrect for israel
Edit report at https://bugs.php.net/bug.php?id=65888&edit=1 ID: 65888 Updated by: requi...@php.net Reported by:drmosko at hotmail dot com Summary:dst database incorrect for israel -Status: Open +Status: Feedback Type: Bug -Package:*General Issues +Package:Date/time related PHP Version:Irrelevant Block user comment: N Private report: N New Comment: Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with , is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. Such as this, which works for me. Previous Comments: [2013-10-13 05:13:05] drmosko at hotmail dot com Description: dst database incorrect for israel dat(I) = o for israel while dst is ongoin and shoulb be 1 date : 13/10/2013 -- Edit this bug report at https://bugs.php.net/bug.php?id=65888&edit=1
Bug #65787 [Opn->Dup]: DateTime::__construct() accepts all single letters except 'j' as valid timezone
Edit report at https://bugs.php.net/bug.php?id=65787&edit=1 ID: 65787 Updated by: requi...@php.net Reported by:vascowhite at gmail dot com Summary:DateTime::__construct() accepts all single letters except 'j' as valid timezone -Status: Open +Status: Duplicate Type: Bug Package:Date/time related Operating System: All? PHP Version:5.5.4 Block user comment: N Private report: N New Comment: Single letters except "j" correspond to a military timezone. http://en.wikipedia.org/wiki/List_of_military_time_zones (I've marked the other report as a doc bug accordingly.) Previous Comments: [2013-09-29 15:56:59] vascowhite at gmail dot com I just found that this is a duplicate of bug #65747 [2013-09-29 15:13:43] vascowhite at gmail dot com Description: If just a single letter is passed to the constructor of \DateTime it is accepted as a valid timezone string. Except, for some strange reason, the letter 'j'. Test script: --- $date = new \DateTime('a'); var_dump($date); Expected result: I expect an exception to be raised with the message:- Fatal error: Uncaught exception 'Exception' with message 'DateTime::__construct(): Failed to parse time string (a) at position 0 (a): The timezone could not be found in the database' Actual result: -- Except for when the letter 'j' is passed a DateTime object is created. For example the following code:- $date = new \DateTime('a'); var_dump($date); Will give the following output:- object(DateTime)[1] public 'date' => string '2013-09-29 15:17:19' (length=19) public 'timezone_type' => int 2 public 'timezone' => string 'A' (length=1) Where it should raise an exception. -- Edit this bug report at https://bugs.php.net/bug.php?id=65787&edit=1
Bug #65783 [Opn->Fbk]: Layout.php refferal LDAP
Edit report at https://bugs.php.net/bug.php?id=65783&edit=1 ID: 65783 Updated by: requi...@php.net Reported by:mbiama at angosso dot com Summary:Layout.php refferal LDAP -Status: Open +Status: Feedback Type: Bug -Package:Filter related +Package:LDAP related Operating System: ALL PHP Version:5.5.4 Block user comment: N Private report: N New Comment: Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. 1. Barely any description. You have to actually describe the bug. In detail, given that LDAP bugs may be awkward to reproduce. 2. Test script is not valid code and doesn't even look like code to test the bug. 3. Expected result is some strange mix of description and bits of (invalid) code pieced together. 4. Patch is just a list of file hashes. Previous Comments: [2013-09-29 11:30:58] mbiama at angosso dot com Description: $_SERVER array containing information such as headers, paths, and script locations The ldap server use is UK.ZYRO SiteServer Test script: --- $vars.php"; ?> Expected result: LDAP link identifier, returned by ldap_connect(); mixed $newval function main() (!ldap_set_option($ds, LDAP_OPT_SERVER_CONTROLS, array($'_sortfunction', $'_sortfunction2'))) { $array = [ "vars.php/" => "layout.php", "layout.php" => "vars.php/", ]; echo "Failed to set server controls"; Actual result: -- PHP appears to ignore the referral and ldap_error returns a "referral" message -- Edit this bug report at https://bugs.php.net/bug.php?id=65783&edit=1
Req #65772 [Opn]: Implement "default" as a possible function/method argument value in calls
Edit report at https://bugs.php.net/bug.php?id=65772&edit=1 ID: 65772 Updated by: requi...@php.net Reported by:matteo_tassinari_TM at libero dot it Summary:Implement "default" as a possible function/method argument value in calls Status: Open Type: Feature/Change Request Package:Variables related Operating System: Any PHP Version:Irrelevant Block user comment: N Private report: N New Comment: Existing RFC for this exact thing: https://wiki.php.net/rfc/skipparams Previous Comments: [2013-09-27 06:49:33] matteo_tassinari_TM at libero dot it Description: I think it would be useful if we could use the "default" keyword when passing parameters to a method/function so that the value for the parameter for which "default" is passed automatically takes the defined default value, without need of knowing it. Test script: --- For example, consider this: function justToTest($a = 10, $b = 0) { var_dump($a, $b); } justToTest(); justToTest(5); justToTest(default, 5); Expected result: The first call should show int 10 int 0 The second call should show int 5 int 0 The third call should show int 10 int 5 -- Edit this bug report at https://bugs.php.net/bug.php?id=65772&edit=1
Req->Bug #65767 [Opn->Fbk]: Invalid quoted-printable sequence
Edit report at https://bugs.php.net/bug.php?id=65767&edit=1 ID: 65767 Updated by: requi...@php.net Reported by:info at djdb dot be Summary:Invalid quoted-printable sequence -Status: Open +Status: Feedback -Type: Feature/Change Request +Type: Bug -Package:*Mail Related +Package:IMAP related Operating System: win7 PHP Version:5.5.4 Block user comment: N Private report: N New Comment: Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. Need a complete repro script. imap_qprint() requires only a string, not an IMAP server, so you should be able to pare something down. And keep in mind you can't imap_qprint() an entire multipart email. You have to do it to the individual parts (and only the ones that are Quoted-Printable, of course). Previous Comments: [2013-09-26 13:19:09] info at djdb dot be Description: --- >From manual page: http://www.php.net/function.imap-qprint --- Unknown: Invalid quoted-printable sequence: ="_=_swift_v4_136992480651a764c653d74_=_" --_=_swift_v4_136992480651a764c653 (errflg=3) in Unknown on line 0 Test script: --- confediral script can not post read noreplay from mail sended by swift Expected result: I think it has with cote that they use so by norepy wil the message as send comes as plain back so its can maybe also encoding. but i only let you now it that if you want you can do something . -- Edit this bug report at https://bugs.php.net/bug.php?id=65767&edit=1
Bug #65746 [Asn]: session_regenerate_id() do not delete old session data.
Edit report at https://bugs.php.net/bug.php?id=65746&edit=1 ID: 65746 Updated by: requi...@php.net Reported by:yohg...@php.net Summary:session_regenerate_id() do not delete old session data. Status: Assigned Type: Bug Package:Session related PHP Version:5.5Git-2013-09-23 (Git) Assigned To:yohgaki Block user comment: N Private report: N New Comment: It doesn't? bool session_regenerate_id ([ bool $delete_old_session = false ] ) Previous Comments: [2013-09-23 22:41:35] yohg...@php.net Description: session_regenerate_id() do not delete old session data. It should delete old data. -- Edit this bug report at https://bugs.php.net/bug.php?id=65746&edit=1
Bug #65722 [Opn->Dup]: syntax error in configure: -r: command not found
Edit report at https://bugs.php.net/bug.php?id=65722&edit=1 ID: 65722 Updated by: requi...@php.net Reported by:johan dot ekenberg at gmail dot com Summary:syntax error in configure: -r: command not found -Status: Open +Status: Duplicate Type: Bug Package:Compile Failure Operating System: Linux PHP Version:5.4.20 Block user comment: N Private report: N New Comment: #65721 just barely beat you to this :) Previous Comments: [2013-09-20 09:53:39] johan dot ekenberg at gmail dot com Description: This bug also exists in php 5.5.4 configure --with-imap fails with: ./configure: line 51014: -r: command not found checking whether rfc822_output_address_list function present... no checking whether build with IMAP works... no configure: error: build test failed. Please check the config.log for details. Fix: the word "test" is missing after &&, in two places. Like this: if test ! -r "$IMAP_DIR/c-client/libc-client.a" && -r "$IMAP_DIR/c-client/c-client.a" ; then change to: if test ! -r "$IMAP_DIR/c-client/libc-client.a" && test -r "$IMAP_DIR/c-client/c-client.a" ; then Test script: --- ./configure --with-imap Expected result: clean configure Actual result: -- ./configure: line 51014: -r: command not found checking whether rfc822_output_address_list function present... no checking whether build with IMAP works... no configure: error: build test failed. Please check the config.log for details. -- Edit this bug report at https://bugs.php.net/bug.php?id=65722&edit=1
Req #65718 [Opn->Wfx]: __inClone() magic method to alter an object's inclusion in clones
Edit report at https://bugs.php.net/bug.php?id=65718&edit=1 ID: 65718 Updated by: requi...@php.net Reported by:metamarkers at gmail dot com Summary:__inClone() magic method to alter an object's inclusion in clones -Status: Open +Status: Wont fix Type: Feature/Change Request Package:Class/Object related PHP Version:Irrelevant Block user comment: N Private report: N New Comment: That decision should be up to Foo, not up to Bar. If Foo is unaware that it no longer has a $bar member then that could introduce all sorts of unexpected and difficult to trace bugs. Besides, PHP does not do deep copies during cloning anyways. Implement Foo::__clone() such that it would normally clone all its members. Then you can (a) Make it not clone its $bar and instead unset() it (b) Implement a private Bar::__clone() so attempting to clone $bar raises a fatal "Call to private Bar::__clone from context 'Foo'" (c) Implement a public Bar::__clone() and throw an Exception so attempting to clone $bar fails Whichever way, Foo is responsible for knowing that Bar cannot be cloned and should adjust its own behavior accordingly. Previous Comments: [2013-09-20 03:50:39] metamarkers at gmail dot com Description: It would be nice if an object could determine whether or not it should be included in a clone, by returning a value that should be used in its stead, or an updated clone of itself, or anything of the like. Test script: --- class Foo { } class Bar { public function __inClone ( $clone ) { return $clone instanceof Foo ? null : $this; } } $foo = new Foo(); $foo->bar = new Bar(); $foo2 = clone $foo; isset($foo2->bar); // false -- Edit this bug report at https://bugs.php.net/bug.php?id=65718&edit=1
Req #65703 [Opn->Wfx]: Primitives, Strings and Arrays as Objects
Edit report at https://bugs.php.net/bug.php?id=65703&edit=1 ID: 65703 Updated by: requi...@php.net Reported by:worldoffame at hotmail dot com Summary:Primitives, Strings and Arrays as Objects -Status: Open +Status: Wont fix Type: Feature/Change Request Package:Class/Object related Operating System: Irrelevant PHP Version:Irrelevant Block user comment: N Private report: N New Comment: This has been brought up numerous times before with the answer of "not going to happen anytime soon". You can bring this subject up on the internals mailing list but know that requesting such a huge (I don't know if I can stress that enough) change simply because other languages do it that way won't get much of a positive response. http://www.php.net/mailing-lists.php#internals You may also be interested in the autoboxing RFC. https://wiki.php.net/rfc/autoboxing Previous Comments: [2013-09-19 04:02:57] worldoffame at hotmail dot com Description: Well currently in PHP not everything is an object, if you use the object operator -> on an integer variable(like 2->toFloat()) you will get an error. Strings and Arrays are not object either, and these are bigger problems than primitives like integers, floats and booleans. So I propose that in PHP 5.6 everything is an object. The PHP core will provide special classes such as Boolean, Integer, Float, String and Array, all of them have methods for client users to manipulate. For Booleans and Integers, the methods will be quite limited. But for Strings and Arrays, each currently available orphan string/array functions can be made into methods. Below is how you'd play with strings and arrays in PHP 5.5 and 5.6: PHP 5.5: echo strtoupper("this is a string"); $array = sort([2, 5, 1, 4, 6, 3]); PHP 5.6: echo "this is a string"->toUpper(); $array = [2, 5, 1, 4, 6, 3]->sort(); Id say the proposed methods are much more elegant, and thats how Python and Ruby deal with strings and arrays. Also the keyword array will be removed as Array will be used as a class name. In PHP 5.7 and beyond it may be a good point to consider deprecating the traditiona/procedural way of creating primitive types, strings and arrays. -- Edit this bug report at https://bugs.php.net/bug.php?id=65703&edit=1
Bug #65688 [Opn->Fbk]: dir-containing-phpinifile
Edit report at https://bugs.php.net/bug.php?id=65688&edit=1 ID: 65688 Updated by: requi...@php.net Reported by:mbiama at angosso dot com Summary:dir-containing-phpinifile -Status: Open +Status: Feedback Type: Bug Package:Built-in web server Operating System: GNU/LINUX-Apache2 PHP Version:5.4.19 Block user comment: N Private report: N New Comment: Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. Previous Comments: [2013-09-17 10:38:20] mbiama at angosso dot com Description: New report a bug mixed curl_exec ( resource $ch ). Test script: --- // Configure URL and all options curl_setopt($ch, CURLOPT_URL, "http://localhost:48173/vars.php/site/";); curl_setopt($ch, CURLOPT_HEADER, 1); // curl_exec($ch); // Close cURL curl_close($ch); ?> Expected result: // Configure URL and all options curl_setopt($ch, CURLOPT_URL, "http://localhost:48173/vars.php/site/";); curl_setopt($ch, CURLOPT_HEADER, 1); // curl_exec($ch); function curl_post($url, array $post = NULL, array $options = array()) { $defaults = array( CURLOPT_POST => 1, CURLOPT_HEADER => 0, CURLOPT_URL => $url, CURLOPT_FRESH_CONNECT => 1, CURLOPT_RETURNTRANSFER => 1, CURLOPT_FORBID_REUSE => 1, CURLOPT_TIMEOUT => 4, CURLOPT_POSTFIELDS => http_build_query($post) ); $ch = curl_init(); curl_setopt_array($ch, ($options + $http://www.[dotted].com:80/vars.php/site/)); if( ! $result = curl_exec($ch)) { trigger_error(curl_error($ch)); } curl_close($ch); return $result; } // Close cURL curl_close($ch); ?> Actual result: -- backtrace -- Edit this bug report at https://bugs.php.net/bug.php?id=65688&edit=1
Bug #52261 [Opn->Nab]: strtotime() worng result when timezome only.
Edit report at https://bugs.php.net/bug.php?id=52261&edit=1 ID: 52261 Updated by: requi...@php.net Reported by:n-ishii at chiether dot net Summary:strtotime() worng result when timezome only. -Status: Open +Status: Not a bug Type: Bug Package:Date/time related Operating System: Linux PHP Version:5.3.2 Block user comment: N Private report: N New Comment: The only thing I see wrong is the dates in the Expected Result. Like, GMDATE and GMT should be the same time... Previous Comments: [2013-09-17 12:49:11] cmbecker69 at gmx dot de The actual results are absolutely fine, e.g. > UTC: 2010-07-06 02:58:03 > JST: 2010-07-06 11:58:03 (UTC +9) UTC+9 means, add 9 hours to the time expressed as UTC and you get the local time (JST). IMHO this is not a bug. [2010-07-06 07:29:54] n-ishii at chiether dot net sorry mistake posted. -> (timezone:JST) time-value on "2010-07-07 01:58:03 JST" [2010-07-06 07:24:13] n-ishii at chiether dot net or is it design? so example..., EST: 2010-07-05 21:58:03 (-5h) UTC: 2010-07-06 02:58:03 ( 0h) JST: 2010-07-06 11:58:03 (+9h) * local timezone. strtotime("EST"); -> (localdate+EST) "2010-07-06 11:58:03 EST" -> (convert UTC) "2010-07-06 16:58:03 UTC" -> (timezone:JST) time-value on "2010-07-06 01:58:03 JST" [2010-07-06 05:11:40] n-ishii at chiether dot net Description: Time Formats: tz format (JST, UTC, GMT, EST...) has problem. maybe wrong (+/-) Test script: --- [Date] ; Defines the default timezone used by the date functions date.timezone = "Asia/Tokyo" https://bugs.php.net/bug.php?id=52261&edit=1
Bug #65669 [Opn->Nab]: setup fail
Edit report at https://bugs.php.net/bug.php?id=65669&edit=1 ID: 65669 Updated by: requi...@php.net Reported by:pennyzenny at gmail dot com Summary:setup fail -Status: Open +Status: Not a bug Type: Bug Package:MySQL related Operating System: windows 7 PHP Version:5.4.20RC1 Block user comment: N Private report: N New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Try going with WampServer - a bundle of Apache, MySQL, and PHP that should be easier to install and manage. Be sure to remove whatever you've installed first so you don't have two different copies of Apache and PHP. http://www.wampserver.com/en/ As for the PHPMailer error, it's looking for an "MTA" (mail transfer agent, which coordinates sending emails) on your computer but desktop versions of Windows do not have those by default. You can find and install one, or better yet set up PHPMailer to send from your GMail account instead. http://stackoverflow.com/a/9776379 Previous Comments: [2013-09-13 17:46:06] pennyzenny at gmail dot com Description: I have installed apache 2.2, php 5.3.27 and MySQL notifier 1.1.4 and what ever version of MySQL comes with that as it didn't say anywhere what version it is, I guess another bug. php 5.3.27 seems to be the only version for windows binaries. I have used several versions of apache, php and MySQL over the years. I have spent hours trying to get the current 3 to work. apache2.2 works fine. php works fine. every time I add PHPinidir to the httpd.conf file php stops working, why do all the setup guides tell me to do this I have followed endless guides to configure MySQL to work in php but none of them work. I always get... Fatal error: Call to undefined function mysqli_connect() in C:\PROJECT\www\index.php on line 26 same if I try mysql_connect() but I believe that is no longer used. EVERYTIME I SEARCH TO FIND A GUIDE TO SETUP PHP TO USE MYSQL ALL I FIND ARE LINKS TO PAGES AND PAGES OF WAFFLE ABOUT A LOAD OF SHIT AND NO DETAILS HOW TO CONFIURE PHP... SORT IT OUT!!! I downloaded phpmailer5.1 and this is what I get... Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/London' for '1.0/DST' instead in C:\PROJECT\www\class.phpmailer.php on line 1925 Warning: date() [function.date]: It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected 'Europe/London' for '1.0/DST' instead in C:\PROJECT\www\class.phpmailer.php on line 1929 Fatal error: Uncaught exception 'phpmailerException' with message 'SMTP Error: Could not connect to SMTP host.' in C:\PROJECT\www\class.phpmailer.php:820 Stack trace: #0 C:\PROJECT\www\class.phpmailer.php(705): PHPMailer->SmtpConnect() #1 C:\PROJECT\www\class.phpmailer.php(576): PHPMailer->SmtpSend('Date: Fri, 13 S...', 'This is a test ...') #2 C:\PROJECT\www\index.php(23): PHPMailer->Send() #3 {main} thrown in C:\PROJECT\www\class.phpmailer.php on line 820 WHY CANT ANYONE MAKE SOMETHING THAT BLOODY WELL WORKS INSTEAD OF TRYING TO PASS OFF A LOAD OF SHIT AS THE LATEST AND BESTEST VERSION? -- Edit this bug report at https://bugs.php.net/bug.php?id=65669&edit=1
Req #65668 [Opn->Fbk]: WB_CHECK_POSSIBLE_ROOT(wb)
Edit report at https://bugs.php.net/bug.php?id=65668&edit=1 ID: 65668 Updated by: requi...@php.net Reported by:mbiama at angosso dot com Summary:WB_CHECK_POSSIBLE_ROOT(wb) -Status: Open +Status: Feedback Type: Feature/Change Request Package:Built-in web server Operating System: posix_setpgid PHP Version:5.5.3 Block user comment: N Private report: N New Comment: Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. Previous Comments: [2013-09-13 17:35:14] mbiama at angosso dot com Description: Assess the situation and use Security as bug type in the form below: Head site générator. function keepAlive() { var myAjax = new Request({method: "get", urls: "index.php";"./index2.php";"./index3.php/"}).send();} window.addEvent("domready", function(){ keepAlive.periodical(EvPeriodic::__construct); }); Test script: --- body { background: #656e15 none repeat-x scroll center top; } .wb_sbg { background: transparent url("gallery/299522281f72bdd23dad7b5afbeaee4d.jpg") repeat-x scroll left top; } .wb-stl-pagetitle { font: normal normal 22px Trebuchet MS,sans-serif; text-align: left; text-decoration: none; color: #858585; line-height: 23px; margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; } .wb-stl-pagetitle a { font: normal normal 22px Trebuchet MS,sans-serif; text-align: left; text-decoration: none; color: #00; line-height: 23px; font-weight: normal; font-style: normal; } .wb-stl-pagetitle a:hover { font: normal normal 22px Trebuchet MS,sans-serif; text-align: left; text-decoration: none; color: #00; line-height: 23px; font-weight: normal; font-style: normal; } .wb-stl-pagetitle ul { list-style-image: url('null'); } .wb-stl-subtitle { font: normal bold 50px Trebuchet MS,sans-serif; text-align: left; text-decoration: none; color: #ff8533; line-height: 50px; margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; } .wb-stl-subtitle a { font: normal bold 50px Trebuchet MS,sans-serif; text-align: left; text-decoration: none; color: #00; line-height: 50px; font-weight: normal; font-style: normal; } .wb-stl-subtitle a:hover { font: normal bold 50px Trebuchet MS,sans-serif; text-align: left; text-decoration: none; color: #00; line-height: 50px; font-weight: normal; font-style: normal; } .wb-stl-subtitle ul { list-style-image: url('null'); } .wb-stl-heading1 { font: normal normal 24px Trebuchet MS,sans-serif; text-align: left; text-decoration: none; color: #ff8533; line-height: 24px; margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; } .wb-stl-heading1 a { font: normal normal 24px Trebuchet MS,sans-serif; text-align: left; text-decoration: none; color: #00; line-height: 24px; font-weight: normal; font-style: normal; } .wb-stl-heading1 a:hover { font: normal normal 24px Trebuchet MS,sans-serif; text-align: left; text-decoration: none; color: #00; line-height: 24px; font-weight: normal; font-style: normal; } .wb-stl-heading1 ul { list-style-image: url('null'); } .wb-stl-heading2 { font: normal normal 20px Trebuchet MS,sans-serif; text-align: left; text-decoration: none; color: #ff8533; line-height: normal; margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; } .wb-stl-heading2 a { font: normal normal 20px Trebuchet MS,sans-serif; text-align: left; text-decoration: none; color: #00; line-height: normal; font-weight: normal; font-style: normal; } .wb-stl-heading2 a:hover { font: normal normal 20px Trebuchet MS,sans-serif; text-align: left; text-decoration: none; color: #00; line-height: normal; font-weight: normal; font-style: normal; } .wb-stl-heading2 ul { list-style-image: url('null'); } .wb-stl-heading3 { font: normal normal 18px Trebuchet MS,sans-serif; text-align: left; text-decoration: none; color: #ff; line-height: normal; margin: 0px 0px 0px 0px; padding: 0px 0px 0px 0px; } .wb-stl-heading3 a { font: normal normal 18px Trebuchet MS,sans-serif; text-align: left; text-decoration: none; color: #00; line-height: normal; font-weight: normal; font-style: normal; } .wb-stl-heading3 a:hover { font: normal normal 18px Trebuchet MS,sans-serif; text-align: left; text-decoration: none; color: #00; line-height: normal; font-weight: normal; font-style: normal; }
Bug #65662 [Opn->Fbk]: root files cpanel
Edit report at https://bugs.php.net/bug.php?id=65662&edit=1 ID: 65662 Updated by: requi...@php.net Reported by:mbiama at angosso dot com Summary:root files cpanel -Status: Open +Status: Feedback Type: Bug Package:Apache2 related Operating System: Ubuntu/linux/Apache/php PHP Version:5.5.3 Block user comment: N Private report: N New Comment: Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. You've given no description of what the supposed bug is and the code you've provided is indecipherable and invalid. Previous Comments: [2013-09-12 15:27:05] mbiama at angosso dot com Description: http://www.exemple.com/file.php/.?root=1&bar=2'; $root = 1; $bar = 2; $(function() { $root = include 'return.php'; echo $root; // prints 'PHP' $bar = include 'noreturn.php'; echo $bar; // prints 1 $string = get_include_contents('somefile.php'); ? Expected result: http://www.nav.com/file.php/./?root=1&bar=2'; $root = 1; $bar = 2; $(function() { $("#wb_element_instance599").children("ul").children().each(function() { if ($(this).children("ul").size() == 0) return; $(this).hover(function() { $(this).children("ul").css({display: "block"}); }, function() { $(this).children("ul").css({display: "none"}); }); }); }); include 'file.txt'; // id="wb_element_instance601" class="wb_element"; include 'file.php'; // ul class="hmenu"; HOME'; ?> ROOMS'; RESERVATIONS'; ?> CONTACTS'; ?> SITEMAP'; ?> AFFILIATE'; ?> MEDIAS'; ?> if ((include 'vars.php') == 'OK') { echo 'OK'; } $root = include 'return.php'; echo $root; // prints 'PHP' $bar = include 'noreturn.php'; echo $bar; // prints 1 $string = get_include_contents('somefile.php'); function get_include_contents($filename) { if (is_file($filename)) { ob_start(); include $filename; return ob_get_clean(); } return false; } ?> -- Edit this bug report at https://bugs.php.net/bug.php?id=65662&edit=1
Bug #65639 [Opn->Nab]: in_array unexpected result
Edit report at https://bugs.php.net/bug.php?id=65639&edit=1 ID: 65639 Updated by: requi...@php.net Reported by:sv3tli0 at bgspot dot eu Summary:in_array unexpected result -Status: Open +Status: Not a bug Type: Bug Package:Arrays related Operating System: Ubuntu 13.04 PHP Version:5.4.19 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 in_array() does a loose comparison by default, and 0 == 'some string not INT'. If you need a strict comparison then pass true for the third argument. http://www.php.net/in-array Previous Comments: [2013-09-09 07:35:53] sv3tli0 at bgspot dot eu Description: Wrong result if you are checking array for existing integer 0, when array has none integer values.. Test script: --- $array = array(1,2,3); var_dump(in_array(0, $array)); $array = array(1,2,'some string not INT'); var_dump(in_array(0, $array)); Expected result: boolean false boolean false Actual result: -- boolean false boolean true -- Edit this bug report at https://bugs.php.net/bug.php?id=65639&edit=1
Bug #65637 [Fbk->Nab]: Using division PHP_ROUND_HALF_UP rounds DOWN when working with 2 precision
Edit report at https://bugs.php.net/bug.php?id=65637&edit=1 ID: 65637 Updated by: requi...@php.net Reported by:productivepc at hotmail dot com Summary:Using division PHP_ROUND_HALF_UP rounds DOWN when working with 2 precision -Status: Feedback +Status: Not a bug Type: Bug Package:Math related Operating System: Windows 7 PHP Version:5.5.3 Block user comment: N Private report: N New Comment: $additionalPcCostPerDay is either 3.33 (rounded to two) or 3.333 (rounded to three). The actual value is ~3.3328. The rounding there is correct. As for 0.05 drop, the difference "lost" using two decimal places is -0.003 * 16 = -0.048 and you round that off to -0.05. So that's where it came from. It sounds like you expect the rounding to carry from one number to the next? That's not how rounding works. That's why you always round at the very end of the set of calculations. Previous Comments: [2013-09-09 05:49:28] productivepc at hotmail dot com I went ahead and wrote it before I went to bed. The only thing you have to change is the 3 to a 2 in this line: $additionalPcCostPerDay = round($additionalPcCost/$totalWorkingDays,3,PHP_ROUND_HALF_UP); You will see the price go from 182.09 when it is looking at 3 decimal places to 182.04 when it is looking at 2 decimal places. When rounding up even if the number previously was a 6 I would expect it to go to 182.10 and not drop $.05. mainPcCost: " . $mainPcCost . "additionalPcCost: " . $additionalPcCost; // echo "additionalpcs: " . $additionalpcs; // echo "WorkingDaysLeft: " . $workingDaysLeft . "totalWorkingDays: " . $totalWorkingDays; // echo "mainPcCostPerDay: " . $mainPcCostPerDay . " additionalPcCostPerDay: " . $additionalPcCostPerDay; // echo "mainPcProratedCost: " . $mainPcProratedCost . " additionalPcProratedCost: " . $additionalPcProratedCost; echo "totalProratedCost: " . $totalProratedCost;// . " costPerFullMonth: " . $costPerFullMonth; ?> [2013-09-09 05:34:34] productivepc at hotmail dot com In your example, you are rounding to 1 decimal place and yes absolutely that will throw it off however if you do =PRODUCT(ROUNDUP(1.45,2),1000) = 1450. I removed all rounding except for the $additionalPcCostPerDay = round($additionalPcCost/$totalWorkingDays,3,PHP_ROUND_HALF_UP); and the error still happens. When I attempt to round to 2 decimal places the rounding appears to round down and not up. When I do it to 3 then it works as expected. It is 1:33am. I will write a smaller script tomorrow after I sleep and post it here. [2013-09-09 02:57:46] requi...@php.net And by the way, you know that rounding numbers too early will throw off future calculations, right? 1.45 * 1000 = 1450 but roundup(1.45, 1) * 1000 = 1500. Don't round until the very end. [2013-09-09 02:48:04] requi...@php.net The script you've provided doesn't output the example numbers you gave. I get additionalPcCostPerDay: 0.159 or 0.16 additionalPcProratedCost: 2.54 or 2.56 totalProratedCost: 131.34 or 131.36 Want to try the repro script again? Hopefully something a bit smaller with fewer variables? [2013-09-09 00:24:58] productivepc at hotmail dot com Description: PHP Version 5.5.0 Results on Screen when precision is set to 2 for $additionalPcCostPerDay. mainPcCost: 169 additionalPcCost: 3.3328571428571 WorkingDaysLeft: 16 totalWorkingDays: 21 mainPcCostPerDay: 8.05 additionalPcCostPerDay: 3.333 mainPcProratedCost: 128.8 additionalPcProratedCost: 53.33 totalProratedCost: 182.13 = Results on screen when I change the precision to 2. Please notice everything has stayed the same but the totalProratedCost has changed. contracttermid: 2 businesstypeid: 1 mainPcCost: 169 additionalPcCost: 3.3328571428571 WorkingDaysLeft: 16 totalWorkingDays: 21 mainPcCostPerDay: 8.05 additionalPcCostPerDay: 3.33 mainPcProratedCost: 128.8 additionalPcProratedCost: 53.28 totalProratedCost: 182.08 I noticed something because I have this same thing programmed in excel. I decided to add the ROUNDUP function to my excel document just like I have it in PHP to ensure that everything worked exactly the same and I noticed that when I went to 2 decimals excel actually changed the additionalPcCostPerDay to 3.34 instead of keeping it 3.33 therefore raising the price to 182.24 and PHP brought the price down to 182.08 instead of keeping it 182.13. Looking in to this further, if I use the ROUNDDOWN function within
Bug #65637 [Fbk]: Using division PHP_ROUND_HALF_UP rounds DOWN when working with 2 precision
Edit report at https://bugs.php.net/bug.php?id=65637&edit=1 ID: 65637 Updated by: requi...@php.net Reported by:productivepc at hotmail dot com Summary:Using division PHP_ROUND_HALF_UP rounds DOWN when working with 2 precision Status: Feedback Type: Bug Package:Math related Operating System: Windows 7 PHP Version:5.5.3 Block user comment: N Private report: N New Comment: And by the way, you know that rounding numbers too early will throw off future calculations, right? 1.45 * 1000 = 1450 but roundup(1.45, 1) * 1000 = 1500. Don't round until the very end. Previous Comments: [2013-09-09 02:48:04] requi...@php.net The script you've provided doesn't output the example numbers you gave. I get additionalPcCostPerDay: 0.159 or 0.16 additionalPcProratedCost: 2.54 or 2.56 totalProratedCost: 131.34 or 131.36 Want to try the repro script again? Hopefully something a bit smaller with fewer variables? [2013-09-09 00:24:58] productivepc at hotmail dot com Description: PHP Version 5.5.0 Results on Screen when precision is set to 2 for $additionalPcCostPerDay. mainPcCost: 169 additionalPcCost: 3.3328571428571 WorkingDaysLeft: 16 totalWorkingDays: 21 mainPcCostPerDay: 8.05 additionalPcCostPerDay: 3.333 mainPcProratedCost: 128.8 additionalPcProratedCost: 53.33 totalProratedCost: 182.13 = Results on screen when I change the precision to 2. Please notice everything has stayed the same but the totalProratedCost has changed. contracttermid: 2 businesstypeid: 1 mainPcCost: 169 additionalPcCost: 3.3328571428571 WorkingDaysLeft: 16 totalWorkingDays: 21 mainPcCostPerDay: 8.05 additionalPcCostPerDay: 3.33 mainPcProratedCost: 128.8 additionalPcProratedCost: 53.28 totalProratedCost: 182.08 I noticed something because I have this same thing programmed in excel. I decided to add the ROUNDUP function to my excel document just like I have it in PHP to ensure that everything worked exactly the same and I noticed that when I went to 2 decimals excel actually changed the additionalPcCostPerDay to 3.34 instead of keeping it 3.33 therefore raising the price to 182.24 and PHP brought the price down to 182.08 instead of keeping it 182.13. Looking in to this further, if I use the ROUNDDOWN function within excel then it too brings the price to 182.08 which is what makes me believe that the PHP function PHP_ROUND_HALF_UP is actually ROUNDING DOWN instead of UP. The expected behavior for both excel and PHP would be to leave the price at 182.13. When I use 3 decimals for both then both PHP and Excel agree that the totalProratedPrice is 182.13. I am not sure if this is a bug however I wanted to report it here before making a comment on the ROUND page with an example of this. The example below I do not have settype() in it however I have attempted this by changing everything over to a float with settype before I did any math and the result was still the same. Wayne Test script: --- $workingDaysLeft = 16; $totalWorkingDays = 21; $mainPcCost = 169; $additionalPcCost = 3.3328571428571; $mainPcCostPerDay = round($mainPcCost/$totalWorkingDays,2, PHP_ROUND_HALF_UP); $additionalPcCost = $additionalPcCost/$totalWorkingDays; // The next line is the problem area. When I change it to 2 precision the expected behavior is for the total prorated cost to stay at 182.13 however it drops to 182.08. If you change the below line to PHP_ROUND_HALF_DOWN then you also get 182.08 which would indicate that the behavior is not behaving as expected. $additionalPcCostPerDay = round($additionalPcCost,3,PHP_ROUND_HALF_UP); $mainPcProratedCost = round($mainPcCostPerDay*$workingDaysLeft,2,PHP_ROUND_HALF_UP); $additionalPcProratedCost = round($additionalPcCostPerDay*$workingDaysLeft,2,PHP_ROUND_HALF_UP); $totalProratedCost = number_format($mainPcProratedCost+$additionalPcProratedCost,2,'.',','); echo "mainPcCost: " . $mainPcCost . "additionalPcCost: " . $additionalPcCost; echo "WorkingDaysLeft: " . $workingDaysLeft . "totalWorkingDays: " . $totalWorkingDays; echo "mainPcCostPerDay: " . $mainPcCostPerDay . "additionalPcCostPerDay: " . $additionalPcCostPerDay; echo "mainPcProratedCost: " . $mainPcProratedCost . "additionalPcProratedCost: " . $additionalPcProratedCost; echo "totalProratedCost: " . $totalProratedCost; Expected result: Whether I have precision for $additionalPcCostPerDay set to 2 or 3 the totalProratedCost should remain the 182.13 and not change to 182.08. -- Edit this bug report at https://bugs.php.net/bug.php?id=65637&edit=1
Bug #65637 [Opn->Fbk]: Using division PHP_ROUND_HALF_UP rounds DOWN when working with 2 precision
Edit report at https://bugs.php.net/bug.php?id=65637&edit=1 ID: 65637 Updated by: requi...@php.net Reported by:productivepc at hotmail dot com Summary:Using division PHP_ROUND_HALF_UP rounds DOWN when working with 2 precision -Status: Open +Status: Feedback Type: Bug Package:Math related Operating System: Windows 7 PHP Version:5.5.3 Block user comment: N Private report: N New Comment: The script you've provided doesn't output the example numbers you gave. I get additionalPcCostPerDay: 0.159 or 0.16 additionalPcProratedCost: 2.54 or 2.56 totalProratedCost: 131.34 or 131.36 Want to try the repro script again? Hopefully something a bit smaller with fewer variables? Previous Comments: [2013-09-09 00:24:58] productivepc at hotmail dot com Description: PHP Version 5.5.0 Results on Screen when precision is set to 2 for $additionalPcCostPerDay. mainPcCost: 169 additionalPcCost: 3.3328571428571 WorkingDaysLeft: 16 totalWorkingDays: 21 mainPcCostPerDay: 8.05 additionalPcCostPerDay: 3.333 mainPcProratedCost: 128.8 additionalPcProratedCost: 53.33 totalProratedCost: 182.13 = Results on screen when I change the precision to 2. Please notice everything has stayed the same but the totalProratedCost has changed. contracttermid: 2 businesstypeid: 1 mainPcCost: 169 additionalPcCost: 3.3328571428571 WorkingDaysLeft: 16 totalWorkingDays: 21 mainPcCostPerDay: 8.05 additionalPcCostPerDay: 3.33 mainPcProratedCost: 128.8 additionalPcProratedCost: 53.28 totalProratedCost: 182.08 I noticed something because I have this same thing programmed in excel. I decided to add the ROUNDUP function to my excel document just like I have it in PHP to ensure that everything worked exactly the same and I noticed that when I went to 2 decimals excel actually changed the additionalPcCostPerDay to 3.34 instead of keeping it 3.33 therefore raising the price to 182.24 and PHP brought the price down to 182.08 instead of keeping it 182.13. Looking in to this further, if I use the ROUNDDOWN function within excel then it too brings the price to 182.08 which is what makes me believe that the PHP function PHP_ROUND_HALF_UP is actually ROUNDING DOWN instead of UP. The expected behavior for both excel and PHP would be to leave the price at 182.13. When I use 3 decimals for both then both PHP and Excel agree that the totalProratedPrice is 182.13. I am not sure if this is a bug however I wanted to report it here before making a comment on the ROUND page with an example of this. The example below I do not have settype() in it however I have attempted this by changing everything over to a float with settype before I did any math and the result was still the same. Wayne Test script: --- $workingDaysLeft = 16; $totalWorkingDays = 21; $mainPcCost = 169; $additionalPcCost = 3.3328571428571; $mainPcCostPerDay = round($mainPcCost/$totalWorkingDays,2, PHP_ROUND_HALF_UP); $additionalPcCost = $additionalPcCost/$totalWorkingDays; // The next line is the problem area. When I change it to 2 precision the expected behavior is for the total prorated cost to stay at 182.13 however it drops to 182.08. If you change the below line to PHP_ROUND_HALF_DOWN then you also get 182.08 which would indicate that the behavior is not behaving as expected. $additionalPcCostPerDay = round($additionalPcCost,3,PHP_ROUND_HALF_UP); $mainPcProratedCost = round($mainPcCostPerDay*$workingDaysLeft,2,PHP_ROUND_HALF_UP); $additionalPcProratedCost = round($additionalPcCostPerDay*$workingDaysLeft,2,PHP_ROUND_HALF_UP); $totalProratedCost = number_format($mainPcProratedCost+$additionalPcProratedCost,2,'.',','); echo "mainPcCost: " . $mainPcCost . "additionalPcCost: " . $additionalPcCost; echo "WorkingDaysLeft: " . $workingDaysLeft . "totalWorkingDays: " . $totalWorkingDays; echo "mainPcCostPerDay: " . $mainPcCostPerDay . "additionalPcCostPerDay: " . $additionalPcCostPerDay; echo "mainPcProratedCost: " . $mainPcProratedCost . "additionalPcProratedCost: " . $additionalPcProratedCost; echo "totalProratedCost: " . $totalProratedCost; Expected result: Whether I have precision for $additionalPcCostPerDay set to 2 or 3 the totalProratedCost should remain the 182.13 and not change to 182.08. -- Edit this bug report at https://bugs.php.net/bug.php?id=65637&edit=1
Bug #65610 [Opn->Fbk]: imagettftext("",,,,,,"مەن كىم")
Edit report at https://bugs.php.net/bug.php?id=65610&edit=1 ID: 65610 Updated by: requi...@php.net Reported by:309165145 at qq dot com Summary:imagettftext("",,"Ù ÛÙ ÙÙÙ ") -Status: Open +Status: Feedback Type: Bug Package:GD related Operating System: xp/win7 /win8 PHP Version:5.4Git-2013-09-03 (Git) Block user comment: N Private report: N New Comment: Not enough information was provided for us to be able to handle this bug. Please re-read the instructions at http://bugs.php.net/how-to-report.php If you can provide more information, feel free to add it to this bug and change the status back to "Open". Thank you for your interest in PHP. What bug are you trying to report? I tried your script with Windows' Arial.ttf and it worked just fine for me. Previous Comments: [2013-09-03 18:44:07] 309165145 at qq dot com Description: --- >From manual page: >http://www.php.net/function.imagettftext#refsect1-function.imagettftext-description $text="Ù ÛÙ ÙÙÙ " --- Test script: --- -- Edit this bug report at https://bugs.php.net/bug.php?id=65610&edit=1
Bug #65609 [Nab]: Blank page even with display_error=1 and error_reporting E^ALL
Edit report at https://bugs.php.net/bug.php?id=65609&edit=1 ID: 65609 Updated by: requi...@php.net Reported by:seyhun_cavus at hotmail dot com Summary:Blank page even with display_error=1 and error_reporting E^ALL Status: Not a bug Type: Bug Package:*General Issues Operating System: Centos 6.4 PHP Version:5.5.3 Block user comment: N Private report: N New Comment: No problem. Glad you got it fixed :) Previous Comments: [2013-09-03 11:00:16] seyhun_cavus at hotmail dot com I apologize.. I had totally forgotten to set the error_log. Sorry again. [2013-09-03 10:24:10] seyhun_cavus at hotmail dot com alright, that's maybe I miss something. I will try to figure out the problem. Thanks for the interest. [2013-09-03 10:17:07] requi...@php.net Did you read the comments in that SO thread? The problem was that OP hadn't configured nginx and/or FPM correctly: >ok I finally figured it out. I wrote a new nginx vhost and it finally got >working. I saw that blank screen error and started looking out in that regard >and came upon those articles which I had earlier listed here, but it was >php5-fpm which wasnt able to find those php files in that particular >subdomain. I'm all for you reopening this with a test script that can illustrate an actual bug, but we're not here to help you troubleshoot what is, to be completely honest, likely a configuration problem. [2013-09-03 10:08:27] seyhun_cavus at hotmail dot com " [2013-09-03 10:02 UTC] requi...@php.net Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. " haha, I don't need a support! And it is actually a BUG in PHP! Check this out; http://stackoverflow.com/questions/15493629/getting-a-blank-page-on-wordpress-blog It seems some others have the same problem with php v5.5 itself. [2013-09-03 10:05:01] seyhun_cavus at hotmail dot com Ok, I see somewhere it has no effect even with php command from terminal. it returns no data. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=65609 -- Edit this bug report at https://bugs.php.net/bug.php?id=65609&edit=1
Bug #65609 [Nab]: Blank page even with display_error=1 and error_reporting E^ALL
Edit report at https://bugs.php.net/bug.php?id=65609&edit=1 ID: 65609 Updated by: requi...@php.net Reported by:seyhun_cavus at hotmail dot com Summary:Blank page even with display_error=1 and error_reporting E^ALL Status: Not a bug Type: Bug Package:*General Issues Operating System: Centos 6.4 PHP Version:5.5.3 Block user comment: N Private report: N New Comment: Did you read the comments in that SO thread? The problem was that OP hadn't configured nginx and/or FPM correctly: >ok I finally figured it out. I wrote a new nginx vhost and it finally got >working. I saw that blank screen error and started looking out in that regard >and came upon those articles which I had earlier listed here, but it was >php5-fpm which wasnt able to find those php files in that particular >subdomain. I'm all for you reopening this with a test script that can illustrate an actual bug, but we're not here to help you troubleshoot what is, to be completely honest, likely a configuration problem. Previous Comments: [2013-09-03 10:08:27] seyhun_cavus at hotmail dot com " [2013-09-03 10:02 UTC] requi...@php.net Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. " haha, I don't need a support! And it is actually a BUG in PHP! Check this out; http://stackoverflow.com/questions/15493629/getting-a-blank-page-on-wordpress-blog It seems some others have the same problem with php v5.5 itself. [2013-09-03 10:05:01] seyhun_cavus at hotmail dot com Ok, I see somewhere it has no effect even with php command from terminal. it returns no data. [2013-09-03 10:02:40] requi...@php.net Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. [2013-09-03 09:57:22] seyhun_cavus at hotmail dot com Description: php webpage is displaying only blank page! I use PHP with Apache HTTP Server v2.4.6 via mod_php. And when I go to shell to run php scripts using php command php index.php; it runs with no problem. However it is blank when I run that page from the browser. -- Edit this bug report at https://bugs.php.net/bug.php?id=65609&edit=1
Bug #65609 [Opn->Nab]: Blank page even with display_error=1 and error_reporting E^ALL
Edit report at https://bugs.php.net/bug.php?id=65609&edit=1 ID: 65609 Updated by: requi...@php.net Reported by:seyhun_cavus at hotmail dot com Summary:Blank page even with display_error=1 and error_reporting E^ALL -Status: Open +Status: Not a bug Type: Bug Package:*General Issues Operating System: Centos 6.4 PHP Version:5.5.3 Block user comment: N Private report: N New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Previous Comments: [2013-09-03 09:57:22] seyhun_cavus at hotmail dot com Description: php webpage is displaying only blank page! I use PHP with Apache HTTP Server v2.4.6 via mod_php. And when I go to shell to run php scripts using php command php index.php; it runs with no problem. However it is blank when I run that page from the browser. -- Edit this bug report at https://bugs.php.net/bug.php?id=65609&edit=1
Bug #65601 [Opn->Ver]: SplFileObject->valid() should not return false when it reached EOF
Edit report at https://bugs.php.net/bug.php?id=65601&edit=1 ID: 65601 Updated by: requi...@php.net Reported by:kentaro at ranvis dot com Summary:SplFileObject->valid() should not return false when it reached EOF -Status: Open +Status: Verified Type: Bug Package:SPL related -Operating System: Windows +Operating System: * PHP Version:5.5.3 Block user comment: N Private report: N New Comment: Related to bug #65600. The first eof() assertion should be === true as rewind() would have rewound the stream and, to maintain normal iteration behavior, read the first line. Using the READ_AHEAD flag will enable the behavior you're expecting. I don't know if that requirement is intentional or necessary. Previous Comments: [2013-09-01 10:15:20] kentaro at ranvis dot com Description: PHP document says that SplFileObject->valid() checks if a file pointer is not at EOF, just like SplFileObject->eof(). But since SplFileObject implements Iterator, valid() should not return false while the current element is valid. Test script: --- $f = new SplFileObject('php://memory', 'r+'); assert('$f instanceof Iterator'); $f->fwrite("line 1"); $f->rewind(); assert('$f->valid() === true'); assert('$f->eof() === false'); assert('$f->current() === "line 1"'); assert('$f->valid() === true'); // fails assert('$f->eof() === true'); -- Edit this bug report at https://bugs.php.net/bug.php?id=65601&edit=1
Bug #65600 [Opn->Ver]: SplFileObject->next() not move next without current()
Edit report at https://bugs.php.net/bug.php?id=65600&edit=1 ID: 65600 Updated by: requi...@php.net Reported by:kentaro at ranvis dot com Summary:SplFileObject->next() not move next without current() -Status: Open +Status: Verified Type: Bug Package:SPL related -Operating System: Windows +Operating System: * PHP Version:5.5.3 Block user comment: N Private report: N New Comment: Using the READ_AHEAD flag will enable the behavior you're expecting. I don't know if that requirement is intentional or necessary. Previous Comments: [2013-09-01 10:09:37] kentaro at ranvis dot com Description: SplFileObject->next() doesn't move to the next line unless ->current() is called in advance. Test script: --- $f = new SplFileObject('php://memory', 'r+'); $f->fwrite("line 1\nline 2\nline 3"); $f->rewind(); assert('$f->current() === "line 1\n"'); $f->next(); assert('$f->current() === "line 2\n"'); $f->next(); var_dump($f->ftell()); // 14 assert('$f->current() === "line 3"'); $f->rewind(); $f->next(); $f->next(); var_dump($f->ftell()); // 0 assert('$f->current() === "line 3"'); // fails -- Edit this bug report at https://bugs.php.net/bug.php?id=65600&edit=1
Bug #65587 [Opn->Fbk]: When PHP was upgraded from 5.2 to 5.4,then the bug will comes out
Edit report at https://bugs.php.net/bug.php?id=65587&edit=1 ID: 65587 Updated by: requi...@php.net Reported by:xiche at adobe dot com Summary:When PHP was upgraded from 5.2 to 5.4,then the bug will comes out -Status: Open +Status: Feedback Type: Bug Package:Strings related Operating System: Linux PHP Version:5.4.19 Block user comment: N Private report: N New Comment: Thank you for this bug report. To properly diagnose the problem, we need a short but complete example script to be able to reproduce this bug ourselves. A proper reproducing script starts with , is max. 10-20 lines long and does not require any external resources such as databases, etc. If the script requires a database to demonstrate the issue, please make sure it creates all necessary tables, stored procedures etc. Please avoid embedding huge scripts into the report. Previous Comments: [2013-08-30 06:14:28] xiche at adobe dot com Description: --- >From manual page: >http://www.php.net/function.strstr#refsect1-function.strstr-description --- When PHP was upgraded from 5.2 to 5.4,then the warning message will comes out: PHP Warning: strstr() expects parameter 1 to be string, array given in - on line 1 -- Edit this bug report at https://bugs.php.net/bug.php?id=65587&edit=1
Req #65574 [Csd]: how to open a stream for gmail so that we can read emails landed in gmail Inbox
Edit report at https://bugs.php.net/bug.php?id=65574&edit=1 ID: 65574 Updated by: requi...@php.net Reported by:abhinav dot octane at gmail dot com Summary:how to open a stream for gmail so that we can read emails landed in gmail Inbox Status: Closed Type: Feature/Change Request Package:IMAP related Operating System: windows PHP Version:5.5.3 Assigned To:ab Block user comment: N Private report: N New Comment: The point is we are not "support". This place is for reporting bugs, not for helping you with your code. ab linked you to the php.general mailing list. You can ask there. A couple more links: http://www.php.net/support.php http://www.google.com/search?q=php+forum Previous Comments: [2013-08-29 10:10:06] abhinav dot octane at gmail dot com i did not get where u r refering me to discuss this query. i am learning php from your manual so i feel there might be some help from support. thanks, [2013-08-28 19:51:17] a...@php.net Please use http://news.php.net/php.general or #php on freenode for this kind of questions. [2013-08-28 19:23:55] abhinav dot octane at gmail dot com Description: --- >From manual page: http://www.php.net/function.imap-fetchheader --- how to open a stream for gmail so that we can read emails landed in gmail Inbox/promotion category only. imap_open ('{imap.gmail.com:993/imap/ssl}INBOX', "exam...@gmail.com", "abcd") but i want only to read promotion emails. -- Edit this bug report at https://bugs.php.net/bug.php?id=65574&edit=1
Bug #65578 [Opn->Nab]: Php Calendar does not calculate number of days correctly
Edit report at https://bugs.php.net/bug.php?id=65578&edit=1 ID: 65578 Updated by: requi...@php.net Reported by:satovey at yahoo dot com Summary:Php Calendar does not calculate number of days correctly -Status: Open +Status: Not a bug Type: Bug -Package:Built-in web server +Package:Calendar related Operating System: Windows 7 PHP Version:Irrelevant Block user comment: N Private report: N New Comment: Sorry, but your problem does not imply a bug in PHP itself. For a list of more appropriate places to ask for help using PHP, please visit http://www.php.net/support.php as this bug system is not the appropriate forum for asking support questions. Due to the volume of reports we can not explain in detail here why your report is not a bug. The support channels will be able to provide an explanation for you. Thank you for your interest in PHP. Your arithmetic is off by one: using January to demonstrate, you're subtracting January 31st minus January 1st and concluding that there are 31-1=30 days in the month. $totalDaysInYear = $lastDay - $firstDay + 1; Previous Comments: [2013-08-28 23:08:32] satovey at yahoo dot com Description: --- >From manual page: http://www.php.net/function.jewishtojd --- In using the JewishToJD function of the Calendar, there is a discrepancy in the total days of the year. The last month of the Jewish Year has 29 days and the shortest year is 353 days. Test script: --- $year"; } $firstDay = jewishtojd( $firstMonth, $firstDay, $firstYear ); $lastDay = jewishtojd ( $lastMonth, $lastDay, $lastYear ); $totalDaysInYear = $lastDay - $firstDay; //echo "$firstDate, $lastDate "; //echo "Cycle Count -> $count | Total Days in the Year $year => "; echo "$displayYear "; echo "$totalDaysInYear"; echo ""; } ?> Expected result: It is expected that when calculating between 1/1/577 to 13/29/577 the return should be 353 days as that is the number of days in the Jewish year 5777. http://en.wikipedia.org/wiki/Hebrew_calendar#Leap_years >> Scroll up to see a list of new year dates. << This appears to occur in all versions of PHP. Actual result: -- Yet the provided code will output 352 days if 13,29,5777 is entered and 353 days if 13,30,5777 is entered. Note: the month of Elul which is given the number 13 is a 29 day month. The output is as follows: 5777 353 5777 352 -- Edit this bug report at https://bugs.php.net/bug.php?id=65578&edit=1
Bug #65530 [Ver]: Anonymous functions not callable directly when part of a static class
Edit report at https://bugs.php.net/bug.php?id=65530&edit=1 ID: 65530 Updated by: requi...@php.net Reported by:matt dot minix at gmail dot com Summary:Anonymous functions not callable directly when part of a static class Status: Verified Type: Bug Package:Scripting Engine problem Operating System: Linux PHP Version:5.4 and later Block user comment: N Private report: N New Comment: It's ambiguous at compile time: Does "Class::$foo()" 1. As requested: execute the function stored in/referenced by Class::$foo 2. As currently: execute the static method in Class named according to the local $foo 3. Another possibility: evaluate the static property of Class whose name is returned by $foo() The only way I see to support more than one would be to resolve it at runtime, but even then it's still possible to write something that is legal all three ways: Looking at just the last line I'm not even sure what *I* would expect it to do... Previous Comments: [2013-08-26 09:51:28] yohg...@php.net PHP behaves as reported. It does not work 5.5 also. [yohgaki@dev PHP-5.5]$ ./sapi/cli/php Fatal error: Function name must be a string in - on line 7 [2013-08-22 21:19:27] matt dot minix at gmail dot com Description: An anonymous function doesn't seem like it can be called directly when in a static class. Test script: --- class a { public static $b; } a::$b = static function($c) { echo $c; }; a::$b('Test'); I am however able to do class a { public static $b; } a::$b = static function($c) { echo $c; }; $Temp = a::$b; $Temp('Test'); Expected result: "Test" Actual result: -- Fatal error: Function name must be a string -- Edit this bug report at https://bugs.php.net/bug.php?id=65530&edit=1
Bug #65536 [Opn->Nab]: getimagesize() returning wrong value for IMG_PNG
Edit report at https://bugs.php.net/bug.php?id=65536&edit=1 ID: 65536 Updated by: requi...@php.net Reported by:hammadullahkhan at gmail dot com Summary:getimagesize() returning wrong value for IMG_PNG -Status: Open +Status: Not a bug Type: Bug Package:PHP options/info functions Operating System: windows PHP Version:5.4.19 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 [2] is an IMAGETYPE constant, not an IMG constant. Previous Comments: [2013-08-23 23:23:28] hammadullahkhan at gmail dot com Description: --- >From manual page: >http://www.php.net/function.getimagesize#refsect1-function.getimagesize-returnvalues --- Hi, Just noticed that getimagesize() is returning wrong value in case of PNG: Array ( [0] => 1125 [1] => 651 [2] => 3 [3] => width="1125" height="651" [bits] => 8 [mime] => image/png ) [2] => should return 4 As per: gd.php line 1805 define ('IMG_PNG', 4); Test script: --- $imgInfo = getimagesize("test.png"); if ($imgInfo[2] == IMG_PNG) { echo "CONDITION SHOULD BE WORKING AS PER gd.php"; } else { echo "CONDITION NOT WORKING"; } Expected result: CONDITION SHOULD BE WORKING AS PER gd.php Actual result: -- CONDITION NOT WORKING -- Edit this bug report at https://bugs.php.net/bug.php?id=65536&edit=1
Bug #65397 [Fbk->Nab]: Mysql_* functions hide their warning
Edit report at https://bugs.php.net/bug.php?id=65397&edit=1 ID: 65397 Updated by: requi...@php.net Reported by:info at markoheijnen dot com Summary:Mysql_* functions hide their warning -Status: Feedback +Status: Not a bug Type: Bug Package:MySQL related Operating System: Debian Wheezy PHP Version:5.5.1 Block user comment: N Private report: N New Comment: The default values http://www.php.net/manual/en/mysql.configuration.php are all empty, but I believe on Windows the default username is "ODBC". Previous Comments: [2013-08-20 17:55:49] info at markoheijnen dot com It was a mistake in my MySQL user data. Not sure how it get there but because it could connect to the database without username/password. What is the default values in php.ini [2013-08-20 03:08:19] requi...@php.net It isn't fatal in the 5.5.1 I'm executing. E:\programs\PHP\php-5.5.1-Win32-VC11-x86>php -v PHP 5.5.1 (cli) (built: Jul 18 2013 10:56:37) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies E:\programs\PHP\php-5.5.1-Win32-VC11-x86>php -d extension=ext/php_mysql.dll ^Z Deprecated: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in - on line 5 Warning: mysql_query(): No connection could be made because the target machine actively refused it. in - on line 5 Warning: mysql_query(): A link to the server could not be established in - on line 5 Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in - on line 5 NULL still executing E:\programs\PHP\php-5.5.1-Win32-VC11-x86> Meanwhile at the top of php_mysql.c/php_mysql_do_connect in the source, https://github.com/php/php-src/blob/master/ext/mysql/php_mysql.c#L734 php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead"); (after which it continues on its merry way) and E_DEPRECATED is most certainly not fatal. [2013-08-20 01:53:38] william dot a dot bartlett at gmail dot com I mispoke slightly. As per: http://www.php.net/manual/en/function.mysql-query.php > If the link identifier is not specified, the last link opened by > mysql_connect() is assumed. If no such link is found, it will try to create > one as if mysql_connect() was called with no arguments. If no connection is > found or established, an E_WARNING level error is generated. when you call mysql_query, it will call mysql_connect(). mysql_connect() returns a fatal error, E_DEPRECATED. The E_WARNING is never generated because execution crashes before mysql_query is called. At the most, a documentation error. For goodness sakes, there is no allowable way to call mysql_query() in php5.5 because there are no valid mysql connections. [2013-08-20 01:48:41] william dot a dot bartlett at gmail dot com > It is just a warning. A "notice", even. Not fatal. No. As per: http://www.php.net/manual/en/changelog.mysql.php In PHP5.5, mysql_* functions emit E_DEPRECATED error, not E_DEPRECATED warning. It IS fatal. My example was intended to indicate that the echo statement nevers occurs (which is the expected behavior). [2013-08-20 01:43:46] requi...@php.net It is just a warning. A "notice", even. Not fatal. @info: It's a silly question but are you sure it didn't connect? What's the output of The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=65397 -- Edit this bug report at https://bugs.php.net/bug.php?id=65397&edit=1
Req #65484 [Opn]: Accessing null variable as array over key
Edit report at https://bugs.php.net/bug.php?id=65484&edit=1 ID: 65484 Updated by: requi...@php.net Reported by:jan dot kahoun at heureka dot cz Summary:Accessing null variable as array over key Status: Open Type: Feature/Change Request -Package:*General Issues +Package:Scripting Engine problem -PHP Version:Irrelevant +PHP Version:5.5.2 Block user comment: N Private report: N New Comment: See also bug #37676 using Array access operator [] on boolean variable does not show Notice bug #40692 Trying to use boolean as array doesn't give an error and a part of bug #62769 Inconsistent notice reporting using [] Previous Comments: [2013-08-20 08:02:27] jan dot kahoun at heureka dot cz Description: If you define variable as NULL and then you want to acces it over keys as array like $array['kolo'] then PHP should trigger a strict error and not return the NULL. Test script: --- https://bugs.php.net/bug.php?id=65484&edit=1
Bug #65397 [Fbk]: Mysql_* functions hide their warning
Edit report at https://bugs.php.net/bug.php?id=65397&edit=1 ID: 65397 Updated by: requi...@php.net Reported by:info at markoheijnen dot com Summary:Mysql_* functions hide their warning Status: Feedback Type: Bug Package:MySQL related Operating System: Debian Wheezy PHP Version:5.5.1 Block user comment: N Private report: N New Comment: It isn't fatal in the 5.5.1 I'm executing. E:\programs\PHP\php-5.5.1-Win32-VC11-x86>php -v PHP 5.5.1 (cli) (built: Jul 18 2013 10:56:37) Copyright (c) 1997-2013 The PHP Group Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies E:\programs\PHP\php-5.5.1-Win32-VC11-x86>php -d extension=ext/php_mysql.dll ^Z Deprecated: mysql_query(): The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead in - on line 5 Warning: mysql_query(): No connection could be made because the target machine actively refused it. in - on line 5 Warning: mysql_query(): A link to the server could not be established in - on line 5 Warning: mysql_num_rows() expects parameter 1 to be resource, boolean given in - on line 5 NULL still executing E:\programs\PHP\php-5.5.1-Win32-VC11-x86> Meanwhile at the top of php_mysql.c/php_mysql_do_connect in the source, https://github.com/php/php-src/blob/master/ext/mysql/php_mysql.c#L734 php_error_docref(NULL TSRMLS_CC, E_DEPRECATED, "The mysql extension is deprecated and will be removed in the future: use mysqli or PDO instead"); (after which it continues on its merry way) and E_DEPRECATED is most certainly not fatal. Previous Comments: [2013-08-20 01:53:38] william dot a dot bartlett at gmail dot com I mispoke slightly. As per: http://www.php.net/manual/en/function.mysql-query.php > If the link identifier is not specified, the last link opened by > mysql_connect() is assumed. If no such link is found, it will try to create > one as if mysql_connect() was called with no arguments. If no connection is > found or established, an E_WARNING level error is generated. when you call mysql_query, it will call mysql_connect(). mysql_connect() returns a fatal error, E_DEPRECATED. The E_WARNING is never generated because execution crashes before mysql_query is called. At the most, a documentation error. For goodness sakes, there is no allowable way to call mysql_query() in php5.5 because there are no valid mysql connections. [2013-08-20 01:48:41] william dot a dot bartlett at gmail dot com > It is just a warning. A "notice", even. Not fatal. No. As per: http://www.php.net/manual/en/changelog.mysql.php In PHP5.5, mysql_* functions emit E_DEPRECATED error, not E_DEPRECATED warning. It IS fatal. My example was intended to indicate that the echo statement nevers occurs (which is the expected behavior). [2013-08-20 01:43:46] requi...@php.net It is just a warning. A "notice", even. Not fatal. @info: It's a silly question but are you sure it didn't connect? What's the output of [2013-08-20 01:06:14] william dot a dot bartlett at gmail dot com Not a bug. mysql_query() is throws a deprecation error, not a deprecation warning. Try: --- https://bugs.php.net/bug.php?id=65397&edit=1
Bug #65397 [Opn->Fbk]: Mysql_* functions hide their warning
Edit report at https://bugs.php.net/bug.php?id=65397&edit=1 ID: 65397 Updated by: requi...@php.net Reported by:info at markoheijnen dot com Summary:Mysql_* functions hide their warning -Status: Open +Status: Feedback Type: Bug Package:MySQL related Operating System: Debian Wheezy PHP Version:5.5.1 Block user comment: N Private report: N New Comment: It is just a warning. A "notice", even. Not fatal. @info: It's a silly question but are you sure it didn't connect? What's the output of Previous Comments: [2013-08-20 01:06:14] william dot a dot bartlett at gmail dot com Not a bug. mysql_query() is throws a deprecation error, not a deprecation warning. Try: --- https://bugs.php.net/bug.php?id=65397&edit=1
Bug #65452 [Opn->Nab]: Change value in array
Edit report at https://bugs.php.net/bug.php?id=65452&edit=1 ID: 65452 Updated by: requi...@php.net Reported by:philippe at kinhelios dot com Summary:Change value in array -Status: Open +Status: Not a bug Type: Bug Package:*General Issues Operating System: Linux web1106.90.ha.ovh.net 3.2. PHP Version:Irrelevant 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 The reference persists even after the loop finishes. In the second loop, foreach will assign values to $localValue... which is still a reference to the last element in $arrayOne. The net effect is the second-to-last element overwrites the last element. (Try with three or more items in $arrayOne.) Solution: unset($localValue) after the first loop (best), or don't use it as a reference and update $arrayOne using the $localKey, or use a different variable in the second loop, or use references in the second loop. Previous Comments: [2013-08-14 17:23:00] philippe at kinhelios dot com Description: Hi, Note : PHP Version 5.2.17, but I can't update the version of php, it is installed on a shared server. Loop to change the values in an array by reference and then another loop but same variable name, the initial array is modified again. [translate by http://www.bing.com/translator/] Test script: --- array('k1' => 'val_key1_k1'), 'key2' => array('k1' => 'val_key2_k1') ); foreach ($arrayOne as $localKey => &$localValue)// character & $localValue['k1'] .= '_add'; // - print_r($arrayOne); $counter = 0; foreach ($arrayOne as $k => $localValue)// same name of variable "$localValue", but local $counter++; print_r($arrayOne); // is the same array ? => NO ! ?> Expected result: Array ( [key1] => Array ( [k1] => val_key1_k1_add ) [key2] => Array ( [k1] => val_key2_k1_add ) ) Actual result: -- Array ( [key1] => Array ( [k1] => val_key1_k1_add ) [key2] => Array ( [k1] => val_key1_k1_add // Hey! My value changed here ! ) ) -- Edit this bug report at https://bugs.php.net/bug.php?id=65452&edit=1
Bug #65443 [Opn]: class_exists with $autoload=true raising fatal error
Edit report at https://bugs.php.net/bug.php?id=65443&edit=1 ID: 65443 Updated by: requi...@php.net Reported by:pieczar92 at interia dot pl -Summary:PHP Version: 5.4.16 +Summary:class_exists with $autoload=true raising fatal error Status: Open Type: Bug Package:PHP options/info functions Operating System: Windows 8 PHP Version:5.4.17 Block user comment: N Private report: N New Comment: Ticket renamed. Test scripts need to be stand-alone and executable with a simple copy and paste on our part. What you've posted requires a $gravatarURL and, to reproduce your results, an autoloader. You are using an autoloader, correct? Yours is deriving a filename and immediately require or require_once-ing it. That is incorrect: it must check if the file even exists first. Make that change to your autoloader and use $autoload=true in your call to class_exists(). If that does not fix the problem then please post a COMPLETE test script that can be run by itself without using any undefined variables or external autoloaders. Previous Comments: [2013-08-13 19:02:15] pieczar92 at interia dot pl Description: Welcome. My report is related to the function: bool class_exists (string $ class_name [, bool $ autoload = true]) Namely, I have noticed that if the result of the function returns false, the script crashes mistake, because after all, the script tries to load a non- existent class. Problem solved by changing the parameter $ autoload to false. I believe that the $ autoload should be taken into account only if the result of the function will amount to true. I'm sorry for syntax errors. My text was translated Google tools - translation. Regards, Kamil Piechaczek Test script: --- if( class_exists('finfo', false) ) { $fInfo = new finfo(FILEINFO_MIME); $gravatarImageMime = $fInfo->file($gravatarURL, FILEINFO_MIME_TYPE); } else { $gravatarImage = getimagesize($gravatarURL); $gravatarImageMime = $gravatarImage['mime']; } Expected result: Variable $gravatarImageMime should has type mime of file. Actual result: -- White screen (autoload can't find file) -- Edit this bug report at https://bugs.php.net/bug.php?id=65443&edit=1
Bug #65428 [Opn->Nab]: call_user_func_array can't accept params correctly
Edit report at https://bugs.php.net/bug.php?id=65428&edit=1 ID: 65428 Updated by: requi...@php.net Reported by:1suming at sina dot com Summary:call_user_func_array can't accept params correctly -Status: Open +Status: Not a bug Type: Bug Package:Unknown/Other Function Operating System: windows PHP Version:5.4.17 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 The second argument to call_user_func_array() is an array of the arguments to pass. Not an entire argument by itself. That's the whole point of having this function alongside call_user_func(). Previous Comments: [2013-08-09 17:13:03] requi...@php.net Related To: Bug #65429 [2013-08-09 16:41:23] 1suming at sina dot com Description: --- >From manual page: http://www.php.net/function.call-user-func-array#refsect1- function.call-user-func-array-description --- class Foo { public function printArray(array $arr) { var_dump($arr); } } $foo1=new Foo(); call_user_func_array(array($foo1,'printArray'),array(1,2)); when I run,the result is Catchable fatal error: Argument 1 passed to foo::printArray() must be of the type array, integer but when i change call_user_func_array to call_user_func,it's ok. Don't call_user_func_array accept params? -- Edit this bug report at https://bugs.php.net/bug.php?id=65428&edit=1
Bug #65429 [Opn->Dup]: call_user_func_array can't accept params correctly
Edit report at https://bugs.php.net/bug.php?id=65429&edit=1 ID: 65429 Updated by: requi...@php.net Reported by:1suming at sina dot com Summary:call_user_func_array can't accept params correctly -Status: Open +Status: Duplicate Type: Bug Package:Unknown/Other Function Operating System: windows PHP Version:5.4.17 Block user comment: N Private report: N New Comment: Duplicate of bug #65428 Previous Comments: [2013-08-09 16:48:36] 1suming at sina dot com Description: --- >From manual page: http://www.php.net/function.call-user-func-array#refsect1- function.call-user-func-array-description --- class Foo { public function printArray(array $arr) { var_dump($arr); } } $foo1=new Foo(); call_user_func_array(array($foo1,'printArray'),array(1,2)); when I run,the result is Catchable fatal error: Argument 1 passed to foo::printArray() must be of the type array, integer but when i change call_user_func_array to call_user_func,it's ok. Don't call_user_func_array accept params? -- Edit this bug report at https://bugs.php.net/bug.php?id=65429&edit=1
Bug #65413 [Opn->Dup]: Unable to send vary header user-agent when ob_start('ob_gzhandler') is called
Edit report at https://bugs.php.net/bug.php?id=65413&edit=1 ID: 65413 Updated by: requi...@php.net Reported by:nikcomestotalk at gmail dot com Summary:Unable to send vary header user-agent when ob_start('ob_gzhandler') is called -Status: Open +Status: Duplicate Type: Bug Package:Output Control Operating System: any PHP Version:5.4.17 Block user comment: N Private report: N New Comment: Bug is now open (and even verified too). Previous Comments: [2013-08-07 10:34:36] nikcomestotalk at gmail dot com Description: Unable to reopen bug https://bugs.php.net/bug.php?id=65391 -- Edit this bug report at https://bugs.php.net/bug.php?id=65413&edit=1
Bug #65396 [Com]: Separators at the beginning of string are also exploded
Edit report at https://bugs.php.net/bug.php?id=65396&edit=1 ID: 65396 Comment by: mail+php at requinix dot net Reported by:empaingeo at hotmail dot com Summary:Separators at the beginning of string are also exploded Status: Open Type: Bug Package:Strings related Operating System: Windows Vista PHP Version:Irrelevant Block user comment: N Private report: N New Comment: Totally intended and often desirable behavior. If you don't want those then trim() the spaces off first, or if you're worried about multiple spaces inside the string too ("test1 test2") then array_filter() the result. Previous Comments: [2013-08-05 23:39:25] empaingeo at hotmail dot com Description: --- >From manual page: >http://www.php.net/function.explode#refsect1-function.explode-returnvalues --- Hi, to reproduce the problem : Test script: --- "; echo print_r(explode(' ', "test1 test2")); echo ""; ?> Expected result: Array ( [0] => test1 [1] => test2 ) 1 Actual result: -- Array ( [0] => [1] => [2] => [3] => [4] => test1 [5] => test2 ) 1 -- Edit this bug report at https://bugs.php.net/bug.php?id=65396&edit=1
Bug #65412 [Com]: strtotime('2013-07-31 -1 month') return wrong result
Edit report at https://bugs.php.net/bug.php?id=65412&edit=1 ID: 65412 Comment by: mail+php at requinix dot net Reported by:laurisnet at inbox dot lv Summary:strtotime('2013-07-31 -1 month') return wrong result Status: Not a bug Type: Bug Package:Date/time related Operating System: Windows 7 64bit PHP Version:5.4Git-2013-08-07 (Git) Block user comment: N Private report: N New Comment: "-1 month" is literally subtracting one month from the date. 2013-07-31 becomes 2013-06-31 which overflows to 2013-07-01. Likewise "2013-03-31 -1 month" becomes 2013-03-03. If you want the last day of the previous month then the method I know (using only strtotime) is going to the beginning of the month, subtracting a month, and going to the last day: strtotime("2013-07-31, first day of, -1 month, last day of") Keep an eye on http://php.net/datetime.formats.relative But it's much easier with mktime(0, 0, 0, month, 0, year). Previous Comments: [2013-08-07 20:09:36] ras...@php.net This is not a bug. This is standard behaviour for date arithmetic when the target date is impossible. There is an explanation from the GNU tools here: http://www.gnu.org/software/tar/manual/html_chapter/Date-input- formats.html#SEC125 [2013-08-07 09:19:10] laurisnet at inbox dot lv Description: Function strtotime() return wrong value for 2013-07-31 date with parameters: A) -1 month B) last month Test script: --- Expected result: 2013-06-30 Actual result: -- 2013-07-01 -- Edit this bug report at https://bugs.php.net/bug.php?id=65412&edit=1
Bug #65352 [Com]: Method Closure::bind() can access private property of object
Edit report at https://bugs.php.net/bug.php?id=65352&edit=1 ID: 65352 Comment by: mail+php at requinix dot net Reported by:seyferseed at mail dot ru Summary:Method Closure::bind() can access private property of object Status: Open Type: Bug Package:Class/Object related Operating System: Linux PHP Version:5.4.17 Block user comment: N Private report: N New Comment: References deal with the actual values of variables, not the variables themselves. Access control deals with variables. When you create $bar as a reference to something - anything - the only thing that matters when changing its value is the scope of $bar. Like a piece of paper. I write down where my buried treasure is on two pieces, put one in a safe and give the other to you. You can use yours to loot the treasure and replace it with your own. The fact that the other piece of paper is locked away somewhere is irrelevant. But here isn't the best place for an in-depth explanation of references. Trust me when I say that what's going on isn't a bug and that plenty of other languages act exactly the same way. If you would like a real explanation then I suggest finding an online PHP group, forum, or mailing list, and asking there. Or even emailing me, I wouldn't mind. Previous Comments: [2013-07-31 10:49:03] seyferseed at mail dot ru You tell me about scope, i'm understand what you mean. But in my example i can change private property not in scrope. This is not about reading property, this is about setting private without setter. See examples. $bar not copy, bar link to private. $foo = new Foo(); $bar = & $reader($foo, 'bar'); $bar = 'tab'; This is not in class scope, this is just reference (link) to private property, but i can change it. I think this is wrong! And in this case too: $bar = & $foo->getBar(); $bar = "tab"; I think changing private property by reference in any case, with bind() or not, wrong. This is violation of encapsulation. ---- [2013-07-31 04:54:43] mail+php at requinix dot net Variable scope. With bind() you were creating a closure that executes in the scope of that class. That's what the third argument was about. It means the function can do anything that a normal member function could have done, like call private methods and access private variables. As with reflection, with great power comes great responsibility. If you want to get the error then omit the third argument so the function remains in the scope you were executing in (ie, the global scope). [2013-07-31 04:39:12] seyferseed at mail dot ru For PHP, yes, solved. But not for logic. I believe that to change the link to private property is very wrong. Should generate an error. [2013-07-31 04:30:13] mail+php at requinix dot net >$bar = $foo->getBar(); Simply making the function return by reference is not enough: you have to assign by reference too. Otherwise the function returns a reference, yes, but your assignment makes a copy. You need both of the &s. http://php.net/language.references.return The first note on the page says exactly that. Your version with Closure::bind() had both. That's why it worked. Resolved? [2013-07-31 02:19:17] seyferseed at mail dot ru If i'm add & there $bar = & $foo->getBar(); $bar = "tab"; echo $foo->getBar(); I really can change Private $foo to "tab". I'm so confused... I'm expected Fatal error: Cannot access private property But by reference there is no error. Maybe this is PHP "feature" and there is no bug. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=65352 -- Edit this bug report at https://bugs.php.net/bug.php?id=65352&edit=1
Bug #65352 [Com]: Method Closure::bind() can access private property of object
Edit report at https://bugs.php.net/bug.php?id=65352&edit=1 ID: 65352 Comment by: mail+php at requinix dot net Reported by:seyferseed at mail dot ru Summary:Method Closure::bind() can access private property of object Status: Open Type: Bug Package:Class/Object related Operating System: Linux PHP Version:5.4.17 Block user comment: N Private report: N New Comment: Variable scope. With bind() you were creating a closure that executes in the scope of that class. That's what the third argument was about. It means the function can do anything that a normal member function could have done, like call private methods and access private variables. As with reflection, with great power comes great responsibility. If you want to get the error then omit the third argument so the function remains in the scope you were executing in (ie, the global scope). Previous Comments: [2013-07-31 04:39:12] seyferseed at mail dot ru For PHP, yes, solved. But not for logic. I believe that to change the link to private property is very wrong. Should generate an error. [2013-07-31 04:30:13] mail+php at requinix dot net >$bar = $foo->getBar(); Simply making the function return by reference is not enough: you have to assign by reference too. Otherwise the function returns a reference, yes, but your assignment makes a copy. You need both of the &s. http://php.net/language.references.return The first note on the page says exactly that. Your version with Closure::bind() had both. That's why it worked. Resolved? [2013-07-31 02:19:17] seyferseed at mail dot ru If i'm add & there $bar = & $foo->getBar(); $bar = "tab"; echo $foo->getBar(); I really can change Private $foo to "tab". I'm so confused... I'm expected Fatal error: Cannot access private property But by reference there is no error. Maybe this is PHP "feature" and there is no bug. [2013-07-31 02:14:11] seyferseed at mail dot ru But if i'm add this function to class Foo by code it in class, i can't access private property! And this is right. You say, that my Getter function used in Closure::bind() can change (like Setter) private property and this is right? I don't think so. Example: class Foo { private $bar = 'baz'; public function &getBar() { return $this->bar; } } $foo = new Foo(); $bar = $foo->getBar(); $bar = "tab"; echo $foo->getBar(); It's still "bar". And i don't know how i can change Private property of class by reference in this case. It will be wrong, if i can. And now i'm take my getter public function &getBar() { return $this->bar; } Put it in Closure::bind() and i can change Private property. This is really wrong. If i can change it only in function, that binded to Closure::bind(), like $value = & Closure::bind(function & () use ($property) { $this->property = "tab"; return $this->$property; }, $object, $object)->__invoke(); It's okay, becouse it statically inside Foo. But Client code can change Private property by reference! Is that right? [2013-07-30 18:09:38] mail+php at requinix dot net As noted in Closure::bind(), "public static Closure Closure::bind ( Closure $closure , object $newthis [, mixed $newscope = 'static' ] ) newscope The class scope to which associate the closure is to be associated, or 'static' to keep the current one. If an object is given, the type of the object will be used instead. This determines the visibility of protected and private methods of the bound object." You changed the scope of the function to be that of inside $foo. Naturally it would have access to private members. If you don't want it to do that then omit newscope=$object. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=65352 -- Edit this bug report at https://bugs.php.net/bug.php?id=65352&edit=1
Bug #65352 [Com]: Method Closure::bind() can access private property of object
Edit report at https://bugs.php.net/bug.php?id=65352&edit=1 ID: 65352 Comment by: mail+php at requinix dot net Reported by:seyferseed at mail dot ru Summary:Method Closure::bind() can access private property of object Status: Open Type: Bug Package:Class/Object related Operating System: Linux PHP Version:5.4.17 Block user comment: N Private report: N New Comment: >$bar = $foo->getBar(); Simply making the function return by reference is not enough: you have to assign by reference too. Otherwise the function returns a reference, yes, but your assignment makes a copy. You need both of the &s. http://php.net/language.references.return The first note on the page says exactly that. Your version with Closure::bind() had both. That's why it worked. Resolved? Previous Comments: [2013-07-31 02:19:17] seyferseed at mail dot ru If i'm add & there $bar = & $foo->getBar(); $bar = "tab"; echo $foo->getBar(); I really can change Private $foo to "tab". I'm so confused... I'm expected Fatal error: Cannot access private property But by reference there is no error. Maybe this is PHP "feature" and there is no bug. [2013-07-31 02:14:11] seyferseed at mail dot ru But if i'm add this function to class Foo by code it in class, i can't access private property! And this is right. You say, that my Getter function used in Closure::bind() can change (like Setter) private property and this is right? I don't think so. Example: class Foo { private $bar = 'baz'; public function &getBar() { return $this->bar; } } $foo = new Foo(); $bar = $foo->getBar(); $bar = "tab"; echo $foo->getBar(); It's still "bar". And i don't know how i can change Private property of class by reference in this case. It will be wrong, if i can. And now i'm take my getter public function &getBar() { return $this->bar; } Put it in Closure::bind() and i can change Private property. This is really wrong. If i can change it only in function, that binded to Closure::bind(), like $value = & Closure::bind(function & () use ($property) { $this->property = "tab"; return $this->$property; }, $object, $object)->__invoke(); It's okay, becouse it statically inside Foo. But Client code can change Private property by reference! Is that right? [2013-07-30 18:09:38] mail+php at requinix dot net As noted in Closure::bind(), "public static Closure Closure::bind ( Closure $closure , object $newthis [, mixed $newscope = 'static' ] ) newscope The class scope to which associate the closure is to be associated, or 'static' to keep the current one. If an object is given, the type of the object will be used instead. This determines the visibility of protected and private methods of the bound object." You changed the scope of the function to be that of inside $foo. Naturally it would have access to private members. If you don't want it to do that then omit newscope=$object. [2013-07-29 04:39:42] seyferseed at mail dot ru Description: Method Closure::bind() can access private property of object. And modify it by reference. It is a violation of encapsulation. See script for example. http://3v4l.org/JE0eX Test script: --- $property; }, $object, $object)->__invoke(); return $value; }; $foo = new Foo(); $bar = & $reader($foo, 'bar'); $bar = 'tab'; var_dump($foo); Expected result: Fatal error: Cannot access private property Foo::$bar in /in/JE0eX on line 8 Actual result: -- Output for 5.4.0 - 5.5.1 object(Foo)#2 (1) { ["bar":"Foo":private]=> &string(3) "tab" } -- Edit this bug report at https://bugs.php.net/bug.php?id=65352&edit=1
Bug #65352 [Com]: Method Closure::bind() can access private property of object
Edit report at https://bugs.php.net/bug.php?id=65352&edit=1 ID: 65352 Comment by: mail+php at requinix dot net Reported by:seyferseed at mail dot ru Summary:Method Closure::bind() can access private property of object Status: Open Type: Bug Package:Class/Object related Operating System: Linux PHP Version:5.4.17 Block user comment: N Private report: N New Comment: As noted in Closure::bind(), "public static Closure Closure::bind ( Closure $closure , object $newthis [, mixed $newscope = 'static' ] ) newscope The class scope to which associate the closure is to be associated, or 'static' to keep the current one. If an object is given, the type of the object will be used instead. This determines the visibility of protected and private methods of the bound object." You changed the scope of the function to be that of inside $foo. Naturally it would have access to private members. If you don't want it to do that then omit newscope=$object. Previous Comments: [2013-07-29 04:39:42] seyferseed at mail dot ru Description: Method Closure::bind() can access private property of object. And modify it by reference. It is a violation of encapsulation. See script for example. http://3v4l.org/JE0eX Test script: --- $property; }, $object, $object)->__invoke(); return $value; }; $foo = new Foo(); $bar = & $reader($foo, 'bar'); $bar = 'tab'; var_dump($foo); Expected result: Fatal error: Cannot access private property Foo::$bar in /in/JE0eX on line 8 Actual result: -- Output for 5.4.0 - 5.5.1 object(Foo)#2 (1) { ["bar":"Foo":private]=> &string(3) "tab" } -- Edit this bug report at https://bugs.php.net/bug.php?id=65352&edit=1
Req #65296 [Com]: Support named parameters in constructors to inline initialize objects with new()
Edit report at https://bugs.php.net/bug.php?id=65296&edit=1 ID: 65296 Comment by: mail+php at requinix dot net Reported by:llmll at gmx dot de Summary:Support named parameters in constructors to inline initialize objects with new() 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: So object literals. Getting to use names instead of strings. Meanwhile $object = new Object(); $object->StringMember = "content"; // etc doesn't work? Previous Comments: [2013-07-19 20:52:32] llmll at gmx dot de I view as a strength of PHP, not having to declare all fields in a class. For example think of a class representing a HTML DOM element, like a link. It allow many fields, but most often you will only use some of them, like "href" or "class". In my opinion the best syntax to write is something like: $link = new Link(href: "target.html", class:"btn btn-info"); At the moment I use arrays: $link = (new Link)->assign("href" => "target.html", "class" => "btn btn-info"); But the fields in the strings are messy and un-recognizeable. Phpdoc is far too cluttering. Declaring every possible option is pointless for some classes, especially if they are highly dynamic, like derived from a database table. [2013-07-19 17:42:05] mail+php at requinix dot net Keeping in mind that your IDE could not possibly give you support for arbitrary properties on objects, they probably do support the @property phpdoc. Add that to __get/__set and you have /** * @property string $StringMember * @property int $Counter * @property mixed[] $ArrayMember */ class Foo { private $data; public function __construct(array $data) { $this->data = $data; } public function __get($name) { return $this->data[$name]; } public function __set($name, $value) { $this->data[$name] = $value; } } $foo = new Foo([ "StringMember" => "content", "Counter" => 42, "ArrayMember" => ["old" => "way"] ]); $foo-> // should autocomplete/suggest StringMember, Counter, and ArrayMember If you're talking about the {} syntax you used, https://wiki.php.net/rfc/objectarrayliterals [2013-07-19 10:25:40] llmll at gmx dot de typo in summary corrected [2013-07-19 10:20:30] llmll at gmx dot de Description: As PHP does not support *real* overloading by different parameter sets, arrays are being used for dynamic parameters as well as for object initialization in constructors. However arrays use strings as keys, which kills syntax highlighting and refactoring capabilities in IDEs. PHP engine should provide a way to initialize an object inline by dynamically providing parameters to new(). Test script: --- $object = new Object({ StringMember: "content", Counter: 42, ArrayMember: ["old" => "way"] }); Expected result: $object->StringMember = "content"; $object->Counter = 42; $object->ArrayMember = array("old" => "way"); $object->MoreProperties = "stay untouched"; Actual result: -- not possible. -- Edit this bug report at https://bugs.php.net/bug.php?id=65296&edit=1
Bug #64981 [Com]: Email with multiple period in a row fail
Edit report at https://bugs.php.net/bug.php?id=64981&edit=1 ID: 64981 Comment by: mail+php at requinix dot net Reported by:fillmorejd at gmail dot com Summary:Email with multiple period in a row fail Status: Open Type: Bug Package:Filter related Operating System: Mac Mountain Lion PHP Version:5.4.15 Block user comment: N Private report: N New Comment: Multiple consecutive periods in normal email addresses really is invalid. The fact that Gmail supports it does not make it valid. Both RFC 5321 (SMTP) and 5322 (Internet Message Format) paraphrased say: addr-spec = dot-atom "@" domain dot-atom = atext+ ("." atext+)* atext = letters | digits | some symbols not including "." Previous Comments: [2013-06-06 20:33:36] fillmorejd at gmail dot com Description: Email with multiple period in a row fail validation when they are working email. With gmail you can add periods into any email address and it will still deliver. I use this to filter out messages. exam...@gmail.com is the same as exam@gmail.com or exam@gmail.com or exam.p@gmail.com. With one period or if there is a letter or number between period the FILTER_VALIDATE_EMAIL works just fine but if more than one period it fails. Test script: --- https://bugs.php.net/bug.php?id=64981&edit=1
Bug #65172 [Com]: SimpleXMLElement::children() incorrect behavior
Edit report at https://bugs.php.net/bug.php?id=65172&edit=1 ID: 65172 Comment by: mail+php at requinix dot net Reported by:scruoge at gmail dot com Summary:SimpleXMLElement::children() incorrect behavior Status: Open Type: Bug Package:SimpleXML related Operating System: Windows & Linux PHP Version:5.3.26 Block user comment: N Private report: N New Comment: ...Attributes can't have children. If you mean the difference between returning an empty SimpleXMLElement object versus returning null, I can see that as a doc bug: Return Values for children() should say "Returns NULL if called on a SimpleXMLElement object that represents an attribute and not a tag." as it does for attributes(). Previous Comments: [2013-07-01 09:27:51] scruoge at gmail dot com The bug is also reproducible in Linux environment. [2013-07-01 07:58:40] scruoge at gmail dot com There's extra string in the code that should be removed: (line 6) $xres = array_shift($xml->xpath('childNode/@attr')); It does not affect test script result, though it generates E_STRICT notice. [2013-07-01 07:54:26] scruoge at gmail dot com Description: XPath, selecting attribute returns SimpleXMLElement, which's children() method returns NULL. Probably it's a documentation issue. It says "Returns a SimpleXMLElement element, whether the node has children or not." Test script: --- nodeContents'; $xml = new SimpleXMLElement($s); $xpathres = $xml->xpath('childNode/@attr'); $xres = array_shift($xpathres); $xres = array_shift($xml->xpath('childNode/@attr')); echo '$xres->children() result: '; var_dump($xres->children()); echo 'typecast result: '; var_dump((string) $xres); Expected result: $xres->children() result: object(SimpleXMLElement)#2 (0) { } typecast result: string(7) "attrval" Actual result: -- $xres->children() result: NULL typecast result: string(7) "attrval" -- Edit this bug report at https://bugs.php.net/bug.php?id=65172&edit=1
Req #65201 [Com]: Africa/Cairo time off by 1 hour
Edit report at https://bugs.php.net/bug.php?id=65201&edit=1 ID: 65201 Comment by: mail+php at requinix dot net Reported by:easysurf at easysurf dot cc Summary:Africa/Cairo time off by 1 hour Status: Open Type: Feature/Change Request Package:Date/time related Operating System: Window 8 PHP Version:5.5.0 Block user comment: N Private report: N New Comment: Windows/PHP 5.3.26 CLI: ab's code: - putenv() not respected, outputs default (local) time with timezone warnings (getenv() says Cairo, $_ENV says nothing) - manually setting it with "set TZ=Africa/Cairo" on the command line before executing works (getenv() and $_ENV say Cairo) - date_default_timezone_set() instead works easysurf's code: - outputs default (local) time with timezone warnings Ubuntu/PHP 5.3.10: ab's code: - putenv() works - date_default_timezone_set() works easysurf's code: - outputs local+2h with timezone warnings The code does have a bug as ab saw: 1. Grabs the current time as a string according to the current timezone 2. Interprets the string according to the GMT timezone and gets a timestamp 3. Uses the timestamp to output the time in Cairo Net effect is adding 2 hours (Cairo minus GMT) to the current time. Fix: don't do anything at all with GMT and use date_default_timezone_set() instead of putenv(TZ). Like literally All that aside, 5.3 is now EOL and 5.4+ doesn't use TZ. Previous Comments: [2013-07-07 08:17:23] a...@php.net Typing 'time in cairo' into google will show you the same. Anyway, lets see if someone else can reproduce the behavior you describe. [2013-07-06 21:27:02] easysurf at easysurf dot cc The problem is that your site that sends out the time zone for Africa/Cairo is off by an hour. When I tried the above code it is still one hour off. Goto: http://wwp.greenwichmeantime.com/time-zone/africa/egypt/cairo/ You will see that there is a discrepancy between your time and theirs. Also when I watch CNN with a live feed from Cairo with a timestamp, it does not match you time but does match the time that Greenwich sends out. [2013-07-06 09:17:19] a...@php.net I'm not sure what you're trying to do in that script, but i suppose it's a bug in it. You convert from local to GMT and then again. I cannot repro neither with your script nor with a much smaller sample putenv('TZ=Africa/Cairo'); echo date('l g:i A'); Do that two lines work for you? [2013-07-06 02:08:21] easysurf at easysurf dot cc "; echo ""; echo ""; putenv("TZ=$end_tz"); echo date("l g:i A",$start_time)."\n"; echo ""; echo " in $ncity2."; echo ""; echo ""; echo "return to http://www.easysurf.cc/tmnw4.htm>What Time is it now?"; ?> [2013-07-05 07:14:03] a...@php.net Please post a small PHP code snippet and date related INI directives. The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at https://bugs.php.net/bug.php?id=65201 -- Edit this bug report at https://bugs.php.net/bug.php?id=65201&edit=1
Bug #65211 [Com]: file_exists() warns of open_basedir on existing file mis-used as directory
Edit report at https://bugs.php.net/bug.php?id=65211&edit=1 ID: 65211 Comment by: mail+php at requinix dot net Reported by:paolo at schiro dot it Summary:file_exists() warns of open_basedir on existing file mis-used as directory Status: Open Type: Bug Package:Safe Mode/open_basedir Operating System: Linux PHP Version:Irrelevant Block user comment: N Private report: N New Comment: Duplicate of - bug 52065 "Warning about open_basedir restriction while accessing a file as directory" - bug 53041 "is_file() and open_basedir" closed to due no feedback (@pajoye: yes) tl;dr: bug is not about open_basedir itself but rather some code being unable to access the file (rightly so) and the calling code assuming the failure is because of open_basedir. Previous Comments: [2013-07-05 17:05:45] paolo at schiro dot it Description: When open_basedir set file_exists() raise an open_basedir warning when checking a path which permitted by open_basedir but includes an existent file misused as directory. Test script: --- //create a file $fhandle = fopen('existing-file-which-is-not-dir.txt', 'w'); //throw your mind away and use it as a directory if (is_file('existing-file-which-is-not-dir.txt/test.html')) { print "File exists"; } else { print "File does not exist"; } //show the error print_r(error_get_last()); Expected result: is_file should return a FALSE and you should read "File does not exist". Actual result: -- In addition to "File does not exist", you'll get a warning that open_basedir restriction is in effect: -- Edit this bug report at https://bugs.php.net/bug.php?id=65211&edit=1
Req #65296 [Com]: Support named parameters in constructors to inline initialize objects with new()
Edit report at https://bugs.php.net/bug.php?id=65296&edit=1 ID: 65296 Comment by: mail+php at requinix dot net Reported by:llmll at gmx dot de Summary:Support named parameters in constructors to inline initialize objects with new() 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: Keeping in mind that your IDE could not possibly give you support for arbitrary properties on objects, they probably do support the @property phpdoc. Add that to __get/__set and you have /** * @property string $StringMember * @property int $Counter * @property mixed[] $ArrayMember */ class Foo { private $data; public function __construct(array $data) { $this->data = $data; } public function __get($name) { return $this->data[$name]; } public function __set($name, $value) { $this->data[$name] = $value; } } $foo = new Foo([ "StringMember" => "content", "Counter" => 42, "ArrayMember" => ["old" => "way"] ]); $foo-> // should autocomplete/suggest StringMember, Counter, and ArrayMember If you're talking about the {} syntax you used, https://wiki.php.net/rfc/objectarrayliterals Previous Comments: [2013-07-19 10:25:40] llmll at gmx dot de typo in summary corrected [2013-07-19 10:20:30] llmll at gmx dot de Description: As PHP does not support *real* overloading by different parameter sets, arrays are being used for dynamic parameters as well as for object initialization in constructors. However arrays use strings as keys, which kills syntax highlighting and refactoring capabilities in IDEs. PHP engine should provide a way to initialize an object inline by dynamically providing parameters to new(). Test script: --- $object = new Object({ StringMember: "content", Counter: 42, ArrayMember: ["old" => "way"] }); Expected result: $object->StringMember = "content"; $object->Counter = 42; $object->ArrayMember = array("old" => "way"); $object->MoreProperties = "stay untouched"; Actual result: -- not possible. -- Edit this bug report at https://bugs.php.net/bug.php?id=65296&edit=1
Req #64880 [Com]: Perhaps more detail on how to get the value of 'foo' and 'bar' in 'myClass' ?
Edit report at https://bugs.php.net/bug.php?id=64880&edit=1 ID: 64880 Comment by: mail+php at requinix dot net Reported by:lifehome at usociety dot info Summary:Perhaps more detail on how to get the value of 'foo' and 'bar' in 'myClass' ? Status: Open Type: Feature/Change Request Package:*General Issues Operating System: Debian Squeeze PHP Version:Irrelevant Block user comment: N Private report: N New Comment: That function and page are an explanation of the get_class_vars() function and as such merely talk about how to use it. What you need is something that explains objects in PHP as a general subject. http://php.net/language.oop5 Your specific question of how to access $var1 and $var2 from within the class is addressed on the "Properties" page. http://php.net/language.oop5.properties Meanwhile your test script shows something else entirely and is better answered elsewhere: bugs.php.net is strictly for bug reports, not for individual help with problems. You should find yourself an online forum, mailing list, or an offline community for your questions. Previous Comments: [2013-05-20 11:02:12] lifehome at usociety dot info Description: --- >From manual page: >http://www.php.net/function.get-class-vars#refsect1-function.get-class-vars-examples --- I understand the first part, but how do I get the value of 'foo' and 'bar' in the functino of 'myClass" within the class 'myClass'? It's confusing me while the get_class_vars() and get_class()... I'm totally a noob on PHP programming so please point out if I was wrong... Test script: --- ' http://pastebin.com/xGXgnBEd ' -- the class I use === A string returns from the link: 1367502965000:deprecated:abcget:1968194347980167531:ce391600756e455db7a529f11fe6f558 === login)); $api_array = $apinfo['minecraftValues']; $ign = $api_array[2]; $uid = $api_array[4]; echo $ign."; echo $uid; Expected result: abcgetce391600756e455db7a529f11fe6f558 -- Edit this bug report at https://bugs.php.net/bug.php?id=64880&edit=1
Bug #64754 [Com]: pathinfo bug handling extra "."
Edit report at https://bugs.php.net/bug.php?id=64754&edit=1 ID: 64754 Comment by: mail+php at requinix dot net Reported by:jia dot cheng dot wu at gmail dot com Summary:pathinfo bug handling extra "." Status: Open Type: Bug Package:Filesystem function related Operating System: WINDOWS 7 PHP Version:5.3.24 Block user comment: N Private report: N New Comment: pathinfo() is for filenames. Use parse_url() for URLs. Previous Comments: [2013-05-02 05:45:38] jia dot cheng dot wu at gmail dot com Description: Array returned by function pathinfo() contains wrong values when extra "." is introduced in the parameter, even though "." is a valid character of a query string. Test script: --- Expected result: test_url:/test.php?q=hello+this+is+a+test+1.0 array(4) { ["dirname"]=> string(1) "\" ["basename"]=> string(35) "test.php?q=hello+this+is+a+test+1.0" ["extension"]=> string(26) "q=hello+this+is+a+test+1.0" ["filename"]=> string(4) "test" } Actual result: -- test_url:/test.php?q=hello+this+is+a+test+1.0 array(4) { ["dirname"]=> string(1) "\" ["basename"]=> string(35) "test.php?q=hello+this+is+a+test+1.0" ["extension"]=> string(1) "0" ["filename"]=> string(33) "test.php?q=hello+this+is+a+test+1" } -- Edit this bug report at https://bugs.php.net/bug.php?id=64754&edit=1
Bug #64667 [Com]: mb_detect_encoding problem
Edit report at https://bugs.php.net/bug.php?id=64667&edit=1 ID: 64667 Comment by: mail+php at requinix dot net Reported by:jisgro at teliae dot fr Summary:mb_detect_encoding problem Status: Open Type: Bug Package:*General Issues Operating System: Debian Edge PHP Version:5.3.24 Block user comment: N Private report: N New Comment: In general, and in your circumstance, mb_detect_encoding() will return the first encoding that matches. The requirements for "ASCII" are that the bytes are all <0x80 and your file won't match that. Next is "ISO-8859-1" which doesn't really have any requirements at all. And that's the problem: it will always succeed. The array should be arranged with most exclusive (harder to validate) encodings first and most permissive (easier to validate) last. I would start testing with: [UTF-32, UTF-16, UTF-8, ASCII, ???] The problem is what to fall back to. ISO 8859-1, -2, and -15 will always succeed, and Windows-1251 and -1252 will only succeed if the entire string consists of high-byte characters in a certain range. (Why do those two work like that? No clue.) So make a choice: if a string is neither UTF-* nor simple ASCII what do you think it probably is? You're writing code in French so I'm going to guess ISO 8859-15. [UTF-32, UTF-16, UTF-8, ASCII, ISO-8859-15] If you want to go beyond that then you can do some rudimentary character analysis: some byte combinations may make sense in one encoding but not in another. Example: about half of \xA0-\xAF bytes in ISO 8859-1/-15 are symbols but are characters in ISO 8859-2. Previous Comments: [2013-04-18 14:53:50] jisgro at teliae dot fr sorry, the Test script is not very simple, here is a "light version": function convertFileInUTF8($sFileName){ $sFileContent = file_get_contents($sFileName); $tabKnownEncoding = array( 'ASCII' ,'ISO-8859-1' ,'ISO-8859-2' ,'ISO-8859-15' ,'UTF-8' ,'UTF-16' ,'UTF-32' ,'Windows-1251' ,'Windows-1252' ); $sFormat = mb_detect_encoding($sFileContent, $tabKnownEncoding, true); echo "Format : ".$sFormat."\n"; iconv_set_encoding("internal_encoding", "UTF-8"); $sNewContent = iconv($sFormat, 'UTF-8', $sFileContent); //Save file_put_contents($sFileName, $sNewContent); ttt($sFileContent,'<->',$sNewContent); $sFormat = mb_detect_encoding($sNewContent, $tabKnownEncoding, true); echo "Format : ".$sFormat."\n"; [2013-04-18 14:08:56] jisgro at teliae dot fr Description: php 5.3.3 We open a file with ANSII encoding, we set the encoding with the "iconv_set_encoding("internal_encoding", "UTF-8");" function to UTF8 the mb_detect_encoding return before and after the encoding : Format : ISO-8859-1 The function is in the test script, it returns : Format : ISO-8859-1 mystere ééé ééé é éé à à à à à , <-> , ��� ��� � �� � � � � � , Format : ISO-8859-1 Test script: --- function convertirFichierEnUTF8($sNomFichier){ $sContenuFichier = file_get_contents($sNomFichier); if($sContenuFichier == ''){//cas vide et cas erreur de lecture return; } $tabFormatsReconnus = array( 'ASCII' ,'ISO-8859-1' ,'ISO-8859-2' ,'ISO-8859-15' ,'UTF-8' ,'UTF-16' ,'UTF-32' ,'Windows-1251' ,'Windows-1252' ); $sFormat = mb_detect_encoding($sContenuFichier, $tabFormatsReconnus, true); //echo $sNomFichier."\n"; echo "Format : ".$sFormat."\n"; if($sFormat === false){ CLog::trace('Erreur encodage du fichier '.$sNomFichier.' inconnu', 'Conversion fichier', 'Erreur détection encodage', 0, CLog::INIVEAU_ERREUR_CRITIQUE, CConfig::$sEmail_Trace_Erreur); return; } //Les formats suivants n'ont pas besoin de conversion if(in_array($sFormat, array('UTF-8', 'ASCII'))){ return; } iconv_set_encoding("internal_encoding", "UTF-8"); //iconv_set_encoding("output_encoding", "UTF-8"); $sNouveauContenu = iconv($sFormat, 'UTF-8', $sContenuFichier); //Si la conversion a eu un problème if($sNouveauContenu === ''){ CLog::trace('Erreur à la conversion en UTF8 du fichier '.$sNomFichier, 'Conversion fichier',
Bug #64573 [Com]: Confusing open_basedir errors when parent folders are inaccessible
Edit report at https://bugs.php.net/bug.php?id=64573&edit=1 ID: 64573 Comment by: mail+php at requinix dot net Reported by:bradley dot will at gmail dot com Summary:Confusing open_basedir errors when parent folders are inaccessible Status: Open Type: Bug Package:Filesystem function related Operating System: Windows 2008 PHP Version:5.3.23 Block user comment: N Private report: N New Comment: Ah, I remember this bug. The overall problem is that the file access fails and calling code assumes the reason is an open_basedir restriction. See also: - bug 44901 (file does not exist) - bug 52065 and bug 53041 (accessing "foo/bar" where foo is an existing *file*) Previous Comments: [2013-04-03 03:11:41] bradley dot will at gmail dot com Description: Tested on Windows; Linux's behavior is as expected. I'm using a Plesk install but I think this will happen with any similar folder structure. Basically, open_basedir or require_once give confusing error messages when multiple parent folders to the open_basedir have security settings which prevent access. The confusing error messages are pasted under Actual Result; "open_basedir restriction in effect. File() is not within the allowed path(s)" is the first error seen, which is an incorrect error; the file IS within the allowed path. Only the second error message, Operation not permitted, is somewhat accurate. However it is still suboptimal compared to the other error condition: When only the open_basedir itself (and not its parent folder) has security settings which prevent access, the error message is what I would expect. The expected error message is pasted under Expected Result; "Permission denied" is the appropriate error to use when file/folder permissions are preventing access to a file or folder, not "operation not permitted." Test script: --- "; echo shell_exec("whoami")."---\n"; echo htmlentities(shell_exec("cd C:\Program Files (x86)\Parallels\ && dir"))."---\n"; echo htmlentities(shell_exec("cd C:\Program Files (x86)\Parallels\Plesk\ && dir"))."---\n"; echo htmlentities(shell_exec("cd C:\Program Files (x86)\Parallels\Plesk\Additional\ && dir"))."---\n"; echo htmlentities(shell_exec("cd C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\ && dir"))."---\n"; echo htmlentities(shell_exec("cd C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\PEAR\ && dir"))."---\n"; if(isset($_GET["open"])){ if(require_once('C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\PEAR\MDB2.php')){ echo "OPENED\n"; } else {echo "FAILED TO OPEN\n"; } } echo 'Try opening file'; echo ""; Expected result: When any file/folder security setting causes the file to be inaccessible: PHP Warning: require_once(C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\PEAR\MDB2.php): failed to open stream: Permission denied in C:\inetpub\vhosts\server.example.net\site.example.net\siteControllerCommon\test.p hp on line 16 PHP Fatal error: require_once(): Failed opening required 'C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\PEAR\MDB2.php' (include_path='.;./includes;./pear') in C:\inetpub\vhosts\server.example.net\site.example.net\siteControllerCommon\test.p hp on line 16 Actual result: -- When the Additional (including PleskPHP5 folder by inheritance) AND PEAR folders are inaccessible to the user: PHP Warning: require_once(): open_basedir restriction in effect. File(C:/Program Files (x86)/Parallels/Plesk/Additional/PleskPHP5/PEAR/MDB2.php) is not within the allowed path(s): (C:/Inetpub/vhosts/server.example.net\;C:\Windows\Temp\;C:\Program Files (x86)\Parallels\Plesk\Additional\PleskPHP5\PEAR\) in C:\inetpub\vhosts\server.example.net\site.example.net\test.php on line 2 PHP Warning: require_once(C:/Program Files (x86)/Parallels/Plesk/Additional/PleskPHP5/PEAR/MDB2.php): failed to open stream: Operation not permitted in C:\inetpub\vhosts\server.example.net\site.example.net\test.php on line 2 PHP Fatal error: require_once(): Failed opening required 'C:/Program Files (x86)/Parallels/Plesk/Additional/PleskPHP5/PEAR/MDB2.php' (include_path='.;./includes;./pear') i
Req #64437 [Com]: [feature request] log of php writes to local files
Edit report at https://bugs.php.net/bug.php?id=64437&edit=1 ID: 64437 Comment by: mail+php at requinix dot net Reported by:spamik at yum dot pl Summary:[feature request] log of php writes to local files Status: Open Type: Feature/Change Request Package:Filesystem function related PHP Version:5.4.13 Block user comment: N Private report: N New Comment: But a setup shouldn't allow PHP to do anything to files in the first place (with possible exceptions for things like file uploads). Directories should be locked down to 0755 or better, files to 0644 or better, and the web server/PHP running as a very under-privileged user like "nobody". Then there's no risk of creating new files or overwriting code or really any kind of modifications at all. Previous Comments: [2013-03-18 20:23:42] spamik at yum dot pl Only writes to files with selected extensions (by php.ini, like php|htm|html|js) should be logged. [2013-03-15 23:27:01] spamik at yum dot pl Just to clarify that log would actualy be later on used by user land aplications that would scan those files that were writen to. In light of what is happening with php aplications, mass hacks, botnets, people are moving to other languages that are more obscure just for their obscurity. PHP really need to counteract and provide functionality like one I propose. [2013-03-15 23:21:02] spamik at yum dot pl Description: As you probably know there are a lot of security bugs in current world php aplications. Using these bugs attacker executes his own code that writes to a new .php files (usualy) or modyfy existing one - putting there his malicious "botnet zombie" code. It is really hard to quick and efectivly detect changes on filesystem/kernel level, especialy if where are talking about monitoring milions of directories (as in popular shared hosting). I propose making php file write log (to a file defined in php.ini). Operations that write to local files should be logged there (file_put_contents() and all fopen() except 'r' and 'r+' mode) Log should contain: unix_timestampabsolute path of file that used write functionabsolute file of modified file could be '\0' as it can't be in filename anyway. Other solution would be to escape paths as those can contain spaces etc. most of this code should probably go to ext/standard/file.c I've made very very crude implementation of this for myself but that is really bad code because I lack c skills. It actualy seg faults in some cases. So I wont even share it, no point. -- Edit this bug report at https://bugs.php.net/bug.php?id=64437&edit=1
Bug #64314 [Com]: imagettfbbox loads wrong fontname if using ../ and underscore in font name
Edit report at https://bugs.php.net/bug.php?id=64314&edit=1 ID: 64314 Comment by: mail+php at requinix dot net Reported by:ctcrmcou at opm dot gov Summary:imagettfbbox loads wrong fontname if using ../ and underscore in font name Status: Open Type: Bug Package:GD related Operating System: W7 PHP Version:Irrelevant Block user comment: N Private report: N New Comment: This is quite unusual, to see a filename being treated differently depending whether it has an underscore. Can you include a complete, hopefully smallish script demonstrating the problem? That way someone (like me) can grab a handful of font files and look for the cause. Previous Comments: [2013-02-27 20:28:09] ctcrmcou at opm dot gov Description: Assuming a subdirectory named "fonts" contains 30 fonts named font_1.ttf - font_30.ttf, calling imagettfbox with a fontname such as "../fonts/font_10.ttf" loads incorrect font, the number part is somehow being altered and the wrong font is loading. Somehow the combination of ../ and _ in the finename param are screwing things up. This is not a file/font not found error. This is the font that loads font_13.ttf is actually loading font_14.ttf, or font_28.ttf is loading font_10.ttf. I can only guess the underscore is changing the meaning of the number or the number is being converted. Test script: --- Works: $box=imagettfbbox(100,0,"fonts/font_10.ttf","some text"); Doesn't work (wrong font loads): $box=imagettfbbox(100,0,"../fonts/font_10.ttf","some text"); Workaround 1: remove underscore from font names $box=imagettfbbox(100,0,"../fonts/font10.ttf","some text"); Workaround 2: move app that loads font to higher directory level (no ../ in path) $box=imagettfbbox(100,0,"fonts/font_10.ttf","some text"); -- Edit this bug report at https://bugs.php.net/bug.php?id=64314&edit=1
Bug #64294 [Com]: date conversion problem when dst present
Edit report at https://bugs.php.net/bug.php?id=64294&edit=1 ID: 64294 Comment by: mail+php at requinix dot net Reported by:ybrigant at gmail dot com Summary:date conversion problem when dst present Status: Open Type: Bug Package:Date/time related Operating System: linux debian PHP Version:5.3.22 Block user comment: N Private report: N New Comment: 01:00 UTC that is, so 02:00 Europe/Paris. Previous Comments: [2013-02-27 01:26:11] mail+php at requinix dot net DST in Europe ends at 2013-10-27 01:00. By the way, Unix timestamps don't have timezones. [2013-02-25 10:42:18] ybrigant at gmail dot com Sorry, I forgot to add that timestamp provided is in utc timezone. [2013-02-25 09:55:35] ybrigant at gmail dot com Description: COnversion of an utc timestamp to a date in a scpecific timezone, ie EUrope/Paris where we have dst activated in the date example... Test script: --- $timestamp = 1382954400; $date = new \DateTime('@'.$timestamp); $tz = new \DateTimeZone('Europe/Paris'); $date->setTimezone($tz); return $date->format(Y-m-d H:i'); Expected result: 2013-10-28 12:00 Actual result: -- 2013-10-28 11:00 -- Edit this bug report at https://bugs.php.net/bug.php?id=64294&edit=1
Bug #64294 [Com]: date conversion problem when dst present
Edit report at https://bugs.php.net/bug.php?id=64294&edit=1 ID: 64294 Comment by: mail+php at requinix dot net Reported by:ybrigant at gmail dot com Summary:date conversion problem when dst present Status: Open Type: Bug Package:Date/time related Operating System: linux debian PHP Version:5.3.22 Block user comment: N Private report: N New Comment: DST in Europe ends at 2013-10-27 01:00. By the way, Unix timestamps don't have timezones. Previous Comments: [2013-02-25 10:42:18] ybrigant at gmail dot com Sorry, I forgot to add that timestamp provided is in utc timezone. [2013-02-25 09:55:35] ybrigant at gmail dot com Description: COnversion of an utc timestamp to a date in a scpecific timezone, ie EUrope/Paris where we have dst activated in the date example... Test script: --- $timestamp = 1382954400; $date = new \DateTime('@'.$timestamp); $tz = new \DateTimeZone('Europe/Paris'); $date->setTimezone($tz); return $date->format(Y-m-d H:i'); Expected result: 2013-10-28 12:00 Actual result: -- 2013-10-28 11:00 -- Edit this bug report at https://bugs.php.net/bug.php?id=64294&edit=1
Bug #64057 [Com]: substr_replace failed charset utf-8
Edit report at https://bugs.php.net/bug.php?id=64057&edit=1 ID: 64057 Comment by: mail+php at requinix dot net Reported by:ltsujiguchi at gmail dot com Summary:substr_replace failed charset utf-8 Status: Open Type: Bug Package:Strings related Operating System: Ubuntu 12.10 PHP Version:5.4.11 Block user comment: N Private report: N New Comment: Do you have one of those weird editors where shift+space produces something besides a regular space? It may sound stupid and probably won't change anything but try deleting the "LIKE ?" and typing it again carefully. Also stupid and pointless, check that echo bin2hex($cond); ends in "...4c494b45203f". Previous Comments: [2013-01-23 18:21:39] krak...@php.net [joe@fiji php-5.4.6]$ nano 64057.php [joe@fiji php-5.4.6]$ sapi/cli/php 64057.php noticia.noticia_titulo LIKE %é% OR noticia.noticia_conteudo LIKE %é% Anyone else ?? [2013-01-23 17:54:21] ltsujiguchi at gmail dot com Description: I had a problem when i used the substr_replace, using those changes os php.ini: I couldn't find the exact version of my php on the drop, so i put the closest version, but my real version is the 5.4.6. Result expected: noticia.noticia_titulo LIKE %é% OR noticia.noticia_conteudo LIKE %é% Result returned: noticia.noticia_titulo LIKE %é% OR noticia.noticia_conteudo LIKE%é%? Test script: --- $replacement = '%é%'; $cond = 'noticia.noticia_titulo LIKE ? OR noticia.noticia_conteudo LIKE ?'; $posItem = stripos($cond, '?'); $cond = substr_replace($cond, $replacement, $posItem, 1); $posItem = stripos($cond, '?'); $cond = substr_replace($cond, $replacement, $posItem, 1); echo $cond; -- Edit this bug report at https://bugs.php.net/bug.php?id=64057&edit=1
Bug #63853 [Com]: Some of the urls are not added in $url->addchild("loc",$mainurl);
Edit report at https://bugs.php.net/bug.php?id=63853&edit=1 ID: 63853 Comment by: mail+php at requinix dot net Reported by:sachinpkaushik at gmail dot com Summary:Some of the urls are not added in $url->addchild("loc",$mainurl); Status: Open Type: Bug Package:DOM XML related Operating System: Fedora Linux PHP Version:5.4.10 Block user comment: N Private report: N New Comment: Given a modified version of your script where $mainurl is explicitly set to the URL you give (in UTF-8) I get the expected XML. It seems $venueArray has only the one item otherwise you would have discovered a large bug in your code. Are you sure $venueArray and $mainurl have the values you expect? You need to debug your script, and if you discover a real bug in PHP itself while doing so then you can (re)open a bug report with more specific information and something we can actually use to reproduce the problem. Also, this is not the place to get help with your code. Find an online forum or mailing list to ask for assistance. That lets the PHP devs focus on bugs and gives you the personalized feedback you may need. Previous Comments: [2012-12-26 05:20:40] sachinpkaushik at gmail dot com Description: I am trying to generate xml file for sitemap for google tracking of my site url. I have a php file with the code mentioned(Please refer the code sent) which I am running on the command line with no arguments. The code retrieves value in an array $venueArrayfrom the value recieved from the function $venue->getAll() There is a foreach loop which retrieves the value from the array '$venueArray'. In the foreach loop I have added a code to fetch url from array '$venueArray' element 'id':- $mainurl =$venue->getUrl(array("venueId"=>$venueD['id'])); and puts it in the xml tags with the help of the code $url->addchild("loc",$mainurl); and then the contents are appended in the file. It seems that some of the urls are not added (url for example: http://mysite.com/dresden/769112-venue-theater-wechselbad-groÃer-saal) in the following code intended to add urls:- $url->addchild("loc",$mainurl); Please provide me with the solution to my problem as soon as possible and also please let me know the changes which I should do in order to get urls in my xml file. Some of the urls are not added in $url->addchild("loc",$mainurl); Test script: --- addchild("loc",$mainurl); **/ $xmltext = "\nhttp://www.sitemaps.org/schemas/sitemap/0.9\";>"; $xmlobj = simplexml_load_string($xmltext); /** Code to retrieve venue array **/ $venue = new record(); $venueArray=$venue->getAll(); /** End of the Code to retrieve venue array **/ foreach($venueArray as $venueD){ /** Code to retrieve Url from venue array **/ $mainurl =$venue->getUrl(array("venueId"=>$venueD['id'])); /** Example of the url generated http://mysite.com/dresden/769112-venue-theater-wechselbad-groÃer-saal **/ $url= $xmlobj->addChild("url"); $url->addchild("loc",$mainurl); $url->addChild("lastmod",date('Y-m-d')); $url->addChild("changefreq","daily"); $url->addChild("priority","0.9"); $fp=fopen('test.xml',"a"); fwrite($fp,$xmlobj->asXML()); fclose($fp); } ?> Expected result: http://www.sitemaps.org/schemas/sitemap/0.9";> http://mysite.com/dresden/769112-venue-theater-wechselbad-groÃer- saal 2012-12-21 daily 0.9 Actual result: -- http://www.sitemaps.org/schemas/sitemap/0.9";> 2012-12-21 daily 0.9 -- Edit this bug report at https://bugs.php.net/bug.php?id=63853&edit=1
Bug #63862 [Com]: Passing by reference: func($a = $b);
Edit report at https://bugs.php.net/bug.php?id=63862&edit=1 ID: 63862 Comment by: mail+php at requinix dot net Reported by:bobwei9 at hotmail dot com Summary:Passing by reference: func($a = $b); Status: Open Type: Bug Package:Scripting Engine problem Operating System: Mac OS X Mountain Lion PHP Version:master-Git-2012-12-27 (Git) Block user comment: N Private report: N New Comment: FYI: Expected behavior. The "value" of an assignment is just a value and not a reference to a variable, just like how "true?$a:$b" is the value of $a and not actually the variable $a. I don't think it would be so difficult to change that behavior but I'm afraid of the consequences it might have. There's also a more subtle change that would be required for your shorthand to work. Assignment currently propagates the right-most operand: $a=$b=$c is almost equivalent* to $b=$c;$a=$c; and not $b=$c;$a=$b; Unless that changes as well then sort($array=[3,1,2]) would try to sort the [3,1,2] and not $array. * $c is evaluated only once Previous Comments: [2012-12-27 16:57:06] bobwei9 at hotmail dot com Description: I don't know if this should be considered as a bug or as expected behaviour (=> feature request). When passing an assignment to a function which expects a variable as reference like sort(), then an E_STRICT message is issued and nothing has changed. What I want, is that a code like "sort($a = $b);" is executed in the same way as "$a = $b; sort($a);". This could help to reduce the number of little, unnecessary lines. Test script: --- php -r 'sort($array = [3,1,2]); var_dump($array);' Expected result: array(3) { [0]=> int(1) [1]=> int(2) [2]=> int(3) } Actual result: -- Strict Standards: Only variables should be passed by reference in Command line code on line 1 array(3) { [0]=> int(3) [1]=> int(1) [2]=> int(2) } -- Edit this bug report at https://bugs.php.net/bug.php?id=63862&edit=1
Bug #63651 [Com]: preg_replace() returns null for very long string
Edit report at https://bugs.php.net/bug.php?id=63651&edit=1 ID: 63651 Comment by: mail+php at requinix dot net Reported by:magog dot the dot ogre at gmail dot com Summary:preg_replace() returns null for very long string Status: Open Type: Bug Package:PCRE related Operating System: Windows, Unix PHP Version:5.3.19 Block user comment: N Private report: N New Comment: You're hitting the backtrack limit defined as the pcre.backtrack_limit setting. If I up mine to 1000 (10e6) I get a string(80) "Hello worldHello world..." Simply put, your regex is too inefficient to work on that $text. Previous Comments: [2012-11-30 01:46:45] magog dot the dot ogre at gmail dot com Description: I have tested and gotten this error on the following two distros: *5.3.19 for Windows *5.3.8 for SunOS Run the code at the pastebin link I've provided. You will see that PHP is returning null in a preg_replace function! It occurs in both Windows and Unix. I do not know if this is a PHP problem, or a PCRE problem. Test script: --- http://pastebin.com/PBCDexXH Expected result: A string should be outputted Actual result: -- Instead, a NULL result is outputted. -- Edit this bug report at https://bugs.php.net/bug.php?id=63651&edit=1
Bug #63678 [Com]: SplObjectStorage->current() !== current(SplObjectStorage)
Edit report at https://bugs.php.net/bug.php?id=63678&edit=1 ID: 63678 Comment by: mail+php at requinix dot net Reported by:Alex at phpguide dot co dot il Summary:SplObjectStorage->current() !== current(SplObjectStorage) Status: Open Type: Bug Package:SPL related Operating System: debian 6 PHP Version:5.4.9 Block user comment: N Private report: N New Comment: SplObjectStorage provides ->current() as part of the implementation to Iterator/Traversable. If you want to call it directly you may need to obey the Iterator convention of calling ->rewind() first. But doing so only changes the ->current() value to be the object and not null. Even with $blat->rewind() and reset($blat) both key() and current() behave differently. In the example for SplObjectStorage::current() it includes $object = $s->current(); // similar to current($s) so I would also expect them to behave the same. tl;dr with ->rewind() and reset(): key($blat)==null, current($blat)==false $blat->key()==0, $blat->current()==a test object Without ->rewind() and reset(): key($blat)==null, current($blat)==false $blat->key()==0, $blat->current()==null Previous Comments: [2012-12-03 21:07:18] Alex at phpguide dot co dot il Description: $SplObjectStorage->current() returns different value from current($SplObjectStorage). Test script: --- class test { public $val; public function __construct() { $this->val = rand(); } } class blat extends \SplObjectStorage { public function add() { $this->attach(new test()); } } $blat = new blat(); $blat->add(); $blat->add(); $blat->add(); $blat->add(); var_dump($blat->current() === current($blat)); // null === false Expected result: true Actual result: -- false -- Edit this bug report at https://bugs.php.net/bug.php?id=63678&edit=1
Bug #63430 [Com]: xml data parsing bug
Edit report at https://bugs.php.net/bug.php?id=63430&edit=1 ID: 63430 Comment by: mail+php at requinix dot net Reported by:lussenburg_rm at hotmail dot com Summary:xml data parsing bug Status: Open Type: Bug Package:XML Reader Operating System: windows 7 PHP Version:Irrelevant Block user comment: N Private report: N New Comment: Hate to burst your bubble but there's a flaw in your code. The problem occurs when * There is a node before an with no whitespace (ie, a #text) in between * Said node has children * Said node has an entry in $siblings The last two cause a line of code near the bottom if ( $node->hasChildNodes() && ($mode == 1 || $siblings[$node->nodeName]) ) $xml->next(); to fire. next() will skip over the rest of the node and, in lieu of a subsequent #text, advance to the . But at the top of your loop you have a read(). That will skip over the tag and into the following #text (between the and the ). You can confirm this by outputting the node name at the beginning of the loop - before the switch that would skip over it: , then #text, then . It works for me if I change the while loop into a do/while: * $xml->read() before the loop to initialize * flag=false at the start of the loop * the aforementioned line sets flag=$xml->next() * do/while ( flag || $xml->read() ) If you'd like to know more you can email me at this address. Previous Comments: [2012-11-20 20:30:51] lussenburg_rm at hotmail dot com Hi there, This code is for testing purposes so i could learn how XMLReader() works before incorporating it in a RssWebfeed class i've written. In this code the only thing i replace, to work around the bug i got, is the bit that is commented out in this example. 'nosnieuwsalgemeen.xml' is the file I have saved on my pc so i don't have to read it from internet everytime. It is the contents of http://feeds.nos.nl/nosnieuwsalgemeen. Another example is http://www.nasa.gov/rss/breaking_news.rss, but this one doesn't give the bug. In the implementation, I need to get the data that comes before the first into a feed database which identifies different feed id's and its title and description. When i encounter the first these are records that go into a 2nd database which defines items for a particular feed. Here's the code: /* $find = array ( '', '>' ); $repl = array ( '', '','>\r\n' ); */ $file = 'nasa_breaking_news.xml'; $cont = file_get_contents($file); //$cont = str_ireplace($find, $repl, $cont); $nodes = array ( 'rss'=> array( 'version' => 'rss_version' ), 'guid' => true, 'link' => true, 'title' => true, 'description'=> true, 'pubDate'=> true, 'lastBuildDate' => true, 'language' => true, 'image' => true, 'enclosure' => array( 'url' => 'enclosure', 'type' => 'type', 'width' => 'imgwidth' ), 'managingEditor' => true, 'related'=> true, ); $siblings = array ( 'image' => array( 'url' => 'image', 'title' => 'alt', 'link' => 'link', 'description' => 'title' ), ); $xml = new XMLReader(); if ( $xml ) { echo ' xml = new XMLReader() gelukt '; } if ( $xml->xml($cont, THIS_CHARSET, LIBXML_NOERROR|LIBXML_NOWARNING) === true ) { printf( ' xml->open() %s ', $file ); echo ' '; $mode= 0; $element = ''; $itemcount = 0; while ( $xml->read() ) { if ( $xml->name == 'item' ) { switch ( $xml->nodeType ) { case XMLReader::ELEMENT: $itemcount++; $mode = 1; break; case XMLReader::END_ELEMENT: $mode = 0; break; } } $element = ''; switch ( $xml->nodeType ) { case XMLReader::END_ELEMENT: case XMLReader::SIGNIFICANT_WHITESPACE:
Bug #63548 [Com]: Segmentation fault in recursive function
Edit report at https://bugs.php.net/bug.php?id=63548&edit=1 ID: 63548 Comment by: mail+php at requinix dot net Reported by:admin at phpcode dot us Summary:Segmentation fault in recursive function Status: Open Type: Bug Package:Scripting Engine problem Operating System: OpenBSD 5.2 amd64 PHP Version:5.3.18 Block user comment: N Private report: N New Comment: You overflowed the stack. Of course it'll segfault. Previous Comments: [2012-11-17 14:18:34] admin at phpcode dot us Description: I user OpenBSD 5.2 amd64. with php 5.3.17 port from current port tree with small fix to success build it on 5.2 and fix to use latest version. Run test script from CLI and get segfault. Test script: --- #!/usr/local/bin/php -n https://bugs.php.net/bug.php?id=63548&edit=1
Bug #63234 [Com]: DateTime::createFromFormat() with a Unix timestamp can be one day off
Edit report at https://bugs.php.net/bug.php?id=63234&edit=1 ID: 63234 Comment by: mail+php at requinix dot net Reported by:christopher dot jf dot hopper at gmail dot com Summary:DateTime::createFromFormat() with a Unix timestamp can be one day off Status: Open Type: Bug Package:Date/time related Operating System: Linux 2.6.32-220.17.1.el6.i686 PHP Version:5.3.17 Block user comment: N Private report: N New Comment: There's a bug here but it's a little different from how you've described it. Take a careful look at the note attached to the $timezone parameter to DateTime's constructor and its createFromFormat(): "The $timezone parameter and the current timezone are ignored when the $time parameter either is a UNIX timestamp..." When you create $e you specify a timestamp and thus the current timezone is ignored. Completely and utterly ignored. echo $d->getTimezone()->getName() . " <-> " . $e->getTimezone()->getName(); Since the timezone is +0 you get a different formatted time than you originally gave to $d. Thus the bug is more that the constructor doesn't set a timezone at all when really it should - even if it doesn't have any impact on the $time itself. To work around this for now you can set the timezone in $e, or even easier use setTimestamp() as you've shown. Previous Comments: [2012-10-08 06:21:51] christopher dot jf dot hopper at gmail dot com Description: == PHP Version Information == # php --version PHP 5.3.3 (cli) (built: May 7 2012 19:58:17) Copyright (c) 1997-2010 The PHP Group Zend Engine v2.3.0, Copyright (c) 1998-2010 Zend Technologies with Xdebug v2.2.1, Copyright (c) 2002-2012, by Derick Rethans # cat /proc/version Linux version 2.6.32-220.17.1.el6.i686 (mockbu...@c6b5.bsys.dev.centos.org) (gcc version 4.4.6 20110731 (Red Hat 4.4.6-3) (GCC) ) #1 SMP Tue May 15 22:09:39 BST 2012 == Describing The Problem == When using the static method DateTime::createFromFormat() or the new DateTime() constructor to create a DateTime object instance from a Unix Timestamp, the resulting date can be one day out, even though the timestamp is not. To reproduce the bug, run the test script below. Test script: --- getTimestamp() . PHP_EOL; echo $d->format("Y-m-d") . PHP_EOL; $e=new DateTime("@". $d->getTimestamp()); echo $e->getTimestamp() . PHP_EOL; echo $e->format("Y-m-d") . PHP_EOL . PHP_EOL; /* 1354194000 2012-11-30 1354194000 2012-11-29 */ // Bad $d=DateTime::createFromFormat("!Y-m-d H:i:s", "2012-11-30 00:00:00"); echo $d->getTimestamp() . PHP_EOL; echo $d->format("Y-m-d") . PHP_EOL; $e=DateTime::createFromFormat("U", $d->getTimestamp()); echo $e->getTimestamp() . PHP_EOL; echo $e->format("Y-m-d") . PHP_EOL . PHP_EOL; /* 1354194000 2012-11-30 1354194000 2012-11-29 */ // Good $d=DateTime::createFromFormat("!Y-m-d H:i:s", "2012-11-30 00:00:00"); echo $d->getTimestamp() . PHP_EOL; echo $d->format("Y-m-d") . PHP_EOL; $e=new DateTime(); $e->setTimestamp($d->getTimestamp()); echo $e->getTimestamp() . PHP_EOL; echo $e->format("Y-m-d") . PHP_EOL; /* 1354194000 2012-11-30 1354194000 2012-11-30 */ Expected result: 1354194000 2012-11-30 1354194000 2012-11-30 1354194000 2012-11-30 1354194000 2012-11-30 1354194000 2012-11-30 1354194000 2012-11-30 Actual result: -- 1354194000 2012-11-30 1354194000 2012-11-29 1354194000 2012-11-30 1354194000 2012-11-29 1354194000 2012-11-30 1354194000 2012-11-30 -- Edit this bug report at https://bugs.php.net/bug.php?id=63234&edit=1
Req #63471 [Com]: Make properties final on runtime
Edit report at https://bugs.php.net/bug.php?id=63471&edit=1 ID: 63471 Comment by: mail+php at requinix dot net Reported by:daniel at baz-x dot at Summary:Make properties final on runtime Status: Open Type: Feature/Change Request Package:Reflection related Operating System: Any PHP Version:5.4.8 Block user comment: N Private report: N New Comment: There's actually an RFC for an enum type: https://wiki.php.net/rfc/enum. Previous Comments: [2012-11-09 09:59:05] daniel at baz-x dot at Description: I have developed a class that tries to mimic java like enums as much as possible (only the simple ones, see provided urls for the example). The only difficulty I got is that it's still possible to overwrite the static variables which makes the enum quite insecure. As I would like to keep it as much as it's like in java I would like to request for a reflection method to make properties final (at least for the static ones) like ReflectionProperty->setFinal(). Test script: --- Enum class: https://dl.dropbox.com/u/11045888/Enum.php.txt Implementation: https://dl.dropbox.com/u/11045888/QueryType.php.txt -- Edit this bug report at https://bugs.php.net/bug.php?id=63471&edit=1
Bug #63430 [Com]: xml data parsing bug
Edit report at https://bugs.php.net/bug.php?id=63430&edit=1 ID: 63430 Comment by: mail+php at requinix dot net Reported by:lussenburg_rm at hotmail dot com Summary:xml data parsing bug Status: Open Type: Bug Package:XML Reader Operating System: windows 7 PHP Version:Irrelevant Block user comment: N Private report: N New Comment: Even if the input is "faulty" example code is still important. For all we know it's a complex problem you're triggering because of something subtle in your code. I can't reproduce it with feed title feed description Mon, 29 Oct 2012 13:30:00 +0100 item title item description itemlink XML; $reader = new XMLReader(); $reader->xml($xml); // http://www.php.net/manual/en/class.xmlreader.php#88264 function xml2assoc($xml) { removed for brevity } print_r(xml2assoc($reader)); ?> PHP 5.4.3 and libxml 2.7.7 Previous Comments: [2012-11-03 17:23:12] lussenburg_rm at hotmail dot com Description: --- >From manual page: >http://www.php.net/xmlreader.read#refsect1-xmlreader.read-description --- The bug isn't realy in the code so im not including any script here, but it is related to the xml input. For example i'm reading some rss feeds (note that i neither compose, nor responsible for the layout) that look like this: feed title feed description Mon, 29 Oct 2012 13:30:00 +0100 item title item description http://itemlink item title item description http://bla ... Everything was working perfectly fine until i kept getting values from the first 'item title' and 'item description' in the 'feed title' and 'feed description' node values. When i examined the xml data i found out that it only happens when the first tag directly follows the last of the nodes (, , etc) without a carriage return/newline. To work around this, before passing the data to XMLReader::xml(), i replace all occurences of ">" with ">\r\n", which works fine, but maybe it could be resolved so this workaround isn't neccesary anymore. -- Edit this bug report at https://bugs.php.net/bug.php?id=63430&edit=1
Req #63454 [Com]: Inheriting static function with static variable defined in a trait.
Edit report at https://bugs.php.net/bug.php?id=63454&edit=1 ID: 63454 Comment by: mail+php at requinix dot net Reported by:zetruger at gmail dot com Summary:Inheriting static function with static variable defined in a trait. Status: Open Type: Feature/Change Request Package:Class/Object related Operating System: Xubuntu 12.04 PHP Version:5.4.8 Block user comment: N Private report: N New Comment: Seems like a bug: the order of class declarations and var_dumps matters. With class A { ... } var_dump(A::theSameFunc()); class B extends A {} class C extends B {} class D extends C {} class E extends D {} class F extends E {} var_dump(B::theSameFunc()); var_dump(C::theSameFunc()); var_dump(D::theSameFunc()); var_dump(E::theSameFunc()); var_dump(F::theSameFunc()); I get AA, but with class A { ... } class B extends A {} class C extends B {} class D extends C {} var_dump(A::theSameFunc()); var_dump(B::theSameFunc()); var_dump(C::theSameFunc()); var_dump(D::theSameFunc()); class E extends D {} class F extends E {} var_dump(E::theSameFunc()); var_dump(F::theSameFunc()); I get ABCDDD. Previous Comments: [2012-11-07 14:46:48] zetruger at gmail dot com I suppose it's a bug isn't it? Or is it normal behavior? [2012-11-07 14:32:24] larue...@php.net it's not about triat, it's about run-time or compile-time. the following script behavior the same as your test script: output: string(1) "A" string(1) "A" [2012-11-07 13:19:03] zetruger at gmail dot com Description: There is a difference between inheriting static function with static variable defined in a trait of a base class and the same function defined in a base class directly. Test script: --- Expected result: string(1) "A" string(1) "B" string(1) "C" string(1) "D" string(1) "E" string(1) "F" Actual result: -- string(1) "A" string(1) "B" string(1) "C" string(1) "C" string(1) "C" string(1) "C" -- Edit this bug report at https://bugs.php.net/bug.php?id=63454&edit=1
Req #63418 [Com]: intval/strval pass-by-reference
Edit report at https://bugs.php.net/bug.php?id=63418&edit=1 ID: 63418 Comment by: mail+php at requinix dot net Reported by:ilyane at list dot ru Summary:intval/strval pass-by-reference Status: Open Type: Feature/Change Request Package:*General Issues Operating System: Any PHP Version:Irrelevant Block user comment: N Private report: N New Comment: Call-time pass-by-reference has been explicitly removed from 5.4 and had a warning in 5.3. You should not be using it at all. If you don't want an assignment then use typecasting: var_dump( (int)$var ) Previous Comments: [2012-11-02 08:03:14] ilyane at list dot ru Description: --- >From manual page: http://www.php.net/function.intval --- Why not to add pass-by-reference option? That would be such a beautiful thing: intval(&$var); strval(&$var); and so on... Test script: --- $var = "123"; intval(&$var); var_dump($var); //int(123) Expected result: int(123) -- Edit this bug report at https://bugs.php.net/bug.php?id=63418&edit=1
Bug #63092 [Com]: IteratorAggregate interface should allow for getIterator to be static
Edit report at https://bugs.php.net/bug.php?id=63092&edit=1 ID: 63092 Comment by: mail+php at requinix dot net Reported by:slogger at lavabit dot com Summary:IteratorAggregate interface should allow for getIterator to be static Status: Open Type: Bug Package:Class/Object related Operating System: All PHP Version:Irrelevant Block user comment: N Private report: N New Comment: >If following common architectures/design patterns, the following case is quite >common: Not that I've ever seen. You're essentially asking for a built-in registry pattern where one doesn't make sense. There are just too many problems trying to do it that way. This isn't the place for discussion, but if you want magic Iterator behavior then a factory would be a better option. $factory = new ThingFactory(); // implements IteratorAggregate $dog = $factory->create("dog"); // create() adds the object to $this->things $cat = $factory->create("cat"); foreach($factory as $thing) { echo "I was used to create a {$thing->name}\n"; } Previous Comments: [2012-09-14 21:37:59] slogger at lavabit dot com Description: See: http://www.php.net/manual/en/class.iteratoraggregate.php If following common architectures/design patterns, the following case is quite common: // Given a class Thing where the constructor sets a 'name' property // and implements IteratorAggregate: dog = new Thing('dog'); cat = new Thing('cat'); $itty = Thing::getIterator(); foreach($itty as $thing){ echo "{$thing->name} \n"; } // dog // cat However, the current IteratorAggregate does not allow for getIterator() to be static. This seems like a big flaw. Obviously nothing prevents creation of such a static method and NOT implementing IteratorAggregate, but that seems kind of wrong. Obviously the issue of how getIterator should work if it can be either static or non-static is kind of fugly, but I tend to think that it ought to have been static to begin with -- usually you want to iterate types/collections, not an individual thing/instance. Test script: --- // Obviously this is a crude example, but it shows the error. // In a more complex example, $things might be some sort of Iterator, rather // than just an array. class Thing implements IteratorAggregate{ public static $things = array(); public function __construct($name){ $this->name = $name; static::$things[] = $this; } public static function getIterator(){ return static::$things; } } $dog = new Thing('dog'); foreach(Thing::getIterator() as $thing){ echo $thing->name; } Expected result: dog Actual result: -- Fatal error: Cannot make non static method IteratorAggregate::getIterator() static in class Thing in php shell code on line 1 -- Edit this bug report at https://bugs.php.net/bug.php?id=63092&edit=1
Bug #62586 [Com]: version_compare, case sensitivity
Edit report at https://bugs.php.net/bug.php?id=62586&edit=1 ID: 62586 Comment by: mail+php at requinix dot net Reported by:dattaya108 at gmail dot com Summary:version_compare, case sensitivity Status: Open Type: Bug Package:Unknown/Other Function Operating System: Linux PHP Version:5.3.14 Block user comment: N Private report: N New Comment: >Is there a page in the documentation that describes what's a >"PHP-standardized" version number? The description block gives a fairly precise explanation for how version numbers are compared: after a couple character replacements, numeric parts are compared as numbers and non-numeric parts (eg, "alpha" and "rc") are compared according to a hierarchy. >hmm, you can strtolower before compare, I'd prefer this to be a doc problem.. The operator parameter says "This parameter is case-sensitive, so values should be lowercase". Maybe move that somewhere more obvious, like the description or a note? Previous Comments: [2012-07-17 14:53:13] larue...@php.net hmm, you can strtolower before compare, I'd prefer this to be a doc problem.. [2012-07-17 11:09:14] dattaya108 at gmail dot com Wrong test script was provided. Right one: var_dump(version_compare('2.1.0-DEV', '2.1.0-dev', '<')); [2012-07-17 10:58:14] dattaya108 at gmail dot com Is there a page in the documentation that describes what's a "PHP-standardized" version number? [2012-07-17 10:54:02] dattaya108 at gmail dot com Description: Is this behavior intentional? If so, should the bug type be changed to 'documentation problem'? Test script: --- var_dump(version_compare('2.1.0-DEV', '2.1.0-dev')); Expected result: bool(false) Actual result: -- bool(true) -- Edit this bug report at https://bugs.php.net/bug.php?id=62586&edit=1
Bug #62336 [Com]: PHPSESSID changes when access another page
Edit report at https://bugs.php.net/bug.php?id=62336&edit=1 ID: 62336 Comment by: mail+php at requinix dot net Reported by:adelsontads at gmail dot com Summary:PHPSESSID changes when access another page Status: Open Type: Bug Package:Session related Operating System: Linux web525.kinghost.net 3.1.4 PHP Version:Irrelevant Block user comment: N Private report: N New Comment: I promise you this isn't a bug in PHP. Getting Help: http://www.php.net/support.php or Google or an online forum or some other community Previous Comments: [2012-06-15 20:09:34] adelsontads at gmail dot com Description: I made a authorization system that works locally, but when you put into the server in production happens the change of the PHPSESSID value when I change page. All the data are lost on this page, but when I return to the previous page back PHPSESSID the right value. Works locally, why there? Locally this change does not occur because? how do I keep the same PHPSESSID while logged in? -- Edit this bug report at https://bugs.php.net/bug.php?id=62336&edit=1
Bug #62350 [Com]: $HTTP_SERVER_CGI
Edit report at https://bugs.php.net/bug.php?id=62350&edit=1 ID: 62350 Comment by: mail+php at requinix dot net Reported by:postmaster at angosso dot net Summary:$HTTP_SERVER_CGI Status: Open Type: Bug Package:Output Control Operating System: index.php PHP Version:5.3.14 Block user comment: N Private report: N New Comment: How to submit a bug report: https://bugs.php.net/how-to-report.php 1. Title seems irrelevant. 2. Package seems wrong. 3. Description doesn't actually include a description. 4. Description is just a cut-and-paste from the man page on http_build_url. 5. Test script is very incomplete (not to mention the syntax problems). 6. Expected result is... I can't even tell why that's the expected result. 7. Actual result indicates some completely different problem. Previous Comments: [2012-06-18 12:26:14] postmaster at angosso dot net Description: http://u...@www.example.com/pub/index.php?a=b#files";, array( "scheme" => "ftp", "host" => "ftp.angosso.net", "path" => "files/web.config/angosso2", "query" => "a=b" ), HTTP_URL_STRIP_AUTH | HTTP_URL_JOIN_PATH | HTTP_URL_JOIN_QUERY | HTTP_URL_STRIP_FRAGMENT ); ?> Test script: --- http://angos...@www.angosso.net/pub/index.php?a=b#files";, array( "scheme" => "ftp", "host" => "ftp.angosso.net", "path" => "files/web.config/angosso2", "query" => "a=b" ), } */ $res = preg_match("/username=\"([^\"]+)\"/i", $txt, $match); $data['username'] = $match[1]; $res = preg_match('/nonce=\"([^\"]+)\"/i', $txt, $match); $data['nonce'] = $match[1]; $res = preg_match('/nc=([0-9]+)/i', $txt, $match); $data['nc'] = $match[1]; $res = preg_match('/cnonce=\"([^\"]+)\"/i', $txt, $match); $data['cnonce'] = $match[1]; $res = preg_match('/qop=([^,]+)/i', $txt, $match); $data['qop'] = $match[1]; $res = preg_match('/uri=\"([^\"]+)\"/i', $txt, $match); $data['uri'] = $match[1]; $res = preg_match('/response=\"([^\"]+)\"/i', $txt, $match); $data['response'] = $match[1]; //return $needed_parts ? false : $data; return $data; } HTTP_URL_STRIP_AUTH | HTTP_URL_JOIN_PATH | HTTP_URL_JOIN_QUERY | HTTP_URL_STRIP_FRAGMENT ); ?> Expected result: [http://www.angosso.net/pub/home/index.php?=a,arg1,arg2] Actual result: -- HTTP Error 404.0 - Not Found Detailed Error Information Module IIS Web Core NotificationMapRequestHandler Handler StaticFile Error Code 0x80070002 Requested URL http://angosso.net:80/angosso2 Physical Path E:\web\angosso2\angosso2 Logon MethodAnonymous Logon User Anonymous -- Edit this bug report at https://bugs.php.net/bug.php?id=62350&edit=1
Bug #62359 [Com]: __call not called for private __construct when creating a new instance
Edit report at https://bugs.php.net/bug.php?id=62359&edit=1 ID: 62359 Comment by: mail+php at requinix dot net Reported by:vogliadifarniente at gmail dot com Summary:__call not called for private __construct when creating a new instance Status: Open Type: Bug Package:Scripting Engine problem Operating System: Linux (Debian) PHP Version:5.4.4 Block user comment: N Private report: N New Comment: __construct isn't just some special method: it's the constructor. By making it private you are disabling construction outside the class - __call can't be executed because the object can't even be created in the first place. So now you think "Okay, well allow construction if there's a __call". But that's not an option because then any class that has a __call can be constructed regardless of whether the constructor is private. "Okay, then only allow it if __call handles the '__construct' method". But how is PHP supposed to know that? It can't. Plus, now __call doesn't know whether the object has been fully instantiated yet or whether it's executing before then, and that's a headache all by itself. Next idea is making __call execute both statically and as an instance method, but that's not a good idea either: how is __call supposed to know when it's static or not? Don't forget there's __callStatic too. And now we arrive at the idea of making a static method that acts as a special kind of constructor. Which is what getSingleton() does. Previous Comments: [2012-06-18 21:00:02] vogliadifarniente at gmail dot com Description: I'm trying to override the creation of a class instance making __construct private and using the __call method (like the operatornew method of C++). Test script: --- http://pastebin.com/D0k20NiV Expected result: No error and like other example print 32 then 45 then 32. Actual result: -- Fatal error: Call to private MyClass::__construct() from invalid context -- Edit this bug report at https://bugs.php.net/bug.php?id=62359&edit=1
Bug #62218 [Com]: Namespace conflict with Reflection
Edit report at https://bugs.php.net/bug.php?id=62218&edit=1 ID: 62218 Comment by: mail+php at requinix dot net Reported by:titch at tut dot by Summary:Namespace conflict with Reflection Status: Open Type: Bug Package:Class/Object related Operating System: Ubuntu 12.04 PHP Version:5.4.3 Block user comment: N Private report: N New Comment: So not resolved then? Okay. But not a bug. As the error message states, PHP can't find MyProject\ReflectionObject. Because it's not there. It's at \ReflectionObject. a = new \ReflectionObject($this); Read up: php.net/language.namespaces Previous Comments: [2012-06-03 20:15:34] titch at tut dot by sorry, comment "//500 Internal Server Error" was added while posting remove it, cause namespace must be first directive at script but it's doesn't fix problem with Reflection, it just misspast [2012-06-03 20:10:13] titch at tut dot by Description: if namespace defined, ReflectionObject can't find class by name with namespace prefix [Sun Jun 03 22:56:50 2012] [error] [client 127.0.0.1] PHP Fatal error: Class 'MyProject\\ReflectionObject' not found in /var/www/myproject/MyClass.php on line 6 also namespaces doesn't works with ReflectionClass etc. but all those scripts work without namespace Test script: --- //500 Internal Server Error ff(); ?> -- Edit this bug report at https://bugs.php.net/bug.php?id=62218&edit=1
Bug #62206 [Com]: ftp
Edit report at https://bugs.php.net/bug.php?id=62206&edit=1 ID: 62206 Comment by: mail+php at requinix dot net Reported by:subha_sri60 at yahoo dot com Summary:ftp Status: Open Type: Bug Package:FTP related Operating System: windows 7 PHP Version:5.3.13 Block user comment: N Private report: N New Comment: This bug tracker is for bugs with PHP itself. We cannot help you with other problems you may be having. Please take your question to an online forum, mailing list, or other community for assistance. Previous Comments: [2012-06-01 12:12:38] subha_sri60 at yahoo dot com Description: I download FileZillaServer to do ftpprgs.From that point onwards I am not able to run any phpscripts.I am using XampcontrolPanelApplication to run phpscripts.In that one the apache is not starting.Please suggest me what I have to do to run my phpscripts normally and also ftp programs in php -- Edit this bug report at https://bugs.php.net/bug.php?id=62206&edit=1
Bug #62207 [Com]: foreaching bindparam results in all params equaling last value
Edit report at https://bugs.php.net/bug.php?id=62207&edit=1 ID: 62207 Comment by: mail+php at requinix dot net Reported by:mike dot mackintosh at angrystatic dot com Summary:foreaching bindparam results in all params equaling last value Status: Open Type: Bug Package:PDO related Operating System: Ubuntu 12.04 x86_64 PHP Version:5.4.4RC2 Block user comment: N Private report: N New Comment: Er, when you call execute(), not query(). Previous Comments: [2012-06-01 19:49:07] mail+php at requinix dot net Not a bug. bindParam() works the value by-reference, which means you passed it a reference to the $value variable. Not its value at the time you called it. When the loop ends and you call query(), $value will be whatever the last one in the $array was: 1. Use a reference to the item in the array: $stmt2->bindParam($param, $array[$param]); [2012-06-01 14:39:11] mike dot mackintosh at angrystatic dot com Description: I have noticed an issue when working with MySQL and PDO prepare statements. If running a foreach on an array which contains the params for the prepare statement, all params equal the value of the last param in the array. See below. Test script: --- $pdo = new PDO('mysql:dbname=netsec_v2;host=localhost;', 'root', ''); $stmt = $pdo->prepare("CREATE TABLE BugTest ( ID int NOT NULL AUTO_INCREMENT, PRIMARY KEY(ID), ColumnA varchar(15) NOT NULL, ColumnB int NOT NULL )"); $stmt->execute(); $array = array(":ColumnA" => "A", ":ColumnB" => 1); $stmt2 = $pdo->prepare("INSERT INTO BugTest (ColumnA,ColumnB) VALUES (:ColumnA, :ColumnB)"); foreach($array as $param => $value){ $stmt2->bindParam($param, $value); } $stmt2->execute(); $res = $pdo->query("SELECT * FROM BugTest")->fetchAll(PDO::FETCH_ASSOC); var_dump($res); Expected result: ColumnA = A ColumnB = 1 Actual result: -- ColumnA = 1 ColumnB = 1 -- Edit this bug report at https://bugs.php.net/bug.php?id=62207&edit=1
Bug #62207 [Com]: foreaching bindparam results in all params equaling last value
Edit report at https://bugs.php.net/bug.php?id=62207&edit=1 ID: 62207 Comment by: mail+php at requinix dot net Reported by:mike dot mackintosh at angrystatic dot com Summary:foreaching bindparam results in all params equaling last value Status: Open Type: Bug Package:PDO related Operating System: Ubuntu 12.04 x86_64 PHP Version:5.4.4RC2 Block user comment: N Private report: N New Comment: Not a bug. bindParam() works the value by-reference, which means you passed it a reference to the $value variable. Not its value at the time you called it. When the loop ends and you call query(), $value will be whatever the last one in the $array was: 1. Use a reference to the item in the array: $stmt2->bindParam($param, $array[$param]); Previous Comments: [2012-06-01 14:39:11] mike dot mackintosh at angrystatic dot com Description: I have noticed an issue when working with MySQL and PDO prepare statements. If running a foreach on an array which contains the params for the prepare statement, all params equal the value of the last param in the array. See below. Test script: --- $pdo = new PDO('mysql:dbname=netsec_v2;host=localhost;', 'root', ''); $stmt = $pdo->prepare("CREATE TABLE BugTest ( ID int NOT NULL AUTO_INCREMENT, PRIMARY KEY(ID), ColumnA varchar(15) NOT NULL, ColumnB int NOT NULL )"); $stmt->execute(); $array = array(":ColumnA" => "A", ":ColumnB" => 1); $stmt2 = $pdo->prepare("INSERT INTO BugTest (ColumnA,ColumnB) VALUES (:ColumnA, :ColumnB)"); foreach($array as $param => $value){ $stmt2->bindParam($param, $value); } $stmt2->execute(); $res = $pdo->query("SELECT * FROM BugTest")->fetchAll(PDO::FETCH_ASSOC); var_dump($res); Expected result: ColumnA = A ColumnB = 1 Actual result: -- ColumnA = 1 ColumnB = 1 -- Edit this bug report at https://bugs.php.net/bug.php?id=62207&edit=1