[PHP-BUG] Bug #60175 [NEW]: ob_implicit_flush is brain-damaged or something I dunno

2011-10-30 Thread artificialmagic at hotmail dot com
From: 
Operating system: 
PHP version:  5.3.8
Package:  Output Control
Bug Type: Bug
Bug description:ob_implicit_flush is brain-damaged or something I dunno

Description:

I'm trying to use output buffering in CLI to log output as it's echoed. But
ob_implicit_flush is a bunch of feral cock. Look at this bullpoop:

Test script:
---
ob_start(function ($s) {
return "[" . strlen($s) . "]";
});
ob_implicit_flush(true);
for (;;) echo '.';

Expected result:

[1][1][1][1][1][1][1][1]... ad infinitum

Actual result:
--
Nothing is ever displayed.

Memory usage goes up and up until the script crashes. PHP would be quite
happy apparently to consume additional universes if it could get more
memory out of it to fill with "."'s.

The documentation says "Implicit flushing will result in a flush operation
after every output call". Well maybe it does do that, I don't know, but
whatever it's doing it doesn't generate the result implied by the
documentation. It's a God-damn lie in spirit. I feel betrayed.

Try to specify 1 as the buffer size to ob_start as a workaround. Just TRY
IT, and watch the sheer audacity of the thing as it calmly prints out
[4096][4096][4096][4096][4096][4096] Because apparently some herp-derp
let's-just-add-random-quirks-for-laughs moron at PHP bollocksing years ago
decided 1 = 4 kB. That's a nice idea isn't it. That's real fucking neato.

The best I can get apparently is to specify a buffer size of 2 to ob_start,
which will cause [2][2][2][2][2][2][2][2][2][2]

But that's no fucking good because individual characters won't echo until
another one happens to come along. THIS IS A PROGRAMMING LANGUAGE NOT THE
BUS STOP.

If you can't make ob_implicit_flush do what it blatantly claims it will do
could you at least make -1 to ob_start a synonym for a real 1 so this can
be made to work. Thanks very much. Meanwhile I'll just go and drown myself
in a see of hideous synonym functions ("echo2($boop);",
"var_dump2($blah);"). Don't worry about me, I completely enjoy that.

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



Req #60171 [Com]: Suggestion for new function

2011-10-30 Thread artificialmagic at hotmail dot com
Edit report at https://bugs.php.net/bug.php?id=60171&edit=1

 ID: 60171
 Comment by: artificialmagic at hotmail dot com
 Reported by:invictible at live dot co dot uk
 Summary:Suggestion for new function
 Status: Wont fix
 Type:   Feature/Change Request
 Package:Unknown/Other Function
 Operating System:   Windows
 PHP Version:5.3.8
 Block user comment: N
 Private report: N

 New Comment:

Who would ever think this was useful?


Previous Comments:

[2011-10-30 03:39:46] invictible at live dot co dot uk

Expressions such as >, >+ aka something like the comparison operators except, 
in function form.


[2011-10-30 00:52:48] cataphr...@php.net

This is the purpose of eval (though it would probably be better – including 
versatile – to parse the expression yourself), the "security issues" (really, 
input validation) can be handled by analyzing  the tokens in the strings; see 
token_get_all().

Besides, this request is very vague – for instance it doesn't specify which 
subset of the expressions space would be admissible and gives a rationale for 
it.

Won't fix.


[2011-10-29 21:28:06] invictible at live dot co dot uk

Description:

I've been looking for a solution on PHP as I need some way to evaluate 
expressions within strings.

Since with if:
$str = '5>6';
if($str)
Would evaluate as true regardless of the expression.

A good possible solution for this may be a function for evaluating the 
expressions in the string, eg. evalexp($str); which would return true or false 
based on the expression within the string.

Eval is an alternative however, it can create security issues when used with 
user provided content for obvious reasons.







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


Bug #60175 [Com]: ob_implicit_flush is brain-damaged or something I dunno

2011-10-30 Thread artificialmagic at hotmail dot com
Edit report at https://bugs.php.net/bug.php?id=60175&edit=1

 ID: 60175
 Comment by: artificialmagic at hotmail dot com
 Reported by:artificialmagic at hotmail dot com
 Summary:ob_implicit_flush is brain-damaged or something I
 dunno
 Status: Open
 Type:   Bug
 Package:Output Control
 PHP Version:5.3.8
 Block user comment: N
 Private report: N

 New Comment:

By the way I already tried using a stream filter instead of output buffering, 
adding it with:

stream_filter_append(STDOUT, 'BlahFilter');

and:

stream_filter_append(fopen('php://output', 'wb'), 'BlahFilter');

But it had absolutely no effect. I'd like to say I'm surprised, or even vaguely 
confused, but sane behavior from PHP is rarer than a ST:TOS redshirt that 
survives their first away mission.


Previous Comments:
----------------
[2011-10-30 15:32:27] artificialmagic at hotmail dot com

Description:

I'm trying to use output buffering in CLI to log output as it's echoed. But 
ob_implicit_flush is a bunch of feral cock. Look at this bullpoop:

Test script:
---
ob_start(function ($s) {
return "[" . strlen($s) . "]";
});
ob_implicit_flush(true);
for (;;) echo '.';

Expected result:

[1][1][1][1][1][1][1][1]... ad infinitum

Actual result:
--
Nothing is ever displayed.

Memory usage goes up and up until the script crashes. PHP would be quite happy 
apparently to consume additional universes if it could get more memory out of 
it to fill with "."'s.

The documentation says "Implicit flushing will result in a flush operation 
after every output call". Well maybe it does do that, I don't know, but 
whatever it's doing it doesn't generate the result implied by the 
documentation. It's a God-damn lie in spirit. I feel betrayed.

Try to specify 1 as the buffer size to ob_start as a workaround. Just TRY IT, 
and watch the sheer audacity of the thing as it calmly prints out 
[4096][4096][4096][4096][4096][4096] Because apparently some herp-derp 
let's-just-add-random-quirks-for-laughs moron at PHP bollocksing years ago 
decided 1 = 4 kB. That's a nice idea isn't it. That's real fucking neato.

The best I can get apparently is to specify a buffer size of 2 to ob_start, 
which will cause [2][2][2][2][2][2][2][2][2][2]

But that's no fucking good because individual characters won't echo until 
another one happens to come along. THIS IS A PROGRAMMING LANGUAGE NOT THE BUS 
STOP.

If you can't make ob_implicit_flush do what it blatantly claims it will do 
could you at least make -1 to ob_start a synonym for a real 1 so this can be 
made to work. Thanks very much. Meanwhile I'll just go and drown myself in a 
see of hideous synonym functions ("echo2($boop);", "var_dump2($blah);"). Don't 
worry about me, I completely enjoy that.






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


[PHP-BUG] Req #60243 [NEW]: Add way to specify output buffering chunk size of 1

2011-11-08 Thread artificialmagic at hotmail dot com
From: 
Operating system: 
PHP version:  5.3.8
Package:  Output Control
Bug Type: Feature/Change Request
Bug description:Add way to specify output buffering chunk size of 1

Description:

ob_implicit_flush does not do anything in CLI. This script never produces
output:

ob_start();
ob_implicit_flush(true);
for (;;) echo '.';

A 1-byte buffer would work around it, except that specifying a chunk_size
of 1 to ob_start is taken to mean 4 kilobytes. As a workaround, please make
a chunk_size of -1 to ob_start a synonym for a real 1, so that output
buffering can be used for filtering or for redirection without actual delay
in output. Currently the smallest size that can be specified is 2 bytes,
which can cause a potentially infinite wait for an extra byte.


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



Req #60243 [Com]: Add way to specify output buffering chunk size of 1

2011-11-08 Thread artificialmagic at hotmail dot com
Edit report at https://bugs.php.net/bug.php?id=60243&edit=1

 ID: 60243
 Comment by: artificialmagic at hotmail dot com
 Reported by:artificialmagic at hotmail dot com
 Summary:Add way to specify output buffering chunk size of 1
 Status: Open
 Type:   Feature/Change Request
 Package:Output Control
 PHP Version:5.3.8
 Block user comment: N
 Private report: N

 New Comment:

Here's a proper test script. This produces [4096][4096][4096][4096][4096]...

ob_start(function($x) { return '[' . strlen($x) . ']'; }, 1);
for (;;) echo '.';

So I'd like this to produce [1][1][1][1][1][1]

ob_start(function($x) { return '[' . strlen($x) . ']'; }, -1);
for (;;) echo '.';


Previous Comments:
--------------------
[2011-11-08 15:16:14] artificialmagic at hotmail dot com

Description:

ob_implicit_flush does not do anything in CLI. This script never produces 
output:

ob_start();
ob_implicit_flush(true);
for (;;) echo '.';

A 1-byte buffer would work around it, except that specifying a chunk_size of 1 
to ob_start is taken to mean 4 kilobytes. As a workaround, please make a 
chunk_size of -1 to ob_start a synonym for a real 1, so that output buffering 
can be used for filtering or for redirection without actual delay in output. 
Currently the smallest size that can be specified is 2 bytes, which can cause a 
potentially infinite wait for an extra byte.







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