[PHP-BUG] Bug #52230 [NEW]: namespace & __autoload clash

2010-07-01 Thread spawn at frostdrake dot tk
From: 
Operating system: gentoo & ubuntu
PHP version:  5.3.2
Package:  Class/Object related
Bug Type: Bug
Bug description:namespace & __autoload clash

Description:

when you use __autoload($var) it will get the class needed depending on the
file.

by using namespace and getting the class by a full path name

ex

new \class\name



__autload will then try to load classname

Test script:
---
/** index.php **/



function __autoload($var) {

  require_once($var.'.php');

}

//It will try to load the file Coreinit.php and not Core/init.php;

new Core\init



/** Core/init.php **/

namespace Core;

class init{

  function __construct(){

echo 'Bingo..!'; 

  }

}

Expected result:

that autoload loads Core/init.php

Actual result:
--
autoload loads Coreinit.php

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



Bug #50400 [Com]: Compile fails generating phar.phar

2010-07-01 Thread omars1234 at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=50400&edit=1

 ID:   50400
 Comment by:   omars1234 at gmail dot com
 Reported by:  lepage at grm dot polymtl dot ca
 Summary:  Compile fails generating phar.phar
 Status:   Assigned
 Type: Bug
 Package:  PHAR related
 Operating System: Solaris 10
 PHP Version:  5.3.1
 Assigned To:  dsp

 New Comment:

As a work-around, pass "--disable-phar" to configure.  I don't do
anything that explicitly needs phar archives (so far), so I did this to
build PHP5.3.2 on Solaris10 after running into the same problem.


Previous Comments:

[2010-01-26 17:09:36] ekcheu at uncg dot edu

I've had this issue before.  It appears that this error occurs depending
upon which version of gcc you are using.  After continuing to fail to
compile on a version of gcc (4.2.1).. I used blastwave's gcc, and it was
able to get past this issue.  Don't ask why it compiles find on some
versions of gcc and not others.


[2009-12-07 20:13:01] lepage at grm dot polymtl dot ca

Description:

Cannot gcc compile php 5.3.1 on Solaris 10 (sparc) since it's failing
with phar/phar.php error. It was the same with php 5.3.0.



SunStudio is not an option since many libs are done with gcc and there
is incompatibilities with some dependencies. 



php 515 does compile on Solaris 10.

thanks.

Reproduce code:
---
php-5.3.1% make

Generating phar.phar



Parse error: syntax error, unexpected $end in
/share/concorde/xta3511/install/web/php-5.3.1/ext/phar/phar.php on line
19

*** Error code 255

The following command caused the error:

`  if test -x
"/share/concorde/xta3511/install/web/php-5.3.1/sapi/cli/php"; then 
/share/concorde/xta3511/install/web/php-5.3.1/build/shtool echo -n --
"/share/concorde/xta3511/install/web/php-5.3.1/sapi/cli/php -n";  if
test "x" != "x"; then 
/share/concorde/xta3511/install/web/php-5.3.1/build/shtool echo -n -- "
-d extension_dir=/share/concorde/xta3511/install/web/php-5.3.1/modules";
 for i in bz2 zlib phar; do  if test -f
"/share/concorde/xta3511/install/web/php-5.3.1/modules/$i.la"; then  .
/share/concorde/xta3511/install/web/php-5.3.1/modules/$i.la;
/share/concorde/xta3511/install/web/php-5.3.1/build/shtool echo -n -- "
-d extension=$dlname";  fi;  done;  fi;  else 
/share/concorde/xta3511/install/web/php-5.3.1/build/shtool echo -n --
"";  fi;` -d 'open_basedir=' -d 'output_buffering=0' -d
'memory_limit=-1' -d phar.readonly=0 -d 'safe_mode=0' ext/phar/phar.php
pack -f ext/phar/phar.phar -a pharcommand -c auto -x \\.svn -p 0 -s
/share/concorde/xta3511/install/web/php-5.3.1/ext/phar/phar/phar.php -h
sha1 -b "`if test -x ""; then 
/share/concorde/xta3511/install/web/php-5.3.1/build/shtool echo -n --
"";  else  /share/concorde/xta3511/install/web/php-5.3.1/build/shtool
echo -n -- "/usr/local_10/opt/php-531/bin/php";  fi; `" 
/share/concorde/xta3511/install/web/php-5.3.1/ext/phar/phar/

make: Fatal error: Command failed for target `ext/phar/phar.phar'



Expected result:

to compile.

Actual result:
--
failed compiling.






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


Req #7028 [Com]: xml=shared and wddx do not work together

2010-07-01 Thread gmblar+php at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=7028&edit=1

 ID:   7028
 Comment by:   gmblar+php at gmail dot com
 Reported by:  ipv4 at mail dot ru
 Summary:  xml=shared and wddx do not work together
 Status:   Analyzed
 Type: Feature/Change Request
 Package:  Feature/Change Request
 Operating System: Linux
 PHP Version:  4.0.3RC2

 New Comment:

$ php -r "wddx_deserialize('foo');"



dyld: lazy symbol binding failed: Symbol not found: _XML_ParserCreate

  Referenced from:
/usr/lib/php/extensions/no-debug-non-zts-20090626/wddx.so

  Expected in: flat namespace



dyld: Symbol not found: _XML_ParserCreate

  Referenced from:
/usr/lib/php/extensions/no-debug-non-zts-20090626/wddx.so

  Expected in: flat namespace



Trace/BPT trap


Previous Comments:

[2000-11-29 08:39:07] s...@php.net

I guess yes, this is by design. If you build WDDX, session

module uses it, so you have to build it statically. If you

have WDDX as static, you need XML to be static too, since

WDDX uses XML.



So, while it'd be nice to have such a possibility, currently

it doesn't work by design.



Thus I reclassify it as feature request.


[2000-11-29 04:41:24] sni...@php.net

reclassified


[2000-10-05 01:46:43] ipv4 at mail dot ru

configure ... --with-xml=shared --enable-wddx



or



--with-xml=shared --enable-wddx=shared



doesn't work. wddx support is always compiled in statically 

and resulting module (or standalone php) becomes unusable as it contains
unresolved symbols from xml module.



Currently the only way to build php with xml and wddx is to build xml
support statically. :( Is that by design?









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


Bug #52228 [Opn->Bgs]: fseek failure to seek

2010-07-01 Thread pajoye
Edit report at http://bugs.php.net/bug.php?id=52228&edit=1

 ID:   52228
 Updated by:   paj...@php.net
 Reported by:  VJTD3 at VJTD3 dot com
 Summary:  fseek failure to seek
-Status:   Open
+Status:   Bogus
 Type: Bug
 Package:  Filesystem function related
 Operating System: *
 PHP Version:  Irrelevant

 New Comment:

We already have feature requests for that.


Previous Comments:

[2010-07-01 22:00:17] VJTD3 at VJTD3 dot com

Description:

2147483647 or PHP_INT_MAX on the system is the max integer. fseek fails
with files over PHP_INT_MAX+2 in size. binary math would resolve the
fseek issue internally.

Test script:
---
reading a file of 20 gigabytes (or anything larger then PHP_INT_MAX+2)
is successful with:







however fseek fails:





Expected result:

echo the byte from position PHP_INT_MAX+1

Actual result:
--
crash/fail






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


[PHP-BUG] Bug #52228 [NEW]: fseek failure to seek

2010-07-01 Thread VJTD3 at VJTD3 dot com
From: 
Operating system: *
PHP version:  Irrelevant
Package:  Filesystem function related
Bug Type: Bug
Bug description:fseek failure to seek

Description:

2147483647 or PHP_INT_MAX on the system is the max integer. fseek fails
with files over PHP_INT_MAX+2 in size. binary math would resolve the fseek
issue internally.

Test script:
---
reading a file of 20 gigabytes (or anything larger then PHP_INT_MAX+2) is
successful with:







however fseek fails:





Expected result:

echo the byte from position PHP_INT_MAX+1

Actual result:
--
crash/fail

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



[PHP-BUG] Bug #52227 [NEW]: parse_ini_* does not parse namespaced constants

2010-07-01 Thread wil dot moore at wilmoore dot com
From: 
Operating system: Linux, Mac, Windows
PHP version:  5.3.2
Package:  Filesystem function related
Bug Type: Bug
Bug description:parse_ini_* does not parse namespaced constants

Description:

The parse_ini_file/parse_ini_string pair of functions do not expand
namespaced constants.

Test script:
---
 'parse_ini_file_namespaced',

  'project.constant.namspaced' => 'my\\PROJECT_NAME',

)

Actual result:
--
array (

  'project.constant.global' => 'PROJECT_NAME',

  'project.constant.namspaced' => 'my\\PROJECT_NAME',

)

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



[PHP-BUG] Req #52225 [NEW]: __get() and __set() for static classes

2010-07-01 Thread lucato at gmail dot com
From: 
Operating system: Any
PHP version:  5.3.2
Package:  Class/Object related
Bug Type: Feature/Change Request
Bug description:__get() and __set() for static classes

Description:

Would it be possible to have magic setter/getter functions available on
static 

context ?



The documentation says "Property overloading only works in object context.
These 

magic methods will not be triggered in static context."



I would find it useful on a static context where I have a class A extending


another class B, to access





Test script:
---
Example:



Class A {



   static $data = array('bar' => 99, 'foo' => 101);

   

   function __get($name) {



   if (isset(self::$data[$name])) 

   return self::$data[$name];



   return null;

   }

}



Class B extends A {

   

}





echo B::$foo;

Expected result:

echo B::$foo; 



In the example should return 101.

Actual result:
--
In the example it triggers a fatal error.

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



Bug #52037 [Asn]: Concurrent builds fail in install-programs

2010-07-01 Thread seanius at debian dot org
Edit report at http://bugs.php.net/bug.php?id=52037&edit=1

 ID:   52037
 User updated by:  seanius at debian dot org
 Reported by:  seanius at debian dot org
 Summary:  Concurrent builds fail in install-programs
 Status:   Assigned
 Type: Bug
 Package:  Compile Failure
 Operating System: Debian GNU/Linux
 PHP Version:  5.3.2
 Assigned To:  kalle

 New Comment:

hi,



yes, i believe so.  at least from a quick visual review it looks like it
has the same problem.


Previous Comments:

[2010-06-21 07:52:31] ka...@php.net

Does this apply to 5.2 aswell?


[2010-06-09 20:58:28] seanius at debian dot org

Description:

originally reported as
http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=584348 



which was assumed to be a problem in the build environment of the bug
reporter, but after his persistence i investigated further and found
that there is indeed a problem with parallel builds.  



namely, the install-programs target assumes that INSTALL_ROOT/bindir
exists and doesn't check/create it iself. if executed serially after the
install-build target, the directory does exist since it is created by
that target, but if called in parallel (or before calling
install-build), the error mentioned in the above debian bug will be
seen:



> make[1]: Entering directory
`/build/user-php5_5.3.2-1-amd64-JiIO8n/php5-5.3.2/apache2-build'

> Installing build environment:
/build/user-php5_5.3.2-1-amd64-JiIO8n/php5-5.3.2/debian/libapache2-mod-php5/usr/lib/php5/build/

> Installing helper programs:  
/build/user-php5_5.3.2-1-amd64-JiIO8n/php5-5.3.2/debian/libapache2-mod-php5/usr/bin/

>   program: phpize

> cp: cannot create regular file
`/build/user-php5_5.3.2-1-amd64-JiIO8n/php5-5.3.2/debian/libapache2-mod-php5/usr/bin/#i...@31393#':
No such file or directory

>   program: php-config



(the strange filename is a shtool temp file, but the error is that the
directory does not exist)



the patch for this is very simple, attached.







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


Bug #52223 [Opn->Bgs]: switch case shows unexpected behaviour in particular case

2010-07-01 Thread degeberg
Edit report at http://bugs.php.net/bug.php?id=52223&edit=1

 ID:   52223
 Updated by:   degeb...@php.net
 Reported by:  webmaster at cephario dot com
 Summary:  switch case shows unexpected behaviour in particular
   case
-Status:   Open
+Status:   Bogus
 Type: Bug
 Package:  Unknown/Other Function
 Operating System: Win32Server2003SE
 PHP Version:  5.3.2

 New Comment:

Sorry, but your problem does not imply a bug in PHP itself.  For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system is not the
appropriate forum for asking support questions.  Due to the volume
of reports we can not explain in detail here why your report is not
a bug.  The support channels will be able to provide an explanation
for you.

Thank you for your interest in PHP.

0 == 'N', so the case passes.


Previous Comments:

[2010-07-01 16:01:54] webmaster at cephario dot com

Description:

if the given value is a numeric 0 (AND YES APPLIES ONLY FOR THE 0
negative or positive int values are working as expected) the first
string expression (case) is matched.



Test script:
---


Expected result:

DATANEW

Actual result:
--
NOW()






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


Bug #52218 [Bgs]: php module not loaded when php module is enabled and then restarted

2010-07-01 Thread php at spam dot wizbit dot be
Edit report at http://bugs.php.net/bug.php?id=52218&edit=1

 ID:   52218
 User updated by:  php at spam dot wizbit dot be
 Reported by:  php at spam dot wizbit dot be
 Summary:  php module not loaded when php module is enabled and
   then restarted
 Status:   Bogus
 Type: Bug
 Package:  Apache2 related
 Operating System: Linux
-PHP Version:  Irrelevant
+PHP Version:  5.3.3-RC1

 New Comment:

Since you insisted: Retested with 5.3.3-RC1. (even tho I checked the
code in trunk and said it was the same.)



No surprise: the same problem exist.



First start with php disabled:

Thu Jul 01 18:02:07 2010] [notice] Digest: generating secret for digest
authentication ...

[Thu Jul 01 18:02:07 2010] [notice] Digest: done

[Thu Jul 01 18:02:07 2010] [notice] Apache/2.2.15 (Unix) DAV/2
configured -- resuming normal operations





First restart with php enabled:

[Thu Jul 01 18:02:13 2010] [notice] SIGHUP received.  Attempting to
restart

[Thu Jul 01 18:02:13 2010] [notice] Digest: generating secret for digest
authentication ...

[Thu Jul 01 18:02:13 2010] [notice] Digest: done

[Thu Jul 01 18:02:13 2010] [notice] Apache/2.2.15 (Unix) DAV/2
configured -- resuming normal operations



=> PHP not loaded but it is enabled in the code



Second restart with PHP enabled:



[Thu Jul 01 18:02:15 2010] [notice] SIGHUP received.  Attempting to
restart

[Thu Jul 01 18:02:16 2010] [notice] Digest: generating secret for digest
authentication ...

[Thu Jul 01 18:02:16 2010] [notice] Digest: done

[Thu Jul 01 18:02:16 2010] [notice] Apache/2.2.15 (Unix) DAV/2
PHP/5.3.3-RC1 configured -- resuming normal operations





=> PHP now loaded.





Note that this never was a problem debian builds. I said I experienced
this first with a stock php-4.4.9 and that I then tested with debian
since that was easier then compiling a stock 5.3.3 build.


Previous Comments:

[2010-07-01 16:03:35] johan...@php.net

Both 4.4.9 and 5.2.6 are old. If there is an issue with the Debian
builds please talk to them.


[2010-07-01 12:10:27] php at spam dot wizbit dot be

Description:

When apache is restarted after enabling php then it does not load PHP.

When apache is restarted again then it does load PHP.



I first noticed this with (stock) php-4.4.9 and apache 2.2.15 where it
resulted in segmentation faults on every request.

I then tested this with php-5.2.6 that comes with debian
(PHP/5.2.6-1+lenny8 with Suhosin-Patch) and it shows the same problem
but does not segfault.





Steps to reproduce (on debian):

1. install apache2 and php

2. stop apache: apache2ctl -k stop

3. disable the php module: rm /etc/apache2/mods-enabled/php.*

4. start apache: apache2ctl -k start

5. enable the php module: ln -s /etc/apache2/mods-available/php.*
/etc/apache2/mods-enabled/

6. restart apache: apache2ctl -k restart

7. Check the log file => PHP not loaded. (on php-4.4.9 every request
from this moment on caused a segmentation fault)

8. restart apache again: apache2ctl -k restart

9. Check the log file => PHP is loaded



NOTE: do not use the debian init script (/etc/init.d/apache2). 







I do not know what the severity of this issue should be.

It does not appear to be segfaulting in recent versions but that does
not nessesarly mean that the segfault is fixed (it could be hiding
somewhere - I did not try very hard to get it to segfault).







The logfile/traces/a guess where the problem is:



An example log file:



PHP disabled: apache2ctl -k start:

  [Thu Jul 01 10:55:03 2010] [notice] Apache/2.2.9 (Debian) configured
-- resuming normal operations



PHP enabled; apache2ctl -k restart:

  [Thu Jul 01 10:55:10 2010] [notice] SIGHUP received.  Attempting to
restart

  [Thu Jul 01 10:55:10 2010] [notice] Apache/2.2.9 (Debian) configured
-- resuming normal operations

==> PHP not loaded



Another restart: apache2ctl -k restart:

  [Thu Jul 01 10:55:15 2010] [notice] SIGHUP received.  Attempting to
restart

  [Thu Jul 01 10:55:15 2010] [notice] Apache/2.2.9 (Debian)
PHP/5.2.6-1+lenny8 with Suhosin-Patch configured -- resuming normal
operations

==> PHP now loaded







debugging this with php 4.4.9 may points to a problem in
sapi/apache2handler/sapi_apache2.c: php_apache_server_startup.

(I did not debug this with php 5 but I did check the code in trunk and
it looks the same).



The start of the code:

static int

php_apache_server_startup(apr_pool_t *pconf, apr_pool_t *plog,
apr_pool_t *ptemp, server_rec *s)

{

void *data = NULL;

const char *userdata_key = "apache2hook_post_config";



/* Apache will load, unload and then reload a DSO module. This

 * prevents us from starting PHP until the second load. */





The comment makes me

Bug #52218 [Opn->Bgs]: php module not loaded when php module is enabled and then restarted

2010-07-01 Thread johannes
Edit report at http://bugs.php.net/bug.php?id=52218&edit=1

 ID:   52218
 Updated by:   johan...@php.net
 Reported by:  php at spam dot wizbit dot be
 Summary:  php module not loaded when php module is enabled and
   then restarted
-Status:   Open
+Status:   Bogus
 Type: Bug
 Package:  Apache2 related
 Operating System: Linux
 PHP Version:  Irrelevant

 New Comment:

Both 4.4.9 and 5.2.6 are old. If there is an issue with the Debian
builds please talk to them.


Previous Comments:

[2010-07-01 12:10:27] php at spam dot wizbit dot be

Description:

When apache is restarted after enabling php then it does not load PHP.

When apache is restarted again then it does load PHP.



I first noticed this with (stock) php-4.4.9 and apache 2.2.15 where it
resulted in segmentation faults on every request.

I then tested this with php-5.2.6 that comes with debian
(PHP/5.2.6-1+lenny8 with Suhosin-Patch) and it shows the same problem
but does not segfault.





Steps to reproduce (on debian):

1. install apache2 and php

2. stop apache: apache2ctl -k stop

3. disable the php module: rm /etc/apache2/mods-enabled/php.*

4. start apache: apache2ctl -k start

5. enable the php module: ln -s /etc/apache2/mods-available/php.*
/etc/apache2/mods-enabled/

6. restart apache: apache2ctl -k restart

7. Check the log file => PHP not loaded. (on php-4.4.9 every request
from this moment on caused a segmentation fault)

8. restart apache again: apache2ctl -k restart

9. Check the log file => PHP is loaded



NOTE: do not use the debian init script (/etc/init.d/apache2). 







I do not know what the severity of this issue should be.

It does not appear to be segfaulting in recent versions but that does
not nessesarly mean that the segfault is fixed (it could be hiding
somewhere - I did not try very hard to get it to segfault).







The logfile/traces/a guess where the problem is:



An example log file:



PHP disabled: apache2ctl -k start:

  [Thu Jul 01 10:55:03 2010] [notice] Apache/2.2.9 (Debian) configured
-- resuming normal operations



PHP enabled; apache2ctl -k restart:

  [Thu Jul 01 10:55:10 2010] [notice] SIGHUP received.  Attempting to
restart

  [Thu Jul 01 10:55:10 2010] [notice] Apache/2.2.9 (Debian) configured
-- resuming normal operations

==> PHP not loaded



Another restart: apache2ctl -k restart:

  [Thu Jul 01 10:55:15 2010] [notice] SIGHUP received.  Attempting to
restart

  [Thu Jul 01 10:55:15 2010] [notice] Apache/2.2.9 (Debian)
PHP/5.2.6-1+lenny8 with Suhosin-Patch configured -- resuming normal
operations

==> PHP now loaded







debugging this with php 4.4.9 may points to a problem in
sapi/apache2handler/sapi_apache2.c: php_apache_server_startup.

(I did not debug this with php 5 but I did check the code in trunk and
it looks the same).



The start of the code:

static int

php_apache_server_startup(apr_pool_t *pconf, apr_pool_t *plog,
apr_pool_t *ptemp, server_rec *s)

{

void *data = NULL;

const char *userdata_key = "apache2hook_post_config";



/* Apache will load, unload and then reload a DSO module. This

 * prevents us from starting PHP until the second load. */





The comment makes me believe that it is the expectation that
php_apache_server_startup is called twice but that does not appear to be
the case.



gdb session:



Breakpoint 1 (php_apache_server_startup) pending.

(gdb) c

Continuing.



Program received signal SIGHUP, Hangup.

0xb7c2cfb8 in select () from /ub/lib/libc.so.6

(gdb) c

Continuing.



Program received signal SIGHUP, Hangup.

0xb7b9df51 in kill () from /ub/lib/libc.so.6



# NOTE: this is the first restart after enabling the module

(gdb) c

Continuing.

Breakpoint 2 at 0xb78de20f: file
/root/work/php-4.4.9/sapi/apache2handler/sapi_apache2.c, line 367.

Pending breakpoint "php_apache_server_startup" resolved



Breakpoint 2, php_apache_server_startup (pconf=0x80e80a8,
plog=0x81301c8, ptemp=0x80f20d0, s=0x80ed0c0) at
/root/work/php-4.4.9/sapi/apache2handler/sapi_apache2.c:367

367 void *data = NULL;

(gdb) n

368 const char *userdata_key = "apache2hook_post_config";

(gdb) n

372 apr_pool_userdata_get(&data, userdata_key, s->process->pool);

(gdb) n

373 if (data == NULL) {

(gdb) p data

$1 = (void *) 0x0

(gdb) c

Continuing.



# NOTE: PHP is not loaded in apache even tho it is enabled



Program received signal SIGHUP, Hangup.

0xb7c2cfb8 in select () from /ub/lib/libc.so.6

(gdb) c

Continuing.



Program received signal SIGHUP, Hangup.

0xb7b9df51 in kill () from /ub/lib/libc.so.6

(gdb) c

Continuing.

# NOTE: this is the second restart after enabling the module





warning: Temporarily disabling breakpoints for unloaded shared library
"/ub/pkg/httpd/module

[PHP-BUG] Bug #52223 [NEW]: switch case shows unexpected behaviour in particular case

2010-07-01 Thread webmaster at cephario dot com
From: 
Operating system: Win32Server2003SE
PHP version:  5.3.2
Package:  Unknown/Other Function
Bug Type: Bug
Bug description:switch case shows unexpected behaviour in particular case

Description:

if the given value is a numeric 0 (AND YES APPLIES ONLY FOR THE 0 negative
or positive int values are working as expected) the first string expression
(case) is matched.



Test script:
---


Expected result:

DATANEW

Actual result:
--
NOW()

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



Req #52215 [Opn]: Add var_ref_count()

2010-07-01 Thread derick
Edit report at http://bugs.php.net/bug.php?id=52215&edit=1

 ID:   52215
 Updated by:   der...@php.net
 Reported by:  dev at alepe dot com
 Summary:  Add var_ref_count()
 Status:   Open
 Type: Feature/Change Request
 Package:  Variables related
 Operating System: Any
 PHP Version:  5.3.3RC1

 New Comment:

This won't work, for the same reason that debug_zval_dump() is flawed.
By passing a variable to a function, you mess with the refcount/is_ref
values. Xdebug's xdebug_debug_zval()
(http://xdebug.org/docs/all_functions#xdebug_debug_zval) goes around
that by looking up the symbol directly (but it doesn't support array
elements directly).


Previous Comments:

[2010-07-01 03:49:32] dtajchre...@php.net

http://www.php.net/manual/en/function.debug-zval-dump.php


[2010-07-01 03:34:42] dev at alepe dot com

Please excuse me if I have some theoretical misconceptions or if my
English is not very good.


[2010-07-01 03:33:03] dev at alepe dot com

Description:

It seems there is no easy way to know if an object/array/... is
reference. 



Looking at the source code of ext/standard/var.c it seems it may be not
so hard to add that function. As debug_zval_dump already outputs the
reference count, it would be better to obtain that value in order to
determine if an object is referenced or not. Maybe something like (I'm
not C programmer):



PHPAPI void php_var_ref_count(zval **struc)

{

return Z_REFCOUNT_PP(struc);

}



Knowing the reference count may be helpful to:

- make copies of a structure without references

- remove variables that have more than 1 reference (safe remove)

- remove variables that are not referenced (unused values)

- prevent modifying a variable that is referenced 



I believe there must be more applications but these are the ones I can
think of.



(background:
http://stackoverflow.com/questions/3148125/php-check-if-object-array-is-a-reference)



Test script:
---
 "apple", "b" => "banana");

$es = array("a" => "manzana", "b" => "platano");

$dict = array(

   "Eng" => $en,

   "Esp" => $es,

   "Non" => array("a" => "A", "b" => "B")

);



echo var_ref_count($dict["Eng"]); 

echo " # ";

echo var_ref_count($dict["Non"]); 



?>

Expected result:

2 # 1

Actual result:
--
None (inexistent)






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


Req #52219 [Com]: More useful return values for SoapClient::__getFunctions() / __getTypes()

2010-07-01 Thread php_bugs at m-h-it dot de
Edit report at http://bugs.php.net/bug.php?id=52219&edit=1

 ID:   52219
 Comment by:   php_bugs at m-h-it dot de
 Reported by:  php_bugs at m-h-it dot de
 Summary:  More useful return values for
   SoapClient::__getFunctions() / __getTypes()
 Status:   Open
 Type: Feature/Change Request
 Package:  SOAP related
 Operating System: irrelevant
 PHP Version:  5.2.13

 New Comment:

I'm sorry, i have typo in my suggestion. It should be:



array (

  array(

'name'=>'loginCustomer',

'returnType'=>'LoginCustomerResponse',

'arguments'=>array(

  array('name'=>'loginCustomer','type'=>'LoginCustomer')

)

  ),

  array(

'name'=>'findCustomer',

'returnType'=>'FindCustomerResponse',

'arguments'=>array(

  array('name'=>'findCustomer','type'=>'FindCustomerResponse'),

)

  ),

...

)


Previous Comments:

[2010-07-01 12:29:29] php_bugs at m-h-it dot de

Description:

SoapClient::__getFunctions() / SoapClient::__getTypes() now return both
an array 

of strings. Each string contains a function signature or a structure
description 

respectively. So it's hard to really use this information
programmatically. You 

have to parse the strings into something useful first. 



It would be more useful to get a nested array with all information from
the 

WSDL. For example __getFunctions() now delivers this:



array (

  0 => 'LoginCustomerResponse loginCustomer(LoginCustomer
$loginCustomer)',

  1 => 'FindCustomerResponse findCustomer(FindCustomer $findCustomer)',

  ...

)



it's easier to use this:



array (

  array(

'name'=>'loginCustomer',

'returnType'=>'LoginCustomerResponse',

'arguments'=>array(

  array('name'=>'loginCustomer'),

  array('type'=>'LoginCustomer')

)

  ),

  array(

'name'=>'findCustomer',

'returnType'=>'FindCustomerResponse',

'arguments'=>array(

  array('name'=>'findCustomer'),

  array('type'=>'FindCustomerResponse')

)

  ),

...

)



To keep BC i suggest to use default argument:



SoapClient::__getFunctions($asStrings=true) 

SoapClient::__getTypes($asStrings=true)







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


[PHP-BUG] Req #52219 [NEW]: More useful return values for SoapClient::__getFunctions() / __getTypes()

2010-07-01 Thread php_bugs at m-h-it dot de
From: 
Operating system: irrelevant
PHP version:  5.2.13
Package:  SOAP related
Bug Type: Feature/Change Request
Bug description:More useful return values for SoapClient::__getFunctions() / 
__getTypes()

Description:

SoapClient::__getFunctions() / SoapClient::__getTypes() now return both an
array 

of strings. Each string contains a function signature or a structure
description 

respectively. So it's hard to really use this information programmatically.
You 

have to parse the strings into something useful first. 



It would be more useful to get a nested array with all information from the


WSDL. For example __getFunctions() now delivers this:



array (

  0 => 'LoginCustomerResponse loginCustomer(LoginCustomer
$loginCustomer)',

  1 => 'FindCustomerResponse findCustomer(FindCustomer $findCustomer)',

  ...

)



it's easier to use this:



array (

  array(

'name'=>'loginCustomer',

'returnType'=>'LoginCustomerResponse',

'arguments'=>array(

  array('name'=>'loginCustomer'),

  array('type'=>'LoginCustomer')

)

  ),

  array(

'name'=>'findCustomer',

'returnType'=>'FindCustomerResponse',

'arguments'=>array(

  array('name'=>'findCustomer'),

  array('type'=>'FindCustomerResponse')

)

  ),

...

)



To keep BC i suggest to use default argument:



SoapClient::__getFunctions($asStrings=true) 

SoapClient::__getTypes($asStrings=true)


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



[PHP-BUG] Bug #52218 [NEW]: php module not loaded when php module is enabled and then restarted

2010-07-01 Thread php at spam dot wizbit dot be
From: 
Operating system: Linux
PHP version:  Irrelevant
Package:  Apache2 related
Bug Type: Bug
Bug description:php module not loaded when php module is enabled and then 
restarted

Description:

When apache is restarted after enabling php then it does not load PHP.

When apache is restarted again then it does load PHP.



I first noticed this with (stock) php-4.4.9 and apache 2.2.15 where it
resulted in segmentation faults on every request.

I then tested this with php-5.2.6 that comes with debian
(PHP/5.2.6-1+lenny8 with Suhosin-Patch) and it shows the same problem but
does not segfault.





Steps to reproduce (on debian):

1. install apache2 and php

2. stop apache: apache2ctl -k stop

3. disable the php module: rm /etc/apache2/mods-enabled/php.*

4. start apache: apache2ctl -k start

5. enable the php module: ln -s /etc/apache2/mods-available/php.*
/etc/apache2/mods-enabled/

6. restart apache: apache2ctl -k restart

7. Check the log file => PHP not loaded. (on php-4.4.9 every request from
this moment on caused a segmentation fault)

8. restart apache again: apache2ctl -k restart

9. Check the log file => PHP is loaded



NOTE: do not use the debian init script (/etc/init.d/apache2). 







I do not know what the severity of this issue should be.

It does not appear to be segfaulting in recent versions but that does not
nessesarly mean that the segfault is fixed (it could be hiding somewhere -
I did not try very hard to get it to segfault).







The logfile/traces/a guess where the problem is:



An example log file:



PHP disabled: apache2ctl -k start:

  [Thu Jul 01 10:55:03 2010] [notice] Apache/2.2.9 (Debian) configured --
resuming normal operations



PHP enabled; apache2ctl -k restart:

  [Thu Jul 01 10:55:10 2010] [notice] SIGHUP received.  Attempting to
restart

  [Thu Jul 01 10:55:10 2010] [notice] Apache/2.2.9 (Debian) configured --
resuming normal operations

==> PHP not loaded



Another restart: apache2ctl -k restart:

  [Thu Jul 01 10:55:15 2010] [notice] SIGHUP received.  Attempting to
restart

  [Thu Jul 01 10:55:15 2010] [notice] Apache/2.2.9 (Debian)
PHP/5.2.6-1+lenny8 with Suhosin-Patch configured -- resuming normal
operations

==> PHP now loaded







debugging this with php 4.4.9 may points to a problem in
sapi/apache2handler/sapi_apache2.c: php_apache_server_startup.

(I did not debug this with php 5 but I did check the code in trunk and it
looks the same).



The start of the code:

static int

php_apache_server_startup(apr_pool_t *pconf, apr_pool_t *plog, 
apr_pool_t
*ptemp, server_rec *s)

{

void *data = NULL;

const char *userdata_key = "apache2hook_post_config";



/* Apache will load, unload and then reload a DSO module. This

 * prevents us from starting PHP until the second load. */





The comment makes me believe that it is the expectation that
php_apache_server_startup is called twice but that does not appear to be
the case.



gdb session:



Breakpoint 1 (php_apache_server_startup) pending.

(gdb) c

Continuing.



Program received signal SIGHUP, Hangup.

0xb7c2cfb8 in select () from /ub/lib/libc.so.6

(gdb) c

Continuing.



Program received signal SIGHUP, Hangup.

0xb7b9df51 in kill () from /ub/lib/libc.so.6



# NOTE: this is the first restart after enabling the module

(gdb) c

Continuing.

Breakpoint 2 at 0xb78de20f: file
/root/work/php-4.4.9/sapi/apache2handler/sapi_apache2.c, line 367.

Pending breakpoint "php_apache_server_startup" resolved



Breakpoint 2, php_apache_server_startup (pconf=0x80e80a8, plog=0x81301c8,
ptemp=0x80f20d0, s=0x80ed0c0) at
/root/work/php-4.4.9/sapi/apache2handler/sapi_apache2.c:367

367 void *data = NULL;

(gdb) n

368 const char *userdata_key = "apache2hook_post_config";

(gdb) n

372 apr_pool_userdata_get(&data, userdata_key, s->process->pool);

(gdb) n

373 if (data == NULL) {

(gdb) p data

$1 = (void *) 0x0

(gdb) c

Continuing.



# NOTE: PHP is not loaded in apache even tho it is enabled



Program received signal SIGHUP, Hangup.

0xb7c2cfb8 in select () from /ub/lib/libc.so.6

(gdb) c

Continuing.



Program received signal SIGHUP, Hangup.

0xb7b9df51 in kill () from /ub/lib/libc.so.6

(gdb) c

Continuing.

# NOTE: this is the second restart after enabling the module





warning: Temporarily disabling breakpoints for unloaded shared library
"/ub/pkg/httpd/modules/libphp4.so"



Breakpoint 2, php_apache_server_startup (pconf=0x80e80a8, plog=0x81301c8,
ptemp=0x81361e0, s=0x80ed0c0) at
/root/work/php-4.4.9/sapi/apache2handler/sapi_apache2.c:367

367 void *data = NULL;

(gdb) n

368 const char *userdata_key = "apache2hook_post_config";

(gdb) n

372 apr_pool_userdata_get(&data, userdata_key, s->process->pool);

(gdb) n

373 if (data == NULL) {

(gdb) p data

$2 = (void *) 0x1

(gdb) n

384