[PHP-BUG] Req #61277 [NEW]: Feature request: Shared Keyword
From: Operating system: All PHP version: 5.4.0 Package: *General Issues Bug Type: Feature/Change Request Bug description:Feature request: Shared Keyword Description: Feature request: Shared Keyword Declaring class properties as shared makes them accessible for all instances of a PHP script containing the same class name and the same property name. This functionality allows a shared memory access similar to apc_store() and apc_fetch(). The shared property implies the static property. Shared propertes can be accessed without needing an instantiation of the class. If shared is not set for a property, it will be non-shared by default. Shared properties are accessed through the class name or a class name variable or "self", and the Scope Resolution Operator "::". Like any other PHP static variable, shared properties may only be initialized using a literal or constant; expressions are not allowed. So while you may initialize a shared property to an integer or array (for instance), you may not initialize it to another variable, to a function return value, or to an object. Shared memory limit in php.ini: shared_memory_limit = 16M This sets the maximum amount of shared memory in bytes that ALL scripts are allowed to allocate. To have no shared memory limit, set this directive to -1. To have an unlimited shared memory limit, set this directive to 0. When an integer is used, the value is measured in bytes. Shorthand notation may also be used. Shared variables and properties are initialized only in first call of a function/class and every time the shared memory is empty. Scenarios: Caching, performance optimization, counters, progress indicators, parallel queues, etc. Test script: --- Foo.php: static class property https://bugs.php.net/bug.php?id=61277&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=61277&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=61277&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=61277&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=61277&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=61277&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=61277&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=61277&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=61277&r=needscript Try newer version: https://bugs.php.net/fix.php?id=61277&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=61277&r=support Expected behavior: https://bugs.php.net/fix.php?id=61277&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=61277&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=61277&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=61277&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=61277&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=61277&r=dst IIS Stability: https://bugs.php.net/fix.php?id=61277&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=61277&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=61277&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=61277&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=61277&r=mysqlcfg
Req #61277 [Opn]: Feature request: Shared Keyword
Edit report at https://bugs.php.net/bug.php?id=61277&edit=1 ID: 61277 User updated by:thbley at gmail dot com Reported by:thbley at gmail dot com Summary:Feature request: Shared Keyword Status: Open Type: Feature/Change Request Package:*General Issues Operating System: All -PHP Version:5.4.0 +PHP Version:5.5.0 Block user comment: N Private report: N New Comment: update version :-) Previous Comments: [2012-03-04 20:28:49] thbley at gmail dot com Description: Feature request: Shared Keyword Declaring class properties as shared makes them accessible for all instances of a PHP script containing the same class name and the same property name. This functionality allows a shared memory access similar to apc_store() and apc_fetch(). The shared property implies the static property. Shared propertes can be accessed without needing an instantiation of the class. If shared is not set for a property, it will be non-shared by default. Shared properties are accessed through the class name or a class name variable or "self", and the Scope Resolution Operator "::". Like any other PHP static variable, shared properties may only be initialized using a literal or constant; expressions are not allowed. So while you may initialize a shared property to an integer or array (for instance), you may not initialize it to another variable, to a function return value, or to an object. Shared memory limit in php.ini: shared_memory_limit = 16M This sets the maximum amount of shared memory in bytes that ALL scripts are allowed to allocate. To have no shared memory limit, set this directive to -1. To have an unlimited shared memory limit, set this directive to 0. When an integer is used, the value is measured in bytes. Shorthand notation may also be used. Shared variables and properties are initialized only in first call of a function/class and every time the shared memory is empty. Scenarios: Caching, performance optimization, counters, progress indicators, parallel queues, etc. Test script: --- Foo.php: static class property https://bugs.php.net/bug.php?id=61277&edit=1
Req #61277 [Nab]: Feature request: Shared Keyword
Edit report at https://bugs.php.net/bug.php?id=61277&edit=1 ID: 61277 User updated by:thbley at gmail dot com Reported by:thbley at gmail dot com Summary:Feature request: Shared Keyword Status: Not a bug Type: Feature/Change Request Package:*General Issues Operating System: All PHP Version:5.5.0 Block user comment: N Private report: N New Comment: > It is a design decision in PHP not to have such global things in PHP itself. All PHP frameworks are offering some kind of caching with shared disk or shared memory. And I haven't seen a bigger project not using this stuff. It's time to rethink this decision. > - correct locking can be hard I think the way APC does this it, should do it. > - such a feature makes scaling over multiple servers hard It would be enough to have it on one server. For those who want more, can still send the data to memcache. Here is a new example: https://gist.github.com/1975954 Previous Comments: [2012-03-05 00:19:10] johan...@php.net It is a design decision in PHP not to have such global things in PHP itself. Addon modules (you mentioned apc) can add utilities for this, though. Some reasons include: - PHP can be embedded in any application which might add constrains - correct locking can be hard - such a feature makes scaling over multiple servers hard - it messes with copy-on-write - ... [2012-03-04 20:29:34] thbley at gmail dot com update version :-) [2012-03-04 20:28:49] thbley at gmail dot com Description: Feature request: Shared Keyword Declaring class properties as shared makes them accessible for all instances of a PHP script containing the same class name and the same property name. This functionality allows a shared memory access similar to apc_store() and apc_fetch(). The shared property implies the static property. Shared propertes can be accessed without needing an instantiation of the class. If shared is not set for a property, it will be non-shared by default. Shared properties are accessed through the class name or a class name variable or "self", and the Scope Resolution Operator "::". Like any other PHP static variable, shared properties may only be initialized using a literal or constant; expressions are not allowed. So while you may initialize a shared property to an integer or array (for instance), you may not initialize it to another variable, to a function return value, or to an object. Shared memory limit in php.ini: shared_memory_limit = 16M This sets the maximum amount of shared memory in bytes that ALL scripts are allowed to allocate. To have no shared memory limit, set this directive to -1. To have an unlimited shared memory limit, set this directive to 0. When an integer is used, the value is measured in bytes. Shorthand notation may also be used. Shared variables and properties are initialized only in first call of a function/class and every time the shared memory is empty. Scenarios: Caching, performance optimization, counters, progress indicators, parallel queues, etc. Test script: --- Foo.php: static class property https://bugs.php.net/bug.php?id=61277&edit=1
Req #61277 [Nab]: Feature request: Shared Keyword
Edit report at https://bugs.php.net/bug.php?id=61277&edit=1 ID: 61277 User updated by:thbley at gmail dot com Reported by:thbley at gmail dot com Summary:Feature request: Shared Keyword Status: Not a bug Type: Feature/Change Request Package:*General Issues Operating System: All PHP Version:5.5.0 Block user comment: N Private report: N New Comment: I think it shouldn't be a big issue to get a small portion of the apc or memcache code in the core and make it stable. In the end of 2005, there was the decision to include apc in the core. So I think it is not a bad idea to look at this again. Previous Comments: [2012-03-05 03:55:12] ras...@php.net And APC is still not stable and portable enough to include in PHP, so saying to do it like APC doesn't mean much. Doing it like APC means not putting it not the core. And if you want something just like APC, just use APC. Most of the frameworks already do and they include a slower fallback for servers without APC. This is not going to be baked into the object syntax directly since we have all the magic methods you need to hook it in yourself. [2012-03-05 02:26:09] thbley at gmail dot com > It is a design decision in PHP not to have such global things in PHP itself. All PHP frameworks are offering some kind of caching with shared disk or shared memory. And I haven't seen a bigger project not using this stuff. It's time to rethink this decision. > - correct locking can be hard I think the way APC does this it, should do it. > - such a feature makes scaling over multiple servers hard It would be enough to have it on one server. For those who want more, can still send the data to memcache. Here is a new example: https://gist.github.com/1975954 [2012-03-05 00:19:10] johan...@php.net It is a design decision in PHP not to have such global things in PHP itself. Addon modules (you mentioned apc) can add utilities for this, though. Some reasons include: - PHP can be embedded in any application which might add constrains - correct locking can be hard - such a feature makes scaling over multiple servers hard - it messes with copy-on-write - ... -------- [2012-03-04 20:29:34] thbley at gmail dot com update version :-) -------- [2012-03-04 20:28:49] thbley at gmail dot com Description: Feature request: Shared Keyword Declaring class properties as shared makes them accessible for all instances of a PHP script containing the same class name and the same property name. This functionality allows a shared memory access similar to apc_store() and apc_fetch(). The shared property implies the static property. Shared propertes can be accessed without needing an instantiation of the class. If shared is not set for a property, it will be non-shared by default. Shared properties are accessed through the class name or a class name variable or "self", and the Scope Resolution Operator "::". Like any other PHP static variable, shared properties may only be initialized using a literal or constant; expressions are not allowed. So while you may initialize a shared property to an integer or array (for instance), you may not initialize it to another variable, to a function return value, or to an object. Shared memory limit in php.ini: shared_memory_limit = 16M This sets the maximum amount of shared memory in bytes that ALL scripts are allowed to allocate. To have no shared memory limit, set this directive to -1. To have an unlimited shared memory limit, set this directive to 0. When an integer is used, the value is measured in bytes. Shorthand notation may also be used. Shared variables and properties are initialized only in first call of a function/class and every time the shared memory is empty. Scenarios: Caching, performance optimization, counters, progress indicators, parallel queues, etc. Test script: --- Foo.php: static class property https://bugs.php.net/bug.php?id=61277&edit=1
Req #61277 [Nab]: Feature request: Shared Keyword
Edit report at https://bugs.php.net/bug.php?id=61277&edit=1 ID: 61277 User updated by:thbley at gmail dot com Reported by:thbley at gmail dot com Summary:Feature request: Shared Keyword Status: Not a bug Type: Feature/Change Request Package:*General Issues Operating System: All PHP Version:5.5.0 Block user comment: N Private report: N New Comment: Magic methods are nice but checking if the extension is available and enabled, maybe compile it before, implement the whole interface, define some good error handling, include the library, implement the fallback for non-apc, ... a lot of work than could be handled by a one-liner. People love sth. like session_start(); $_SESSION["hello"] = "world"; without knowing all the stuff behind it. Previous Comments: [2012-03-05 05:53:56] ras...@php.net APC will eventually go in, but it is not going to be directly mapped to any sort of special shared keywords. Like I said, there are plenty of ways to map this in userspace via the various magic methods. ---- [2012-03-05 05:44:17] thbley at gmail dot com I think it shouldn't be a big issue to get a small portion of the apc or memcache code in the core and make it stable. In the end of 2005, there was the decision to include apc in the core. So I think it is not a bad idea to look at this again. [2012-03-05 03:55:12] ras...@php.net And APC is still not stable and portable enough to include in PHP, so saying to do it like APC doesn't mean much. Doing it like APC means not putting it not the core. And if you want something just like APC, just use APC. Most of the frameworks already do and they include a slower fallback for servers without APC. This is not going to be baked into the object syntax directly since we have all the magic methods you need to hook it in yourself. -------- [2012-03-05 02:26:09] thbley at gmail dot com > It is a design decision in PHP not to have such global things in PHP itself. All PHP frameworks are offering some kind of caching with shared disk or shared memory. And I haven't seen a bigger project not using this stuff. It's time to rethink this decision. > - correct locking can be hard I think the way APC does this it, should do it. > - such a feature makes scaling over multiple servers hard It would be enough to have it on one server. For those who want more, can still send the data to memcache. Here is a new example: https://gist.github.com/1975954 [2012-03-05 00:19:10] johan...@php.net It is a design decision in PHP not to have such global things in PHP itself. Addon modules (you mentioned apc) can add utilities for this, though. Some reasons include: - PHP can be embedded in any application which might add constrains - correct locking can be hard - such a feature makes scaling over multiple servers hard - it messes with copy-on-write - ... 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=61277 -- Edit this bug report at https://bugs.php.net/bug.php?id=61277&edit=1
[PHP-BUG] Req #62572 [NEW]: Relax syntax by skipping ";" at end of line
From: thbley at gmail dot com Operating system: all PHP version: Irrelevant Package: *General Issues Bug Type: Feature/Change Request Bug description:Relax syntax by skipping ";" at end of line Description: old: $txt1="Hello World!"; $txt2="What a nice day!"; echo $txt1 . " " . $txt2; $i = 1; $j = 2; $k = 3; function hello() { echo "hello world"; } new: $txt1="Hello World!" $txt2="What a nice day!" echo $txt1 . " " . $txt2 $i = 1; $j = 2; $k = 3 function hello() { echo "hello world" } Test script: --- $txt1="Hello World!" $txt2="What a nice day!" echo $txt1 . " " . $txt2 $i = 1; $j = 2; $k = 3 function hello() { echo "hello world" } -- Edit bug report at https://bugs.php.net/bug.php?id=62572&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62572&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62572&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62572&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=62572&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62572&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=62572&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=62572&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=62572&r=needscript Try newer version: https://bugs.php.net/fix.php?id=62572&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=62572&r=support Expected behavior: https://bugs.php.net/fix.php?id=62572&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=62572&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=62572&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=62572&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62572&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=62572&r=dst IIS Stability: https://bugs.php.net/fix.php?id=62572&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=62572&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=62572&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=62572&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=62572&r=mysqlcfg
[PHP-BUG] Req #62573 [NEW]: New String operators
From: thbley at gmail dot com Operating system: PHP version: Irrelevant Package: *General Issues Bug Type: Feature/Change Request Bug description:New String operators Description: ~ = matches substring (contains operator) ^~ = matches beginning of string (begins with operator) ~^ = matches ending of string (ends with operator) $str = "abcdef"; old: if (strpos($str, "bcd")!==false) {} // true if (strpos($str, "abc")===0) {} // true if (strpos($str, "def")===3) {} // true new: if ($str ~ "bcd") {} // true if ($str ^~ "abc") {} // true if ($str ~^ "def") {} // true Test script: --- $str = "abcdef"; assertTrue($str ~ "bcd"); assertTrue($str ^~ "abc"); assertTrue($str ~^ "def"); assertFalse($str ~ "aef"); assertFalse($str ^~ "bcd"); assertFalse($str ~^ "abc"); -- Edit bug report at https://bugs.php.net/bug.php?id=62573&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62573&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62573&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62573&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=62573&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62573&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=62573&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=62573&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=62573&r=needscript Try newer version: https://bugs.php.net/fix.php?id=62573&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=62573&r=support Expected behavior: https://bugs.php.net/fix.php?id=62573&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=62573&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=62573&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=62573&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62573&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=62573&r=dst IIS Stability: https://bugs.php.net/fix.php?id=62573&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=62573&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=62573&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=62573&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=62573&r=mysqlcfg
[PHP-BUG] Req #62574 [NEW]: New operator for htmlspecialchars
From: thbley at gmail dot com Operating system: PHP version: Irrelevant Package: *General Issues Bug Type: Feature/Change Request Bug description:New operator for htmlspecialchars Description: old: new: echo <$str>; ?> or: -- Edit bug report at https://bugs.php.net/bug.php?id=62574&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=62574&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=62574&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=62574&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=62574&r=fixed Fixed in SVN and need be documented: https://bugs.php.net/fix.php?id=62574&r=needdocs Fixed in release: https://bugs.php.net/fix.php?id=62574&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=62574&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=62574&r=needscript Try newer version: https://bugs.php.net/fix.php?id=62574&r=oldversion Not developer issue: https://bugs.php.net/fix.php?id=62574&r=support Expected behavior: https://bugs.php.net/fix.php?id=62574&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=62574&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=62574&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=62574&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=62574&r=php4 Daylight Savings:https://bugs.php.net/fix.php?id=62574&r=dst IIS Stability: https://bugs.php.net/fix.php?id=62574&r=isapi Install GNU Sed: https://bugs.php.net/fix.php?id=62574&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=62574&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=62574&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=62574&r=mysqlcfg
Req #62572 [Opn]: Relax syntax by skipping ";" at end of line
Edit report at https://bugs.php.net/bug.php?id=62572&edit=1 ID: 62572 User updated by:thbley at gmail dot com Reported by:thbley at gmail dot com Summary:Relax syntax by skipping ";" at end of line Status: Open Type: Feature/Change Request Package:*General Issues Operating System: all PHP Version:Irrelevant Block user comment: N Private report: N New Comment: I would try these rules: do ";" if line ends with "\n" and - next token is not "->" and not an operator (-+%...) - "(", "'", "\"" are currently not open on stack and - previous token is not an operator and - start child stack if "function" token comes and - not inside "function|if|while|switch|for|foreach () {" e.g. $test = [ [], function () { // do ";" return "test" // do ";" }, ] // do ";" for must remain: for ($i=0; $i<10; $i++) {} Previous Comments: [2012-07-16 22:07:43] zyss at mail dot zp dot ua Semicolons were invented not by stupid people... It's interesting how would you write without semicolons the following: from($categories) ->orderBy('$v["name"]') ->groupJoin( from($products) ->where('$v["quantity"] > 0') ->orderByDescending('$v["quantity"]') ->thenBy('$v["name"]'), '$v["id"]', '$v["catId"]', 'array("name" => $v["name"], "products" => $e)' ); ??? [2012-07-16 03:36:17] thbley at gmail dot com Description: old: $txt1="Hello World!"; $txt2="What a nice day!"; echo $txt1 . " " . $txt2; $i = 1; $j = 2; $k = 3; function hello() { echo "hello world"; } new: $txt1="Hello World!" $txt2="What a nice day!" echo $txt1 . " " . $txt2 $i = 1; $j = 2; $k = 3 function hello() { echo "hello world" } Test script: --- $txt1="Hello World!" $txt2="What a nice day!" echo $txt1 . " " . $txt2 $i = 1; $j = 2; $k = 3 function hello() { echo "hello world" } -- Edit this bug report at https://bugs.php.net/bug.php?id=62572&edit=1
Req #62572 [Opn]: Relax syntax by skipping ";" at end of line
Edit report at https://bugs.php.net/bug.php?id=62572&edit=1 ID: 62572 User updated by:thbley at gmail dot com Reported by:thbley at gmail dot com Summary:Relax syntax by skipping ";" at end of line Status: Open Type: Feature/Change Request Package:*General Issues Operating System: all PHP Version:Irrelevant Block user comment: N Private report: N New Comment: small correction: - "(", "'", "\"", "[" are currently not open on stack and Previous Comments: -------------------- [2012-07-17 05:30:59] thbley at gmail dot com I would try these rules: do ";" if line ends with "\n" and - next token is not "->" and not an operator (-+%...) - "(", "'", "\"" are currently not open on stack and - previous token is not an operator and - start child stack if "function" token comes and - not inside "function|if|while|switch|for|foreach () {" e.g. $test = [ [], function () { // do ";" return "test" // do ";" }, ] // do ";" for must remain: for ($i=0; $i<10; $i++) {} [2012-07-16 22:07:43] zyss at mail dot zp dot ua Semicolons were invented not by stupid people... It's interesting how would you write without semicolons the following: from($categories) ->orderBy('$v["name"]') ->groupJoin( from($products) ->where('$v["quantity"] > 0') ->orderByDescending('$v["quantity"]') ->thenBy('$v["name"]'), '$v["id"]', '$v["catId"]', 'array("name" => $v["name"], "products" => $e)' ); ??? [2012-07-16 03:36:17] thbley at gmail dot com Description: old: $txt1="Hello World!"; $txt2="What a nice day!"; echo $txt1 . " " . $txt2; $i = 1; $j = 2; $k = 3; function hello() { echo "hello world"; } new: $txt1="Hello World!" $txt2="What a nice day!" echo $txt1 . " " . $txt2 $i = 1; $j = 2; $k = 3 function hello() { echo "hello world" } Test script: --- $txt1="Hello World!" $txt2="What a nice day!" echo $txt1 . " " . $txt2 $i = 1; $j = 2; $k = 3 function hello() { echo "hello world" } -- Edit this bug report at https://bugs.php.net/bug.php?id=62572&edit=1
Req #62573 [Wfx]: New String operators
Edit report at https://bugs.php.net/bug.php?id=62573&edit=1 ID: 62573 User updated by:thbley at gmail dot com Reported by:thbley at gmail dot com Summary:New String operators Status: Wont fix Type: Feature/Change Request Package:*General Issues PHP Version:Irrelevant Block user comment: N Private report: N New Comment: You can also skip == and write equals($str, $str2) like Java does. Helper functions will be slower, need to be defined somewhere, included, namespaced, tested, etc. Operators are good to read and make things easier. Perl does a lot of similar things with =~ and people like it. Previous Comments: [2012-07-23 13:30:43] ni...@php.net It does not make any sense to introduce new operators just to save five characters. If you have to do this really often and/or find strpos unreadable, you can simply define a few helper functions: function contains($str1, $str2) { return false !== strpos($str1, $str2); } function startsWith($str1, $str2) { return 0 === strpos($str1, $str2); } function endsWith($str1, $str2) { return 0 === substr_compare($str1, $str2, -strlen($str2), strlen($str2)); } They have the additional advantage of being more clear than something like ~^. [2012-07-16 03:52:33] thbley at gmail dot com Description: ~ = matches substring (contains operator) ^~ = matches beginning of string (begins with operator) ~^ = matches ending of string (ends with operator) $str = "abcdef"; old: if (strpos($str, "bcd")!==false) {} // true if (strpos($str, "abc")===0) {} // true if (strpos($str, "def")===3) {} // true new: if ($str ~ "bcd") {} // true if ($str ^~ "abc") {} // true if ($str ~^ "def") {} // true Test script: --- $str = "abcdef"; assertTrue($str ~ "bcd"); assertTrue($str ^~ "abc"); assertTrue($str ~^ "def"); assertFalse($str ~ "aef"); assertFalse($str ^~ "bcd"); assertFalse($str ~^ "abc"); -- Edit this bug report at https://bugs.php.net/bug.php?id=62573&edit=1
#44405 [NEW]: Math calculation problem with 1.19 - 1
From: thbley at gmail dot com Operating system: WinVista PHP version: 5.2.5 PHP Bug Type: *General Issues Bug description: Math calculation problem with 1.19 - 1 Description: There seems to be a problem with the numeric calculation: if ( (1.19 - 1) == 0.19 ) { echo "@@"; } The expression "(1.19 - 1) == 0.19" does not evaluate to true. My environments (problem exists on both platforms): WinVista: PHP 5.25 Debian: 5.2.0-8+etch10 Reproduce code: --- if ( (1.19 - 1) == 0.19 ) { echo "@@"; } Expected result: output: @@ Actual result: -- output: -- Edit bug report at http://bugs.php.net/?id=44405&edit=1 -- Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=44405&r=trysnapshot52 Try a CVS snapshot (PHP 5.3): http://bugs.php.net/fix.php?id=44405&r=trysnapshot53 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=44405&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=44405&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=44405&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=44405&r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=44405&r=needscript Try newer version:http://bugs.php.net/fix.php?id=44405&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=44405&r=support Expected behavior:http://bugs.php.net/fix.php?id=44405&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=44405&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=44405&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=44405&r=globals PHP 4 support discontinued: http://bugs.php.net/fix.php?id=44405&r=php4 Daylight Savings: http://bugs.php.net/fix.php?id=44405&r=dst IIS Stability:http://bugs.php.net/fix.php?id=44405&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=44405&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=44405&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=44405&r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=44405&r=mysqlcfg
Bug #51424 [Com]: crypt() function hangs after 3rd call
Edit report at http://bugs.php.net/bug.php?id=51424&edit=1 ID: 51424 Comment by: thbley at gmail dot com Reported by: laacz at laacz dot lv Summary: crypt() function hangs after 3rd call Status: Assigned Type: Bug Package: Strings related Operating System: Ubuntu 9.04 x64 PHP Version: 5.3.2 Assigned To: pajoye New Comment: Same problem on windows (5.3.2 binary, php5apache2_2.dll): Run 2 requests in parallel: for ($i=0; $i<50; $i++) { crypt('a', '_'); } ab -n 1 -c 1 http://localhost/test.php => ~1 second, ok ab -n 2 -c 2 http://localhost/test.php => hangs Previous Comments: [2010-03-29 14:40:38] laacz at laacz dot lv Thank you. Provided fixes this exact bug. [2010-03-29 13:55:26] paj...@php.net Can you try using the attached patch please? It should fix the dead lock. [2010-03-29 13:54:56] paj...@php.net The following patch has been added/updated: Patch Name: Dead_lock_fix_attempt Revision: 1269863696 URL: http://bugs.php.net/patch-display.php?bug=51424&patch=Dead_lock_fix_attempt&revision=1269863696 [2010-03-29 13:27:52] laacz at laacz dot lv Updated backtrace (patch:). [2010-03-29 13:21:47] paj...@php.net Stupid me, you did not call crypt php. Please do it again using: gdb --args php crypt.php or gdb php > run crypt.php > bt The remainder of the comments for this report are too long. To view the rest of the comments, please view the bug report online at http://bugs.php.net/bug.php?id=51424 -- Edit this bug report at http://bugs.php.net/bug.php?id=51424&edit=1
#38854 [NEW]: Can't access database in custom session handler with MySQLi
From: thbley at gmail dot com Operating system: Win32 / XP SP2 PHP version: 5.1.6 PHP Bug Type: MySQLi related Bug description: Can't access database in custom session handler with MySQLi Description: MySQLi connection is broken when using a custom session handler. When using MySQL extension there is no problem. Reproduce code: --- Expected result: Object id #2OK Object id #2O Actual result: -- Object id #2OK Warning: mysqli_query() [function.mysqli-query]: Couldn't fetch mysqli in H:\sgs\src\test_mysqli.php on line 14 -- Edit bug report at http://bugs.php.net/?id=38854&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38854&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38854&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38854&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=38854&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=38854&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=38854&r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=38854&r=needscript Try newer version:http://bugs.php.net/fix.php?id=38854&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=38854&r=support Expected behavior:http://bugs.php.net/fix.php?id=38854&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=38854&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=38854&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=38854&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38854&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=38854&r=dst IIS Stability:http://bugs.php.net/fix.php?id=38854&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=38854&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=38854&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=38854&r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=38854&r=mysqlcfg
#38854 [WFx]: Can't access database in custom session handler with MySQLi
ID: 38854 User updated by: thbley at gmail dot com Reported By: thbley at gmail dot com Status: Wont fix Bug Type: MySQLi related Operating System: Win32 / XP SP2 PHP Version: 5.1.6 New Comment: No. Objects are not destroyed in MySQL, why should they in MySQLi ? session_set_save_handler() would be completely useless. See the code examples of session_set_save_handler() at: http://de.php.net/manual/en/function.session-set-save-handler.php session_write_close() calls would need a huge change in the code. All kinds of die() or exit() would have to be extended with the close call. Using oci8 and pgsql I also don't have the problem. Please fix this. Previous Comments: [2006-09-16 17:30:37] [EMAIL PROTECTED] Objects are destroyed before the session is written. You may call session_write_close() prior shutdown. [2006-09-16 16:43:58] thbley at gmail dot com Description: MySQLi connection is broken when using a custom session handler. When using MySQL extension there is no problem. Reproduce code: --- Expected result: Object id #2OK Object id #2O Actual result: -- Object id #2OK Warning: mysqli_query() [function.mysqli-query]: Couldn't fetch mysqli in H:\sgs\src\test_mysqli.php on line 14 -- Edit this bug report at http://bugs.php.net/?id=38854&edit=1
#38953 [NEW]: unexpected input name of html modified in $_REQUEST
From: thbley at gmail dot com Operating system: Win32 PHP version: 4.4.4 PHP Bug Type: *General Issues Bug description: unexpected input name of html modified in $_REQUEST Description: The name of the input field name gets modified in the $_REQUEST field. Array ( [192_168_0_4] => test ) should be: Array ( [192.168.0.4] => test ) I don't know if it's a bug, but I can't explain it any further by my knowledge. Reproduce code: --- "; print_r($_REQUEST); echo ""; echo "should be:\n"; print_r(array("192.168.0.4"=>"test")); ?> Expected result: Array ( [192.168.0.4] => test ) Actual result: -- Array ( [192_168_0_4] => test ) -- Edit bug report at http://bugs.php.net/?id=38953&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=38953&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=38953&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=38953&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=38953&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=38953&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=38953&r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=38953&r=needscript Try newer version:http://bugs.php.net/fix.php?id=38953&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=38953&r=support Expected behavior:http://bugs.php.net/fix.php?id=38953&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=38953&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=38953&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=38953&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=38953&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=38953&r=dst IIS Stability:http://bugs.php.net/fix.php?id=38953&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=38953&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=38953&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=38953&r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=38953&r=mysqlcfg
#39619 [NEW]: custom session save handler looses current directory
From: thbley at gmail dot com Operating system: WinXP SP2 PHP version: 5.2.0 PHP Bug Type: *General Issues Bug description: custom session save handler looses current directory Description: I'm using a custom session save handler. When the write function is called, the current directory is changed to the apache bin directory. This breaks when using relative paths for storing session data. Reproduce code: --- session_set_save_handler("none","none","read","write","none","none"); session_start(); echo "2 ".getcwd().""; function none() { return true; } function read($id) { echo "1 ".getcwd().""; } function write($id,$val) { echo "3 ".getcwd().""; } Expected result: 1 H:\sgs\src Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at H:\sgs\src\test_session.php:14) in H:\sgs\src\test_session.php on line 5 2 H:\sgs\src 3 H:\sgs\src Actual result: -- 1 H:\sgs\src Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at H:\sgs\src\test_session.php:14) in H:\sgs\src\test_session.php on line 5 2 H:\sgs\src 3 H:\Development\Apache2_php5\bin -- Edit bug report at http://bugs.php.net/?id=39619&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=39619&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=39619&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=39619&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=39619&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=39619&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=39619&r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=39619&r=needscript Try newer version:http://bugs.php.net/fix.php?id=39619&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=39619&r=support Expected behavior:http://bugs.php.net/fix.php?id=39619&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=39619&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=39619&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=39619&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=39619&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=39619&r=dst IIS Stability:http://bugs.php.net/fix.php?id=39619&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=39619&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=39619&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=39619&r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=39619&r=mysqlcfg
#39619 [Fbk->Opn]: custom session save handler looses current directory
ID: 39619 User updated by: thbley at gmail dot com Reported By: thbley at gmail dot com -Status: Feedback +Status: Open Bug Type: Session related Operating System: WinXP SP2 PHP Version: 5.2.0 New Comment: Yes adding session_write_close() works but this means I need to call it every time I call exit(), die(), return etc. ... not very comfortable for bigger programs. The documentation doesn't state the directory change, see http://de.php.net/manual/en/function.session-set-save-handler.php Previous Comments: [2006-11-24 15:04:41] [EMAIL PROTECTED] Please add session_write_close() to the end of the script and see if it works for you. [2006-11-24 14:59:18] thbley at gmail dot com Description: I'm using a custom session save handler. When the write function is called, the current directory is changed to the apache bin directory. This breaks when using relative paths for storing session data. Reproduce code: --- session_set_save_handler("none","none","read","write","none","none"); session_start(); echo "2 ".getcwd().""; function none() { return true; } function read($id) { echo "1 ".getcwd().""; } function write($id,$val) { echo "3 ".getcwd().""; } Expected result: 1 H:\sgs\src Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at H:\sgs\src\test_session.php:14) in H:\sgs\src\test_session.php on line 5 2 H:\sgs\src 3 H:\sgs\src Actual result: -- 1 H:\sgs\src Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at H:\sgs\src\test_session.php:14) in H:\sgs\src\test_session.php on line 5 2 H:\sgs\src 3 H:\Development\Apache2_php5\bin -- Edit this bug report at http://bugs.php.net/?id=39619&edit=1
#39619 [Bgs->Opn]: custom session save handler looses current directory
ID: 39619 User updated by: thbley at gmail dot com Reported By: thbley at gmail dot com -Status: Bogus +Status: Open Bug Type: Session related Operating System: WinXP SP2 PHP Version: 5.2.0 New Comment: So can you update the documentation on http://www.php.net/manual/en/function.session-set-save-handler.php ? I think this would save the people a lot of time if they know that they have to use absolute paths here. Previous Comments: [2006-11-24 15:20:01] [EMAIL PROTECTED] The fact that ext/session is affected by shutdown order sequence is a known problem, but unfortunately noone is willing to rewrite ext/session from scratch, which is most likely required to get this problem fixed. [2006-11-24 15:13:04] thbley at gmail dot com Yes adding session_write_close() works but this means I need to call it every time I call exit(), die(), return etc. ... not very comfortable for bigger programs. The documentation doesn't state the directory change, see http://de.php.net/manual/en/function.session-set-save-handler.php [2006-11-24 15:04:41] [EMAIL PROTECTED] Please add session_write_close() to the end of the script and see if it works for you. [2006-11-24 14:59:18] thbley at gmail dot com Description: I'm using a custom session save handler. When the write function is called, the current directory is changed to the apache bin directory. This breaks when using relative paths for storing session data. Reproduce code: --- session_set_save_handler("none","none","read","write","none","none"); session_start(); echo "2 ".getcwd().""; function none() { return true; } function read($id) { echo "1 ".getcwd().""; } function write($id,$val) { echo "3 ".getcwd().""; } Expected result: 1 H:\sgs\src Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at H:\sgs\src\test_session.php:14) in H:\sgs\src\test_session.php on line 5 2 H:\sgs\src 3 H:\sgs\src Actual result: -- 1 H:\sgs\src Warning: session_start() [function.session-start]: Cannot send session cache limiter - headers already sent (output started at H:\sgs\src\test_session.php:14) in H:\sgs\src\test_session.php on line 5 2 H:\sgs\src 3 H:\Development\Apache2_php5\bin -- Edit this bug report at http://bugs.php.net/?id=39619&edit=1
#41786 [NEW]: Setting lastmodified file time with touch gives unexpexted values
From: thbley at gmail dot com Operating system: WinXP SP2 PHP version: 5.2.3 PHP Bug Type: Date/time related Bug description: Setting lastmodified file time with touch gives unexpexted values Description: When I try to set the last modified time of two files to the same value, I get different values. Date configuration: (php default, nothing changed, I'm living in Europe/Berlin) date date/time support enabled Timezone Database Version 2006.16 Timezone Database internal Default timezoneEurope/Paris Directive Local Value Master Value date.default_latitude 31.7667 31.7667 date.default_longitude 35.2333 35.2333 date.sunrise_zenith 90.58 90.58 date.sunset_zenith 90.58 90.58 date.timezone no valueno value Reproduce code: --- \n"; echo filemtime("c:/test2.txt")."\n"; echo date("d.m.Y H:i:s",filemtime("c:/test1.txt"))."\n"; echo date("d.m.Y H:i:s",filemtime("c:/test2.txt"))."\n"; ?> Expected result: 1171818000 1171818000 18.02.2007 18:00:00 18.02.2007 18:00:00 or 1171821600 1171821600 18.02.2007 19:00:00 18.02.2007 19:00:00 Actual result: -- 1171821600 1171818000 18.02.2007 19:00:00 18.02.2007 18:00:00 -- Edit bug report at http://bugs.php.net/?id=41786&edit=1 -- Try a CVS snapshot (PHP 4.4): http://bugs.php.net/fix.php?id=41786&r=trysnapshot44 Try a CVS snapshot (PHP 5.2): http://bugs.php.net/fix.php?id=41786&r=trysnapshot52 Try a CVS snapshot (PHP 6.0): http://bugs.php.net/fix.php?id=41786&r=trysnapshot60 Fixed in CVS: http://bugs.php.net/fix.php?id=41786&r=fixedcvs Fixed in release: http://bugs.php.net/fix.php?id=41786&r=alreadyfixed Need backtrace: http://bugs.php.net/fix.php?id=41786&r=needtrace Need Reproduce Script:http://bugs.php.net/fix.php?id=41786&r=needscript Try newer version:http://bugs.php.net/fix.php?id=41786&r=oldversion Not developer issue: http://bugs.php.net/fix.php?id=41786&r=support Expected behavior:http://bugs.php.net/fix.php?id=41786&r=notwrong Not enough info: http://bugs.php.net/fix.php?id=41786&r=notenoughinfo Submitted twice: http://bugs.php.net/fix.php?id=41786&r=submittedtwice register_globals: http://bugs.php.net/fix.php?id=41786&r=globals PHP 3 support discontinued: http://bugs.php.net/fix.php?id=41786&r=php3 Daylight Savings: http://bugs.php.net/fix.php?id=41786&r=dst IIS Stability:http://bugs.php.net/fix.php?id=41786&r=isapi Install GNU Sed: http://bugs.php.net/fix.php?id=41786&r=gnused Floating point limitations: http://bugs.php.net/fix.php?id=41786&r=float No Zend Extensions: http://bugs.php.net/fix.php?id=41786&r=nozend MySQL Configuration Error:http://bugs.php.net/fix.php?id=41786&r=mysqlcfg
[PHP-BUG] Req #63533 [NEW]: new php.ini flag disable_execute
From: thbley at gmail dot com Operating system: all PHP version: 5.5.0alpha1 Package: *Configuration Issues Bug Type: Feature/Change Request Bug description:new php.ini flag disable_execute Description: add new flag to php.ini: disable_execute = On|Off (default: On?) which is the same as: disable_functions = exec,shell_exec,passthru,system,popen,proc_open,pcntl_exec => make secure configuration easier -- Edit bug report at https://bugs.php.net/bug.php?id=63533&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63533&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63533&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63533&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=63533&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=63533&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=63533&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=63533&r=needscript Try newer version: https://bugs.php.net/fix.php?id=63533&r=oldversion Not developer issue:https://bugs.php.net/fix.php?id=63533&r=support Expected behavior: https://bugs.php.net/fix.php?id=63533&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=63533&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=63533&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=63533&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63533&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=63533&r=dst IIS Stability: https://bugs.php.net/fix.php?id=63533&r=isapi Install GNU Sed:https://bugs.php.net/fix.php?id=63533&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=63533&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=63533&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=63533&r=mysqlcfg
[PHP-BUG] Req #63534 [NEW]: new php.ini flag disable_remote_download
From: thbley at gmail dot com Operating system: any PHP version: 5.5.0alpha1 Package: *Configuration Issues Bug Type: Feature/Change Request Bug description:new php.ini flag disable_remote_download Description: Disable downloading content only from remote computers: disable_remote_download = On|Off (default: On?) disable_remote_download = On forbids fopen("http://www.php.net/";, "r"); or fopen("http://69.147.83.199/";, "r"); or the IPv6 equivalent disable_remote_download = On allows fopen("http://localhost/";, "r"); or fopen("http://127.0.0.1/";, "r"); or the IPv6 equivalent affects: url-fopen-wrappers, (p)fsockopen, socket_bind, curl extension, imap extension, others? -- Edit bug report at https://bugs.php.net/bug.php?id=63534&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63534&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63534&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63534&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=63534&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=63534&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=63534&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=63534&r=needscript Try newer version: https://bugs.php.net/fix.php?id=63534&r=oldversion Not developer issue:https://bugs.php.net/fix.php?id=63534&r=support Expected behavior: https://bugs.php.net/fix.php?id=63534&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=63534&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=63534&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=63534&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63534&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=63534&r=dst IIS Stability: https://bugs.php.net/fix.php?id=63534&r=isapi Install GNU Sed:https://bugs.php.net/fix.php?id=63534&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=63534&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=63534&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=63534&r=mysqlcfg
Req #62574 [Opn]: New operator for htmlspecialchars
Edit report at https://bugs.php.net/bug.php?id=62574&edit=1 ID: 62574 User updated by:thbley at gmail dot com Reported by:thbley at gmail dot com Summary:New operator for htmlspecialchars Status: Open Type: Feature/Change Request Package:*General Issues PHP Version:Irrelevant Block user comment: N Private report: N New Comment: So we have these use cases: - output unmodified content - output htmlspecialchars escaped content or - output strip_tags - output intval Previous Comments: [2012-12-05 23:12:57] chuyu at microsoft dot com I was thinking the same thing. One advantage of using some template engines(twig, phptal) is that they automatically escape html characters during output. Many people use these template engine simply for that due to XSS worries. However if we have such an operator, then we create a simple php native template engine(which I'm all for), and in the template always use this operator to prevent XSS. I would suggest to make the operator like , the reason is that ~ is often located near the 'ESC' on the keyboard, so it feels more like escape :-) [2012-10-26 19:24:31] ajf at ajf dot me @dagguh: What? I'm just suggesting exporting variables into the global namespace, and escaping them in the process, for templating purposes. [2012-10-26 19:07:08] dagguh at gmail dot com This is valid. @ajf: You should never dop anything "ahead-of-time" in programming. You shoudl escape a variable right before passing it to en environment, that requires this form of escaping [2012-09-04 18:15:37] ajf at ajf dot me (I'm all for this though, I'm just pointing out other options) [2012-09-04 18:06:32] ajf at ajf dot me You can escape things ahead-of-time, you know. In fact, I have a feeling you could use foreach to traverse the symtable and escape everything. (don't do that though, that's a horrendous idea) 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=62574 -- Edit this bug report at https://bugs.php.net/bug.php?id=62574&edit=1
Req #62574 [Opn]: New operator for htmlspecialchars
Edit report at https://bugs.php.net/bug.php?id=62574&edit=1 ID: 62574 User updated by:thbley at gmail dot com Reported by:thbley at gmail dot com Summary:New operator for htmlspecialchars Status: Open Type: Feature/Change Request Package:*General Issues PHP Version:Irrelevant Block user comment: N Private report: N New Comment: and maybe: - output htmlspecialchars+basename Previous Comments: [2012-12-05 23:26:45] thbley at gmail dot com So we have these use cases: - output unmodified content - output htmlspecialchars escaped content or - output strip_tags - output intval [2012-12-05 23:12:57] chuyu at microsoft dot com I was thinking the same thing. One advantage of using some template engines(twig, phptal) is that they automatically escape html characters during output. Many people use these template engine simply for that due to XSS worries. However if we have such an operator, then we create a simple php native template engine(which I'm all for), and in the template always use this operator to prevent XSS. I would suggest to make the operator like , the reason is that ~ is often located near the 'ESC' on the keyboard, so it feels more like escape :-) [2012-10-26 19:24:31] ajf at ajf dot me @dagguh: What? I'm just suggesting exporting variables into the global namespace, and escaping them in the process, for templating purposes. [2012-10-26 19:07:08] dagguh at gmail dot com This is valid. @ajf: You should never dop anything "ahead-of-time" in programming. You shoudl escape a variable right before passing it to en environment, that requires this form of escaping [2012-09-04 18:15:37] ajf at ajf dot me (I'm all for this though, I'm just pointing out other options) 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=62574 -- Edit this bug report at https://bugs.php.net/bug.php?id=62574&edit=1
[PHP-BUG] Req #63798 [NEW]: Add dbname to mysqli_prop
From: thbley at gmail dot com Operating system: win7 x64 PHP version: 5.5.0alpha1 Package: MySQLi related Bug Type: Feature/Change Request Bug description:Add dbname to mysqli_prop Description: The properties of the Mysqli object already contain server-info, server-version, errors, etc., but not the current (selected) database. It would be great if dbname could be added to mysqli properties. With the property it gets easier to check if the right database was selected or if none was selected. Test script: --- PHP code looks like this: class mysqli_db extends mysqli { public function __construct($host=null, $user=null, $pw=null, $db=null) { call_user_func_array("parent::__construct", func_get_args()); $this->db = $db; } // same for real_connect() ... public function select_db($db) { parent::select_db($db); $this->db = $db; } } $db = new mysqli_db('127.0.0.1', 'root', '', 'test'); echo $db->db; // test $db->select_db('test2'); echo $db->db; // test2 -- Edit bug report at https://bugs.php.net/bug.php?id=63798&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63798&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63798&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63798&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=63798&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=63798&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=63798&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=63798&r=needscript Try newer version: https://bugs.php.net/fix.php?id=63798&r=oldversion Not developer issue:https://bugs.php.net/fix.php?id=63798&r=support Expected behavior: https://bugs.php.net/fix.php?id=63798&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=63798&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=63798&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=63798&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63798&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=63798&r=dst IIS Stability: https://bugs.php.net/fix.php?id=63798&r=isapi Install GNU Sed:https://bugs.php.net/fix.php?id=63798&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=63798&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=63798&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=63798&r=mysqlcfg
[PHP-BUG] Req #63799 [NEW]: Make interface for prepared statements easier
From: thbley at gmail dot com Operating system: win7 x64 PHP version: 5.5.0alpha1 Package: MySQLi related Bug Type: Feature/Change Request Bug description:Make interface for prepared statements easier Description: Please offer an easier interface to run prepared statements, e.g. $db = new mysqli_db('127.0.0.1', 'root', 'some_pw', 'test'); foreach ($db->query('select * from bla where someint=? and somechar=?', MYSQLI_STORE_RESULT, [10, 'hello_world']) as $row) {...} -- Edit bug report at https://bugs.php.net/bug.php?id=63799&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63799&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63799&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63799&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=63799&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=63799&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=63799&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=63799&r=needscript Try newer version: https://bugs.php.net/fix.php?id=63799&r=oldversion Not developer issue:https://bugs.php.net/fix.php?id=63799&r=support Expected behavior: https://bugs.php.net/fix.php?id=63799&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=63799&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=63799&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=63799&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63799&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=63799&r=dst IIS Stability: https://bugs.php.net/fix.php?id=63799&r=isapi Install GNU Sed:https://bugs.php.net/fix.php?id=63799&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=63799&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=63799&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=63799&r=mysqlcfg
Req #63799 [Opn]: Make interface for prepared statements easier
Edit report at https://bugs.php.net/bug.php?id=63799&edit=1 ID: 63799 User updated by:thbley at gmail dot com Reported by:thbley at gmail dot com Summary:Make interface for prepared statements easier Status: Open Type: Feature/Change Request Package:MySQLi related Operating System: win7 x64 PHP Version:5.5.0alpha1 Block user comment: N Private report: N New Comment: or sprintf-style instead of auto-detection: foreach ($db->query('select * from bla where someint=%d and somechar=%s', MYSQLI_STORE_RESULT, [10, 'hello_world']) as $row) {...} Previous Comments: [2012-12-18 21:27:07] thbley at gmail dot com Description: Please offer an easier interface to run prepared statements, e.g. $db = new mysqli_db('127.0.0.1', 'root', 'some_pw', 'test'); foreach ($db->query('select * from bla where someint=? and somechar=?', MYSQLI_STORE_RESULT, [10, 'hello_world']) as $row) {...} -- Edit this bug report at https://bugs.php.net/bug.php?id=63799&edit=1
[PHP-BUG] Bug #63980 [NEW]: object members get trimmed by zero bytes
From: thbley at gmail dot com Operating system: Win64 PHP version: 5.5.0alpha2 Package: *General Issues Bug Type: Bug Bug description:object members get trimmed by zero bytes Description: Array keys are not trimmed by zero bytes. (ok) Object member names are trimmed by zero bytes. (bug) Test script: --- $arr = ["abc\0def" => "abc\0def"]; print_r($arr); print_r((object)$arr); Expected result: Array ( [abc def] => abc def ) stdClass Object ( [abc def] => abc def ) Actual result: -- Array ( [abc def] => abc def ) stdClass Object ( [abc] => abc def ) -- Edit bug report at https://bugs.php.net/bug.php?id=63980&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=63980&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=63980&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=63980&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=63980&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=63980&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=63980&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=63980&r=needscript Try newer version: https://bugs.php.net/fix.php?id=63980&r=oldversion Not developer issue:https://bugs.php.net/fix.php?id=63980&r=support Expected behavior: https://bugs.php.net/fix.php?id=63980&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=63980&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=63980&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=63980&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=63980&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=63980&r=dst IIS Stability: https://bugs.php.net/fix.php?id=63980&r=isapi Install GNU Sed:https://bugs.php.net/fix.php?id=63980&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=63980&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=63980&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=63980&r=mysqlcfg
Bug #63980 [Fbk->Opn]: object members get trimmed by zero bytes
Edit report at https://bugs.php.net/bug.php?id=63980&edit=1 ID: 63980 User updated by:thbley at gmail dot com Reported by:thbley at gmail dot com Summary:object members get trimmed by zero bytes -Status: Feedback +Status: Open Type: Bug Package:*General Issues Operating System: Win64 -PHP Version:5.5.0alpha2 +PHP Version:5.5.0alpha3-nts Block user comment: N Private report: N New Comment: Thanks, var_dump() works. But it would be great if get_object_vars() and foreach() could be fixed. Here is a more detailed test: $arr = ["abc\0def" => "abc\0def"]; $obj = (object)$arr; print_r($arr); // ok echo "\n"; var_dump($obj); // ok echo "\n"; echo serialize($obj); // ok echo "\n"; echo (int)property_exists($obj, "abc"); // ok echo "\n"; echo (int)isset($obj->{"abc"}); // ok echo "\n"; echo json_encode($obj); // ok echo "\n"; var_dump((array)$obj); // ok echo "\n"; var_export($obj); // bug echo "\n"; print_r($obj); // bug echo "\n"; debug_zval_dump($obj); // bug echo "\n"; var_dump(get_object_vars($obj)); // bug echo "\n"; echo get_object_vars($obj)["abc"]; // bug echo "\n"; foreach ($obj as $key=>$val) { echo $key." : ".$val."\n"; // bug } Previous Comments: [2013-01-13 12:55:01] larue...@php.net it's due to print_r specific behavior for object's properties... if you use var_dump instead, you will see it's not trimmed. [2013-01-13 02:33:33] thbley at gmail dot com Description: Array keys are not trimmed by zero bytes. (ok) Object member names are trimmed by zero bytes. (bug) Test script: --- $arr = ["abc\0def" => "abc\0def"]; print_r($arr); print_r((object)$arr); Expected result: Array ( [abc def] => abc def ) stdClass Object ( [abc def] => abc def ) Actual result: -- Array ( [abc def] => abc def ) stdClass Object ( [abc] => abc def ) -- Edit this bug report at https://bugs.php.net/bug.php?id=63980&edit=1
Bug #63980 [Csd]: object members get trimmed by zero bytes
Edit report at https://bugs.php.net/bug.php?id=63980&edit=1 ID: 63980 User updated by:thbley at gmail dot com Reported by:thbley at gmail dot com Summary:object members get trimmed by zero bytes Status: Closed Type: Bug Package:*General Issues Operating System: Win64 PHP Version:5.5.0alpha3-nts Assigned To:laruence Block user comment: N Private report: N New Comment: Windows snapshots are currently not available, so I tried php5.5-201301151230 on Ubuntu and it works, thanks a lot! Previous Comments: [2013-01-14 08:32:55] larue...@php.net The fix for this bug has been committed. Snapshots of the sources are packaged every three hours; this change will be in the next snapshot. You can grab the snapshot at http://snaps.php.net/. For Windows: http://windows.php.net/snapshots/ Thank you for the report, and for helping us make PHP better. [2013-01-14 08:24:36] larue...@php.net Automatic comment on behalf of laruence Revision: http://git.php.net/?p=php-src.git;a=commit;h=62059c16ee2f2802caa00f2aad2fa44c867dd1f1 Log: Fixed bug #63980 (object members get trimmed by zero bytes) [2013-01-14 08:23:58] larue...@php.net Automatic comment on behalf of laruence Revision: http://git.php.net/?p=php-src.git;a=commit;h=62059c16ee2f2802caa00f2aad2fa44c867dd1f1 Log: Fixed bug #63980 (object members get trimmed by zero bytes) [2013-01-14 03:44:57] larue...@php.net The following patch has been added/updated: Patch Name: bug63980.patch Revision: 1358135097 URL: https://bugs.php.net/patch-display.php?bug=63980&patch=bug63980.patch&revision=1358135097 [2013-01-13 16:07:18] thbley at gmail dot com Thanks, var_dump() works. But it would be great if get_object_vars() and foreach() could be fixed. Here is a more detailed test: $arr = ["abc\0def" => "abc\0def"]; $obj = (object)$arr; print_r($arr); // ok echo "\n"; var_dump($obj); // ok echo "\n"; echo serialize($obj); // ok echo "\n"; echo (int)property_exists($obj, "abc"); // ok echo "\n"; echo (int)isset($obj->{"abc"}); // ok echo "\n"; echo json_encode($obj); // ok echo "\n"; var_dump((array)$obj); // ok echo "\n"; var_export($obj); // bug echo "\n"; print_r($obj); // bug echo "\n"; debug_zval_dump($obj); // bug echo "\n"; var_dump(get_object_vars($obj)); // bug echo "\n"; echo get_object_vars($obj)["abc"]; // bug echo "\n"; foreach ($obj as $key=>$val) { echo $key." : ".$val."\n"; // 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=63980 -- Edit this bug report at https://bugs.php.net/bug.php?id=63980&edit=1
[PHP-BUG] Req #64043 [NEW]: extend get_object_vars() with 2nd parameter for scope
From: thbley at gmail dot com Operating system: any PHP version: 5.5.0alpha2 Package: *General Issues Bug Type: Feature/Change Request Bug description:extend get_object_vars() with 2nd parameter for scope Description: old: array get_object_vars ( object $object ) new: array get_object_vars ( object $object [, int SCOPE_PUBLIC | SCOPE_SELF ] ) get_object_vars($obj); // return by current scope (same as before) get_object_vars($obj, SCOPE_PUBLIC); // return public members, ignore current scope get_object_vars($obj, SCOPE_SELF); // return public, private, protected members, ignore current scope -- Edit bug report at https://bugs.php.net/bug.php?id=64043&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64043&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64043&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64043&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=64043&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=64043&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=64043&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=64043&r=needscript Try newer version: https://bugs.php.net/fix.php?id=64043&r=oldversion Not developer issue:https://bugs.php.net/fix.php?id=64043&r=support Expected behavior: https://bugs.php.net/fix.php?id=64043&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=64043&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=64043&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=64043&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64043&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=64043&r=dst IIS Stability: https://bugs.php.net/fix.php?id=64043&r=isapi Install GNU Sed:https://bugs.php.net/fix.php?id=64043&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=64043&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=64043&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=64043&r=mysqlcfg
[PHP-BUG] Req #64242 [NEW]: Extend date() formats with week number of year, weeks starting on Sunday
From: thbley at gmail dot com Operating system: ANY PHP version: 5.5.0alpha4 Package: Date/time related Bug Type: Feature/Change Request Bug description:Extend date() formats with week number of year, weeks starting on Sunday Description: Extend date() formats like W ISO-8601 week number of year, weeks starting on Monday with V week number of year, weeks starting on Sunday Example: date("W V", strtotime("2012-12-30")); // 52 53 date("W V", strtotime("2012-12-31")); // 01 53 E.g. MySQL has date_format() formats: %VWeek (01..53), where Sunday is the first day of the week; used with %X %vWeek (01..53), where Monday is the first day of the week; used with %x -- Edit bug report at https://bugs.php.net/bug.php?id=64242&edit=1 -- Try a snapshot (PHP 5.4): https://bugs.php.net/fix.php?id=64242&r=trysnapshot54 Try a snapshot (PHP 5.3): https://bugs.php.net/fix.php?id=64242&r=trysnapshot53 Try a snapshot (trunk): https://bugs.php.net/fix.php?id=64242&r=trysnapshottrunk Fixed in SVN: https://bugs.php.net/fix.php?id=64242&r=fixed Fixed in release: https://bugs.php.net/fix.php?id=64242&r=alreadyfixed Need backtrace: https://bugs.php.net/fix.php?id=64242&r=needtrace Need Reproduce Script: https://bugs.php.net/fix.php?id=64242&r=needscript Try newer version: https://bugs.php.net/fix.php?id=64242&r=oldversion Not developer issue:https://bugs.php.net/fix.php?id=64242&r=support Expected behavior: https://bugs.php.net/fix.php?id=64242&r=notwrong Not enough info: https://bugs.php.net/fix.php?id=64242&r=notenoughinfo Submitted twice: https://bugs.php.net/fix.php?id=64242&r=submittedtwice register_globals: https://bugs.php.net/fix.php?id=64242&r=globals PHP 4 support discontinued: https://bugs.php.net/fix.php?id=64242&r=php4 Daylight Savings: https://bugs.php.net/fix.php?id=64242&r=dst IIS Stability: https://bugs.php.net/fix.php?id=64242&r=isapi Install GNU Sed:https://bugs.php.net/fix.php?id=64242&r=gnused Floating point limitations: https://bugs.php.net/fix.php?id=64242&r=float No Zend Extensions: https://bugs.php.net/fix.php?id=64242&r=nozend MySQL Configuration Error: https://bugs.php.net/fix.php?id=64242&r=mysqlcfg