Req #62113 [Opn]: ReflectionMethod::invoke && invokeArgs support static binding...

2012-09-12 Thread nath...@php.net
Edit report at https://bugs.php.net/bug.php?id=62113&edit=1

 ID: 62113
 User updated by:nath...@php.net
 Reported by:nath...@php.net
 Summary:ReflectionMethod::invoke && invokeArgs support
 static binding...
 Status: Open
 Type:   Feature/Change Request
 Package:Reflection related
 Operating System:   N/A
 PHP Version:5.4.3
 Block user comment: N
 Private report: N

 New Comment:

* Updated email address for profiling and spam reasons


Previous Comments:

[2012-05-22 21:38:01] nath...@php.net

Description:

I think it'd be useful to be able to set the static binding of a class method 
if 
it's a static method. Currently you can only set the binding if it's not a 
static 
method, but my patch (see below) now will allow you to pass a string or an 
object 
to the ReflectionMethod::invoke and invokeArgs methods allowing you to set the 
static binding of static functions.

The script below will work with the patch in place, but not work with current 
version of PHP because you *must* pass a valid object or null as the first 
argument, but if you are wanting it to call a static method my patch will allow 
you to set the Class the static method will run under.

Test script:
---
 ' .  current((new 
ReflectionClass('C'))->getTraits())->getMethod('static_method')->invoke($this);
$returns[] = 'B => ' .  current((new 
ReflectionClass('C'))->getTraits())->getMethod('static_method')->invoke('B');
$returns[] = 'C => ' .  current((new 
ReflectionClass('C'))->getTraits())->getMethod('static_method')->invoke('C');
$returns[] = 'A => ' .  current((new 
ReflectionClass('C'))->getTraits())->getMethod('static_method')->invoke(null);
$returns[] = 'stdClass => ' .   current((new 
ReflectionClass('C'))->getTraits())->getMethod('static_method')->invoke(new 
stdClass);

$returns[] = 'C => ' .  current((new 
ReflectionClass('C'))->getTraits())->getMethod('static_method')->invokeArgs($this,
 array());
$returns[] = 'B => ' .  current((new 
ReflectionClass('C'))->getTraits())->getMethod('static_method')->invokeArgs('B',
 array());
$returns[] = 'C => ' .  current((new 
ReflectionClass('C'))->getTraits())->getMethod('static_method')->invokeArgs('C',
 array());
$returns[] = 'A => ' .  current((new 
ReflectionClass('C'))->getTraits())->getMethod('static_method')->invokeArgs(null,
 array());

$returns[] = 'C => ' .  current((new 
ReflectionClass('C'))->getTraits())->getMethod('normal_method')->invoke($this);
$returns[] = 'stdClass => ' .   current((new 
ReflectionClass('C'))->getTraits())->getMethod('normal_method')->invoke(new 
stdClass);
$returns[] = 'B => ' .  current((new 
ReflectionClass('C'))->getTraits())->getMethod('normal_method')->invoke(new 
B());

$returns[] = 'C => ' .  current((new 
ReflectionClass('C'))->getTraits())->getMethod('normal_method_this')->invoke($this);
$returns[] = 'stdClass => ' .   current((new 
ReflectionClass('C'))->getTraits())->getMethod('normal_method_this')->invoke(new
 stdClass());
$returns[] = 'B => ' .  current((new 
ReflectionClass('C'))->getTraits())->getMethod('normal_method_this')->invoke(new
 B());

// Normal methods need an object
//$returns[] = current((new 
ReflectionClass('C'))->getTraits())->getMethod('normal_method')->invokeArgs($this,
 array());
//$returns[] = current((new 
ReflectionClass('C'))->getTraits())->getMethod('normal_method')->invoke('B', 
array()); // Error
//$returns[] = current((new 
ReflectionClass('C'))->getTraits())->getMethod('normal_method')->invoke('B', 
array()); // Error
//$re

[PHP-BUG] Bug #64240 [NEW]: Output Buffering does not work with Connection Handling

2013-02-18 Thread nath...@php.net
From: nathanb
Operating system: N/A
PHP version:  5.4.11
Package:  Output Control
Bug Type: Bug
Bug description:Output Buffering does not work with Connection Handling

Description:

While an output buffer is in place the functions connection_aborted() and 
connection_status() will not return proper information. (I have only tested
in 
apache2)

INSTRUCTIONS ON TEST SCRIPT:
In a terminal run "tail -f /tmp/test.tmp" put script in www accessible
directory, 
run the script from a browser and within a second or two stop the
connection or 
close browser. Watch the terminal for actions to take place. (comment out
the 
ob_start() function to see how it should react)

Test script:
---


Expected result:

Conn Closed
Loop itterations: %i



Actual result:
--
Timeout



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