#49343 [NEW]: Deprecated: Call-time pass-by-reference for non-object?

2009-08-23 Thread hack988 at gmail dot com
From: hack988 at gmail dot com
Operating system: Windows 2003 SP2
PHP version:  6SVN-2009-08-24 (snap)
PHP Bug Type: Scripting Engine problem
Bug description:  Deprecated: Call-time pass-by-reference for non-object?

Description:

Call-time pass-by-reference for non-object Variables is Deprecated?
We can use word "new" with Call-time pass-by-value for object,but how to
use  pass-by-reference in Call-time for non-object Variables like
int,string,array?

Reproduce code:
---
$a=1;
$b=$a;
$c=&$a;
$a='cc';
tt($c);
echo $b."";
echo $c."";

echo "pass by value"."";
tt(&$c);
echo $b."";
echo $c;
function tt($aa){
$aa="erety";
}

Expected result:

Deprecated: Call-time pass-by-reference has been deprecated in
F:\Programming\Web\php\mykernel\test\arg\fun_ref_time.php on line 11
1
cc
pass by value
1
eretyPHP Deprecated: Call-time pass-by-reference has been deprecated in
F:\Programming\Web\php\mykernel\test\arg\fun_ref_time.php on line 11 

Actual result:
--
how can i used Call-time pass-by-value for non-object Variables ?

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



#49342 [NEW]: gnu_cmp doesn't work with decimal strings

2009-08-23 Thread scott at connerly dot net
From: scott at connerly dot net
Operating system: Linux
PHP version:  5.2.10
PHP Bug Type: GNU MP related
Bug description:  gnu_cmp doesn't work with decimal strings

Description:

gnu_cmp doesn't work with decimal strings



Reproduce code:
---
---
>From manual page: function.gmp-cmp
---

$integers = gmp_cmp('2','5');
$floats = gmp_cmp('2.5','5');

var_dump($integers,$floats);

Expected result:

both should return -1

Actual result:
--
int(-1)
bool(false)


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



#49341 [NEW]: add SO_REUSEPORT support for socket_set_option()

2009-08-23 Thread jolan at gormsby dot com
From: jolan at gormsby dot com
Operating system: OpenBSD 4.6-current
PHP version:  5.2.10
PHP Bug Type: Feature/Change Request
Bug description:  add SO_REUSEPORT support for socket_set_option()

Description:

SO_REUSEPORT is needed to allow separate processes to bind to the same 
port. Add the following to ext/sockets/sockets.c after SO_REUSEADDR:

#ifdef SO_REUSEPORT
   REGISTER_LONG_CONSTANT("SO_REUSEPORT",  SO_REUSEPORT,   CONST_CS 
| CONST_PERSISTENT);
#endif

I believe SO_REUSEPORT is not available under Windows, hence the ifdef.


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



#49340 [NEW]: Signals not catcable when certain functions are in execution

2009-08-23 Thread alexmontoanelli at gmail dot com
From: alexmontoanelli at gmail dot com
Operating system: Linux
PHP version:  5.2.10
PHP Bug Type: PCNTL related
Bug description:  Signals not catcable when certain functions are in execution

Description:

After executions of certain functions,
the handler configured by
posix_singal, are not called where the 
funcion are in execution - like freads.

Reproduce code:
---
#!/usr/bin/php
http://bugs.php.net/?id=49340&edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=49340&r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=49340&r=trysnapshot53
Try a snapshot (PHP 6.0):
http://bugs.php.net/fix.php?id=49340&r=trysnapshot60
Fixed in SVN:
http://bugs.php.net/fix.php?id=49340&r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=49340&r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=49340&r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=49340&r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=49340&r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=49340&r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=49340&r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=49340&r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=49340&r=notenoughinfo
Submitted twice: 
http://bugs.php.net/fix.php?id=49340&r=submittedtwice
register_globals:
http://bugs.php.net/fix.php?id=49340&r=globals
PHP 4 support discontinued:  http://bugs.php.net/fix.php?id=49340&r=php4
Daylight Savings:http://bugs.php.net/fix.php?id=49340&r=dst
IIS Stability:   
http://bugs.php.net/fix.php?id=49340&r=isapi
Install GNU Sed: 
http://bugs.php.net/fix.php?id=49340&r=gnused
Floating point limitations:  
http://bugs.php.net/fix.php?id=49340&r=float
No Zend Extensions:  
http://bugs.php.net/fix.php?id=49340&r=nozend
MySQL Configuration Error:   
http://bugs.php.net/fix.php?id=49340&r=mysqlcfg



#49339 [NEW]: PREG_BAD_UTF8_ERROR should emit E_NOTICE

2009-08-23 Thread strata_ranger at hotmail dot com
From: strata_ranger at hotmail dot com
Operating system: *
PHP version:  5.2.10
PHP Bug Type: PCRE related
Bug description:  PREG_BAD_UTF8_ERROR should emit E_NOTICE

Description:

This is not a PHP bug, but a suggestion that would help with
troubleshooting PCRE calls in one's own PHP scripts.

When using the /u modifier in PCRE, if the subject string contains an
invalid Unicode sequence, this generates a PREG_BAD_UTF8_ERROR (which can
be retrieved using preg_last_error() ).  This is expected behavior for
PCRE, but it should also emit an E_NOTICE to the user because it could
indicate an error in their script (the definition of an E_NOTICE).

Specifically, when using preg_replace() in an assignment context (i.e:
$subject = preg_replace($foo, $bar, $subject) ), this can create situations
where a PREG_BAD_UTF8_ERROR causes the subject string to be "erased"
(re-assigned NULL) if the script author didn't take time to ensure that
their subject string was valid utf-8 before calling preg_replace().

Even though it's the fault of the script author, the preg_* functions
should still at least emit an E_NOTICE about bad UTF-8; it's a pain to hunt
through one's proverbial 'miles of code' to figure out why one of their
variables suddenly 'disappeared', without a file name or line number to
start the troubleshooting by.

Workarounds available in the meantime are:

// As of PHP 5.3
// (unless the replacement yields string '0')
$string = preg_replace(..., $string) ?: $string; // As of PHP 5.3

// Other workaround (any PHP version)
$string = is_string($repl=preg_replace(..., $string))? $repl : string;


Reproduce code:
---
---
>From manual page: reference.pcre.pattern.modifiers
---
error_reporting(-1); // Emit all errors

$subject = "fa\xa0ade"; // Valid in ISO-8859-1 (but not UTF-8!)

// Causes a PREG_BAD_UTF8_ERROR and sets $subject to NULL.
// And we didn't make a copy of the original $subject.  Oops!
$subject = preg_replace('//u', '', $subject);

var_dump($string); // NULL
var_dump(preg_last_error());

---


Actual result:
--
preg_replace() returns NULL; checking preg_last_error() verifies a
PREG_BAD_UTF8_ERROR.  No errors, warnings, or notices of any kind were
generated.
We did, however, immediately assign the preg_replace() back to $subject,
so $subject is now NULL and has lost whatever data it originally contained.
 Even though this was obviously our fault, an E_NOTICE would have told us
about it.

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



#49338 [Opn->Fbk]: when fopen is used without the second parameter, php segfaults in apache 2.2

2009-08-23 Thread scottmac
 ID:   49338
 Updated by:   scott...@php.net
 Reported By:  ttessier at swhistlesoft dot com
-Status:   Open
+Status:   Feedback
 Bug Type: Filesystem function related
 Operating System: solaris 10
 PHP Version:  5.2.10
 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a backtrace to see what is happening behind the scenes. To
find out how to generate a backtrace, please read
http://bugs.php.net/bugs-generating-backtrace.php for *NIX and
http://bugs.php.net/bugs-generating-backtrace-win32.php for Win32

Once you have generated a backtrace, please submit it to this bug
report and change the status back to "Open". Thank you for helping
us make PHP better.




Previous Comments:


[2009-08-23 16:17:17] ttessier at swhistlesoft dot com

Description:

When fopen is used without the second parameter, php segfaults in
apache 2.2. I had this happen two times, once when I was using bcompiler
and once when I was using xml_parser. I thought that the issue was the
other modules until I realized that I was missing the second parameter
to fopen. 

I was doing a test on the returned value to check for validity such as
if ( $fh ) or if ( is_resource ( $fh ) ) and was unable to see any
warnings.

Once I removed the test and any interior blocks to the filehandle test
from the code, I was able to see a warning. I fixed the issue and have
been working solid since. 

Reproduce code:
---
$regionf = 'regions.xml' ;
$fregions = fopen ( $regionf ) ;
if ( $fregions ){
echo "File Opened" ;
$xmldoc = fread ( $fregions, filesize ( $regionf ) ) ;
$parser = xml_parser_create  ( ) ;
if ( $parser ){
xml_parser_set_option($parser,XML_OPTION_TARGET_ENCODING, "UTF-8");
   xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,1); 
   xml_parse ( $parser, $doc ) ;
   xml_parse_into_struct($parser, trim($xmldoc), $xml_values);
   print_r ( $xml_values ) ;
   xml_parser_free ( $parser ) ;
}
fclose ( $fregions ) ;
}

Expected result:

apache segfault -  browser displays previous content ( cache )






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



#49338 [NEW]: when fopen is used without the second parameter, php segfaults in apache 2.2

2009-08-23 Thread ttessier at swhistlesoft dot com
From: ttessier at swhistlesoft dot com
Operating system: solaris 10
PHP version:  5.2.10
PHP Bug Type: Filesystem function related
Bug description:  when fopen is used without the second parameter, php 
segfaults in apache 2.2

Description:

When fopen is used without the second parameter, php segfaults in apache
2.2. I had this happen two times, once when I was using bcompiler and once
when I was using xml_parser. I thought that the issue was the other modules
until I realized that I was missing the second parameter to fopen. 

I was doing a test on the returned value to check for validity such as if
( $fh ) or if ( is_resource ( $fh ) ) and was unable to see any warnings.

Once I removed the test and any interior blocks to the filehandle test
from the code, I was able to see a warning. I fixed the issue and have been
working solid since. 

Reproduce code:
---
$regionf = 'regions.xml' ;
$fregions = fopen ( $regionf ) ;
if ( $fregions ){
echo "File Opened" ;
$xmldoc = fread ( $fregions, filesize ( $regionf ) ) ;
$parser = xml_parser_create  ( ) ;
if ( $parser ){
xml_parser_set_option($parser,XML_OPTION_TARGET_ENCODING, "UTF-8");
   xml_parser_set_option($parser,XML_OPTION_SKIP_WHITE,1); 
   xml_parse ( $parser, $doc ) ;
   xml_parse_into_struct($parser, trim($xmldoc), $xml_values);
   print_r ( $xml_values ) ;
   xml_parser_free ( $parser ) ;
}
fclose ( $fregions ) ;
}

Expected result:

apache segfault -  browser displays previous content ( cache )


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



#49328 [Bgs]: __call is not able to handle private functions in extended classes

2009-08-23 Thread rayro at gmx dot de
 ID:   49328
 User updated by:  rayro at gmx dot de
 Reported By:  rayro at gmx dot de
 Status:   Bogus
 Bug Type: Class/Object related
 Operating System: Windows XP
 PHP Version:  5.3.0
 New Comment:

Ok for now, this is more a feature request than a bug i think... ^^
Just gimme a try to explain it, thanks :)

i talk about how class abstraction can be extended with such nice
features like the __call->private issue described in this submission.

My idea was that every method/property defined not abstracted in an
abstract class should be a template/pattern for the extended class,
giving the full control to redefine it but acting like a default without
loosing the context in the extended class.

With this change it would be possible to define private methods in
abstract classes that are redefineable, except for methods defined as
final.
All magic methods defined in the abstract class should only run in
context of the extended class, since it does never make sense for me
that they got context of the abstract class. With this change it will be
possible to e.g. create magic methods or normal methods that "act like
defined" in the extended class.

to 3) on one side, it is a nice feature to build a object tree having
control to the higher static properties from the class, on the other
side it will create negative side effects if setting this variable in
the extended class. I think that this behaviour should be removed, since
it makes much more sense to talk to the parent::$static, not to the
self::$static... Here too, it makes sense to allow the abstract
definition of statics, so the owner is requestet to redefine the
variable. Same for class constant like self::VERSION, that should be
redefined in the extended class...
Look at this example that uses references, where the static reference
is lost, as it should work in abstraction. It is much like the last
example, except the reference to a global variable here:

Reproduce code:
---
abstract class Foo {
static public $test;
}
class Bar extends Foo {

}
$my_variable = 'test';
Foo::$test =& $my_variable;
var_dump(Foo::$test);
var_dump(Bar::$test);
Bar::$test = 'baz';
var_dump(Foo::$test);
var_dump(Bar::$test);

Expected result:

string(4) "test"
string(4) "test"
string(3) "baz"
string(3) "baz"

Actual result:
--
string(4) "test"
NULL
string(4) "test"
string(3) "baz"


Previous Comments:


[2009-08-22 22:51:31] col...@php.net

Well, with your last example you're pointing to a totally different
problem composed of 3 PHP facts:

1) you cannot dynamically define static properties
2) static properties are strictly bound to the class in which they are
defined
3) Access to undefined static properties fallback to their parent
class.

IMO, (3) is highly arguable, but it has nothing to do with the problem
at hand.



[2009-08-22 20:57:44] rayro at gmx dot de

Spending time sorting my brain, i agree with the conclusion that the
context is not the same while extending a _class_, and i have to use
protected methods here, but this is an _abstract class_?
It is not really intelligible for me that abstract classes gaining a
context while their not instantiable, nor i'm convinced of the
abstraction design over all. :/
In my opinion, the context of the abstracted class should "fully"
relate to the context of the extending class. Furthermore statically
definitions should render in the class scope/context, and none static
calls should result in an error if called on abstracted class (as it is
with class vars).
The definition of (not abstracted) functions in a abstract class should
ever run in the context of the extended class, so theres no lsb
necessary (e.g. __CLASS__ resolves to the classname of the extended
class).
Surely a topic to talk about?

The following abstract class predefines the static property and method,
but the result should vary towards a normal class definition.

Reproduce code:
---
abstract class Foo {
public static $text;
public static function test() {
var_dump('get_called_class(): '.get_called_class());
var_dump(static::$text);
}
}
class Bar extends Foo { }
Foo::$text = '1';
Foo::test();
Bar::test();
Bar::$text = '2';
Foo::test();
Bar::test();

Expected result:

string(23) "get_called_class(): Foo"
string(1) "1"
string(23) "get_called_class(): Bar"
NULL
string(23) "get_called_class(): Foo"
string(1) "1"
string(23) "get_called_class(): Bar"
string(1) "2"

Actual result:
--
string(23) "get_called_class(): Foo"
string(1) "1"
string(23) "get_called_class(): Bar"
string(1) "1"
string(23) "get_called_class(): Foo"
string(1) "2"
string(23) "get_called_class(): Bar"
string(1) "2"




#49332 [Opn]: Make fails with "Undefined symbols: _res_9_dn_expand, _res_9_search and _res_9"

2009-08-23 Thread scottmac
 ID:   49332
 Updated by:   scott...@php.net
 Reported By:  vizh at me dot com
 Status:   Open
 Bug Type: Compile Failure
 Operating System: Mac OS X 10.6 (10A432)
 PHP Version:  5.2.10
 New Comment:

This is fixed in 5.3.1-dev, I'll look into backporting changes to the
5.3 branch.


Previous Comments:


[2009-08-23 03:31:54] vizh at me dot com

Description:

I've download http://snaps.php.net/php5.2-latest.tar.gz, runs 
./configure; make and make fails with undefined symbols: 
_res_9_dn_expand, _res_9_search and _res_9_dn_skipname

Reproduce code:
---
cd /tmp
curl "http://snaps.php.net/php5.2-latest.tar.gz"; > php.tar.gz
tar -xf php.tar.gz; rm -rf php.tar.gz; mv php* php-build; cd php-build
./configure --disable-all
make

Actual result:
--
Undefined symbols:
  "_res_9_search", referenced from:
  _zif_dns_get_mx in dns.o
  _zif_dns_check_record in dns.o
  "_res_9_dn_expand", referenced from:
  _zif_dns_get_mx in dns.o
  "_res_9_dn_skipname", referenced from:
  _zif_dns_get_mx in dns.o
  _zif_dns_get_mx in dns.o





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



#49333 [Opn]: Bug in recursive regex processing

2009-08-23 Thread sjoerd
 ID:   49333
 Updated by:   sjo...@php.net
 Reported By:  inf3rno dot hu at gmail dot com
 Status:   Open
 Bug Type: PCRE related
 Operating System: Windows XP
 PHP Version:  5.2.10
 New Comment:

Could not reproduce. When I run the code example you supplied, I get
the expected result. Are you sure you have submitted the right code
example?


Previous Comments:


[2009-08-23 08:10:45] inf3rno dot hu at gmail dot com

Description:

I developed a recursive regex pattern for compile template patterns.
During the tests I found this bug. I managed to restrict it to the
following piece of code.
The count of the numbers, and every character (\n too) counts. So if I
have 11+ characters long string in the 'y'-s block, then it's buggy, but
by 10- character long strings it works fine.
I hope it's a real bug, and not a damage in my computer. :-)

Reproduce code:
---
$pattern='%.*?(?:([a-z])(?:.*?(?:(?R).*?)*?\1)?|$)%sD';
$test='
x
0123456789
x
y
01234567890
y';
preg_match_all($pattern,$test,$matches,PREG_SET_ORDER);
var_dump($matches);

Expected result:

array(3) { [0]=>  array(2) { [0]=>  string(18) " x 0123456789 x" [1]=> 
string(1) "x" } [1]=>  array(2) { [0]=>  string(19) " y 01234567890 y"
[1]=>  string(1) "y" } [2]=>  array(1) { [0]=>  string(0) "" } } 

Actual result:
--
array(0) { } 





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



#49334 [NEW]: foreach by reference behavior

2009-08-23 Thread hueen at yahoo dot com
From: hueen at yahoo dot com
Operating system: osx
PHP version:  5.2.10
PHP Bug Type: Feature/Change Request
Bug description:  foreach by reference behavior

Description:

In regards to bug #29992

Does anything speak against having foreach() unset the "as" variable
before iterating? I can hardly imagine anyone would want it to remain a
reference when walking through an array.


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



#49333 [NEW]: Bug in recursive regex processing

2009-08-23 Thread inf3rno dot hu at gmail dot com
From: inf3rno dot hu at gmail dot com
Operating system: Windows XP
PHP version:  5.2.10
PHP Bug Type: PCRE related
Bug description:  Bug in recursive regex processing

Description:

I developed a recursive regex pattern for compile template patterns.
During the tests I found this bug. I managed to restrict it to the
following piece of code.
The count of the numbers, and every character (\n too) counts. So if I
have 11+ characters long string in the 'y'-s block, then it's buggy, but by
10- character long strings it works fine.
I hope it's a real bug, and not a damage in my computer. :-)

Reproduce code:
---
$pattern='%.*?(?:([a-z])(?:.*?(?:(?R).*?)*?\1)?|$)%sD';
$test='
x
0123456789
x
y
01234567890
y';
preg_match_all($pattern,$test,$matches,PREG_SET_ORDER);
var_dump($matches);

Expected result:

array(3) { [0]=>  array(2) { [0]=>  string(18) " x 0123456789 x" [1]=> 
string(1) "x" } [1]=>  array(2) { [0]=>  string(19) " y 01234567890 y"
[1]=>  string(1) "y" } [2]=>  array(1) { [0]=>  string(0) "" } } 

Actual result:
--
array(0) { } 

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