[PHP-BUG] Bug #53694 [NEW]: SimpleXMLElement does not read XML declaration line.

2011-01-08 Thread jamone_95134 at yahoo dot com
From: 
Operating system: Windows XP
PHP version:  5.3.5
Package:  SimpleXML related
Bug Type: Bug
Bug description:SimpleXMLElement does not read XML declaration line.

Description:

---

From manual page: http://www.php.net/simplexml.examples-basic

---

When I run the first example I get the following errors:



$ php test1.php



Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error :
XML 

declaration allowed only at the start of th

e document in D:\php_src\XML\test1.php on line 4



Warning: SimpleXMLElement::__construct():   ?xml version=1.0 

encoding=utf-8? in D:\php_src\XML\test1.php on li

ne 4



Warning: SimpleXMLElement::__construct():^ in 

D:\php_src\XML\test1.php on line 4



Fatal error: Uncaught exception 'Exception' with message 'String could not
be 

parsed as XML' in D:\php_src\XML\test1.php

:4

Stack trace:

#0 D:\php_src\XML\test1.php(4): SimpleXMLElement-__construct('??xml 

version=...')

#1 {main}

  thrown in D:\php_src\XML\test1.php on line 4





If I remove the ?xml version=1.0 encoding=utf-8? line from the
example.php 

file it runs ok.



So how do we handle the declaration line for xml files with
SimpleXMLElement?

Test script:
---
Just running example 2 from
http://www.php.net/manual/en/simplexml.examples-basic.php

Expected result:

Expected result:



So, this language. It's like, a programming language. Or is it a

scripting language? All is revealed in this thrilling horror spoof

of a documentary.

Actual result:
--
$ php test1.php



Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error :
XML 

declaration allowed only at the start of th

e document in D:\php_src\XML\test1.php on line 4



Warning: SimpleXMLElement::__construct():   ?xml version=1.0 

encoding=utf-8? in D:\php_src\XML\test1.php on li

ne 4



Warning: SimpleXMLElement::__construct():^ in 

D:\php_src\XML\test1.php on line 4



Fatal error: Uncaught exception 'Exception' with message 'String could not
be 

parsed as XML' in D:\php_src\XML\test1.php

:4

Stack trace:

#0 D:\php_src\XML\test1.php(4): SimpleXMLElement-__construct('??xml 

version=...')

#1 {main}

  thrown in D:\php_src\XML\test1.php on line 4



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



Bug #53694 [Opn-Bgs]: SimpleXMLElement does not read XML declaration line.

2011-01-08 Thread rrichards
Edit report at http://bugs.php.net/bug.php?id=53694edit=1

 ID: 53694
 Updated by: rricha...@php.net
 Reported by:jamone_95134 at yahoo dot com
 Summary:SimpleXMLElement does not read XML declaration line.
-Status: Open
+Status: Bogus
 Type:   Bug
 Package:SimpleXML related
 Operating System:   Windows XP
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Thank you for taking the time to write to us, but this is not
a bug. Please double-check the documentation available at
http://www.php.net/manual/ and the instructions on how to report
a bug at http://bugs.php.net/how-to-report.php

invalid characters before start of declaration.


Previous Comments:

[2011-01-08 10:04:15] jamone_95134 at yahoo dot com

Description:

---

From manual page: http://www.php.net/simplexml.examples-basic

---

When I run the first example I get the following errors:



$ php test1.php



Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error :
XML 

declaration allowed only at the start of th

e document in D:\php_src\XML\test1.php on line 4



Warning: SimpleXMLElement::__construct():   ?xml version=1.0 

encoding=utf-8? in D:\php_src\XML\test1.php on li

ne 4



Warning: SimpleXMLElement::__construct():^ in 

D:\php_src\XML\test1.php on line 4



Fatal error: Uncaught exception 'Exception' with message 'String could
not be 

parsed as XML' in D:\php_src\XML\test1.php

:4

Stack trace:

#0 D:\php_src\XML\test1.php(4): SimpleXMLElement-__construct('??xml 

version=...')

#1 {main}

  thrown in D:\php_src\XML\test1.php on line 4





If I remove the ?xml version=1.0 encoding=utf-8? line from the
example.php 

file it runs ok.



So how do we handle the declaration line for xml files with
SimpleXMLElement?

Test script:
---
Just running example 2 from
http://www.php.net/manual/en/simplexml.examples-basic.php

Expected result:

Expected result:



So, this language. It's like, a programming language. Or is it a

scripting language? All is revealed in this thrilling horror spoof

of a documentary.

Actual result:
--
$ php test1.php



Warning: SimpleXMLElement::__construct(): Entity: line 1: parser error :
XML 

declaration allowed only at the start of th

e document in D:\php_src\XML\test1.php on line 4



Warning: SimpleXMLElement::__construct():   ?xml version=1.0 

encoding=utf-8? in D:\php_src\XML\test1.php on li

ne 4



Warning: SimpleXMLElement::__construct():^ in 

D:\php_src\XML\test1.php on line 4



Fatal error: Uncaught exception 'Exception' with message 'String could
not be 

parsed as XML' in D:\php_src\XML\test1.php

:4

Stack trace:

#0 D:\php_src\XML\test1.php(4): SimpleXMLElement-__construct('??xml 

version=...')

#1 {main}

  thrown in D:\php_src\XML\test1.php on line 4








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


[PHP-BUG] Bug #53695 [NEW]: Bugs are not outputed when using php-fpm

2011-01-08 Thread szoftos at freemail dot hu
From: 
Operating system: FreeBSD
PHP version:  5.3.5
Package:  FPM related
Bug Type: Bug
Bug description:Bugs are not outputed  when using php-fpm

Description:

Hi, when i was trying to see an error message because of a syntax error (or
any other error) using php-fpm, it simply won't output. Sometimes i get
nothing, and other times i get an '500 Server error'.



When i use php-cli, i get the error message.



my configure line (comes from freebsd ports): './configure'
'--with-layout=GNU' '--localstatedir=/var'
'--with-config-file-scan-dir=/usr/local/etc/php' '--disable-all'
'--enable-libxml' '--with-libxml-dir=/usr/local'
'--with-pcre-regex=/usr/local' '--with-zlib-dir=/usr' '--program-prefix='
'--enable-fpm' '--with-fpm-user=www' '--with-fpm-group=www'
'--with-regex=php' '--with-zend-vm=CALL' '--enable-zend-multibyte'
'--prefix=/usr/local' '--mandir=/usr/local/man'
'--infodir=/usr/local/info/' '--build=amd64-portbld-freebsd8.1' 



The following extensions are compiled in:

[r...@wwwjail ~]# cat /var/db/ports/php5-extensions/options

# This file is auto-generated by 'make config'.

# No user-servicable parts inside!

# Options for php5-extensions-1.4

_OPTIONS_READ=php5-extensions-1.4

WITHOUT_BCMATH=true

WITH_BZ2=true

WITH_CALENDAR=true

WITH_CTYPE=true

WITHOUT_CURL=true

WITHOUT_DBA=true

WITH_DOM=true

WITH_EXIF=true

WITHOUT_FILEINFO=true

WITHOUT_FILTER=true

WITHOUT_FRIBIDI=true

WITH_FTP=true

WITH_GD=true

WITH_GETTEXT=true

WITH_GMP=true

WITH_HASH=true

WITH_ICONV=true

WITH_IMAP=true

WITHOUT_INTERBASE=true

WITH_JSON=true

WITHOUT_LDAP=true

WITH_MBSTRING=true

WITHOUT_MCRYPT=true

WITHOUT_MSSQL=true

WITH_MYSQL=true

WITHOUT_MYSQLI=true

WITHOUT_ODBC=true

WITH_OPENSSL=true

WITHOUT_PCNTL=true

WITH_PDF=true

WITH_PDO=true

WITH_PDO_SQLITE=true

WITHOUT_PGSQL=true

WITH_POSIX=true

WITH_PSPELL=true

WITHOUT_READLINE=true

WITHOUT_RECODE=true

WITH_SESSION=true

WITHOUT_SHMOP=true

WITH_SIMPLEXML=true

WITHOUT_SNMP=true

WITH_SOAP=true

WITHOUT_SOCKETS=true

WITH_SQLITE=true

WITHOUT_SYBASE_CT=true

WITHOUT_SYSVMSG=true

WITHOUT_SYSVSEM=true

WITHOUT_SYSVSHM=true

WITHOUT_TIDY=true

WITH_TOKENIZER=true

WITHOUT_WDDX=true

WITH_XML=true

WITH_XMLREADER=true

WITH_XMLRPC=true

WITH_XMLWRITER=true

WITHOUT_XSL=true

WITHOUT_YAZ=true

WITH_ZIP=true

WITH_ZLIB=true



The related php-fpm.conf snippet is:

php_admin_value[error_reporting] = E_ALL

php_admin_flag[display_errors] = On

php_admin_flag[display_startup_errors] = On



Test script:
---
?php

asdlkl;k

phpinfo();

?



Expected result:

PHP Parse error:  syntax error, unexpected T_STRING in test.php on line 3



Actual result:
--
Nothing, or a '500 Internal server error' result.

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



[PHP-BUG] Bug #53696 [NEW]: erroneous automatic entry into httpd.conf

2011-01-08 Thread helge dot rowold at datendrexler dot de
From: 
Operating system: Windows 7
PHP version:  5.3.5
Package:  Apache2 related
Bug Type: Bug
Bug description:erroneous automatic entry into httpd.conf

Description:

After having installed httpd-2.2.17-win32-x86-openssl-0.9.8o.msi
successfully, but NOT at the default path but at a separate HDD partition
with a non-default root directory, I was able to install the
php-5.3.5-Win32-VC6-x86.msi at the same partition in a non-default
directory, too. The installer echoed that everything would have been done
well.



But the Apache Service did not start, then!



At the end I was able to fix the issue:



In httpd.conf, the PHP installer had tried to add the default linkage from
HTTPD to PHP by adding the lines

#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL

PHPIniDir 

LoadModule php5_module php5apache2_2.dll

#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL



  -  i. e., PHP was NOT able to set the correct (non-default) path to its
own directory (which would have been, by the way, D:/Programme/PHP535/).

Test script:
---
Please see above  -  addition of the correct path in httpd.conf did fix the
error.


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



Bug #53696 [Opn-Asn]: erroneous automatic entry into httpd.conf

2011-01-08 Thread pajoye
Edit report at http://bugs.php.net/bug.php?id=53696edit=1

 ID: 53696
 Updated by: paj...@php.net
 Reported by:helge dot rowold at datendrexler dot de
 Summary:erroneous automatic entry into httpd.conf
-Status: Open
+Status: Assigned
 Type:   Bug
 Package:Apache2 related
 Operating System:   Windows 7
 PHP Version:5.3.5
-Assigned To:
+Assigned To:jmertic
 Block user comment: N
 Private report: N

 New Comment:

hi John,



Something went wrong in the last installer update.


Previous Comments:

[2011-01-08 14:53:42] helge dot rowold at datendrexler dot de

Description:

After having installed httpd-2.2.17-win32-x86-openssl-0.9.8o.msi
successfully, but NOT at the default path but at a separate HDD
partition with a non-default root directory, I was able to install the
php-5.3.5-Win32-VC6-x86.msi at the same partition in a non-default
directory, too. The installer echoed that everything would have been
done well.



But the Apache Service did not start, then!



At the end I was able to fix the issue:



In httpd.conf, the PHP installer had tried to add the default linkage
from HTTPD to PHP by adding the lines

#BEGIN PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL

PHPIniDir 

LoadModule php5_module php5apache2_2.dll

#END PHP INSTALLER EDITS - REMOVE ONLY ON UNINSTALL



  -  i. e., PHP was NOT able to set the correct (non-default) path to
its own directory (which would have been, by the way,
D:/Programme/PHP535/).

Test script:
---
Please see above  -  addition of the correct path in httpd.conf did fix
the error.







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


[PHP-BUG] Req #53697 [NEW]: new keyword vs. call_user_func

2011-01-08 Thread pablick at gmail dot com
From: 
Operating system: Irrelevant
PHP version:  5.3.5
Package:  Class/Object related
Bug Type: Feature/Change Request
Bug description:new keyword vs. call_user_func

Description:

When one defines a class with __callStatic() which under some circumstances


accepts method name of new, it may not be called. However, with __call(),
it may 

be called. May be solved using call_user_func(), but that loses the nice
syntax. 



Personally, I don't get it why new is parsed as T_NEW after Base:: and
not 

after $base-. 

Test script:
---
?php

class Base {

public static function __callStatic($method, $args) {

if ($method == 'new')

echo 'Base::new() called successfully';

}

public function __call($method, $args) {

if ($method == 'new')

echo '$base-new() called successfully';

}

}



$base = Base::new(); 

call_user_func(array('Base', 'new');

$base = new Base;

$base-new();

?

Expected result:

Base::new() called successfully

Base::new() called successfully

$base-new() called successfully

Actual result:
--
Parse error: syntax error, unexpected T_NEW, expecting T_STRING or
T_VARIABLE or 

'$' in C:\inetpub\wwwroot\test.php on line 14

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



Req #53697 [Com]: new keyword vs. call_user_func

2011-01-08 Thread pablick at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=53697edit=1

 ID: 53697
 Comment by: pablick at gmail dot com
 Reported by:pablick at gmail dot com
 Summary:new keyword vs. call_user_func
 Status: Open
 Type:   Feature/Change Request
 Package:Class/Object related
 Operating System:   Irrelevant
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

The importance of this bug is just in simplicity: If one wants to have a
static method named new, that will be creating instances (singletons
or 

any other controlled process of instantiation), it's more convenient to
have a class method named new in the API docs rather than having to
type 

ClassName::getNewInstance().


Previous Comments:

[2011-01-08 15:03:33] pablick at gmail dot com

Description:

When one defines a class with __callStatic() which under some
circumstances 

accepts method name of new, it may not be called. However, with
__call(), it may 

be called. May be solved using call_user_func(), but that loses the nice
syntax. 



Personally, I don't get it why new is parsed as T_NEW after Base::
and not 

after $base-. 

Test script:
---
?php

class Base {

public static function __callStatic($method, $args) {

if ($method == 'new')

echo 'Base::new() called successfully';

}

public function __call($method, $args) {

if ($method == 'new')

echo '$base-new() called successfully';

}

}



$base = Base::new(); 

call_user_func(array('Base', 'new');

$base = new Base;

$base-new();

?

Expected result:

Base::new() called successfully

Base::new() called successfully

$base-new() called successfully

Actual result:
--
Parse error: syntax error, unexpected T_NEW, expecting T_STRING or
T_VARIABLE or 

'$' in C:\inetpub\wwwroot\test.php on line 14






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


[PHP-BUG] Bug #53698 [NEW]: datefmt_localtime() and IntlDateFormatter::localtime() causes Fatal Error

2011-01-08 Thread t at kahkonen dot com
From: 
Operating system: Linux 32-bit
PHP version:  5.3.5
Package:  Date/time related
Bug Type: Bug
Bug description:datefmt_localtime() and IntlDateFormatter::localtime() causes 
Fatal Error

Description:

PHP-version: PHP 5.3.3



When executing $arr = datefmt_localtime( $fmt, Wednesday, December 31,
1969 

4:00:00 PM PT,0), $arr should have parsed day, month, year, hour etc.
values, 

but there comes Fatal Error: Only variables can be passed by reference.



Configure Command: './configure'  '--build=i686-redhat-linux-gnu'
'--host=i686-

redhat-linux-gnu' '--target=i386-redhat-linux-gnu' 

 '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr'
'--bindir=/usr/bin' '-

-sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' 

 '--includedir=/usr/include' '--libdir=/usr/lib'
'--libexecdir=/usr/libexec' '--

localstatedir=/var' '--sharedstatedir=/usr/com' 

 '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-

file=../config.cache' '--with-libdir=lib' 

 '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d'
'--

disable-debug' '--with-pic' '--disable-rpath' 

'--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin' '--with-freetype-

dir=/usr' '--with-png-dir=/usr' 

'--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm'
'--with-gettext' 

'--with-gmp' '--with-iconv' 

 '--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr'
'--with-zlib' 

'--with-layout=GNU' '--enable-exif' 

 '--enable-ftp' '--enable-magic-quotes' '--enable-sockets'
'--enable-sysvsem' '-

-enable-sysvshm' '--enable-sysvmsg' 

'--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop'
'--enable-calendar' 

'--without-mime-magic' '--without-sqlite' 

 '--without-sqlite3' '--with-libxml-dir=/usr' '--enable-xml'
'--with-system-

tzdata' '--enable-force-cgi-redirect' 

'--enable-pcntl' '--with-imap=shared' '--with-imap-ssl' '--enable-

mbstring=shared' '--enable-mbregex' '--with-gd=shared' 

 '--enable-bcmath=shared' '--enable-dba=shared' '--with-db4=/usr' '--with-

xmlrpc=shared' '--with-ldap=shared' '--with-ldap-sasl' 

 '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config'
'--

enable-dom=shared' '--with-pgsql=shared' 

'--enable-wddx=shared' '--with-snmp=shared,/usr' '--enable-soap=shared'
'--with-

xsl=shared,/usr' '--enable-xmlreader=shared' 

'--enable-xmlwriter=shared' '--with-curl=shared,/usr' '--enable-fastcgi'
'--

enable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' 

'--with-pdo-mysql=shared,/usr' '--with-pdo-pgsql=shared,/usr' '--with-pdo-

sqlite=shared,/usr' '--with-pdo-dblib=shared,/usr' 

'--enable-json=shared' '--enable-zip=shared' '--with-readline' '--with-

pspell=shared' '--enable-phar=shared' '--with-mcrypt=shared,/usr' 

'--with-tidy=shared,/usr' '--with-mssql=shared,/usr'
'--enable-sysvmsg=shared' 

'--enable-sysvshm=shared' '--enable-sysvsem=shared' 

'--enable-posix=shared' '--with-unixODBC=shared,/usr'
'--enable-fileinfo=shared' 

'--enable-intl=shared' '--with-icu-dir=/usr' 

'--with-recode=shared,/usr'





Test script:
---
?php

$fmt = datefmt_create( en_US
,IntlDateFormatter::FULL,IntlDateFormatter::FULL,'America/Los_Angeles',IntlDateFormatter::GREGORIAN
 );

$arr = datefmt_localtime( $fmt, Wednesday, December 31, 1969 4:00:00 PM
PT,0);

echo First parsed output is ;

if ($arr) {

foreach ($arr as $key = $value) {

echo $key : $value , ;

}

}

?

Expected result:

First parsed output is tm_sec : 0 , tm_min : 0 , tm_hour : 16 , tm_year :
1969 , 

tm_mday : 31 , tm_wday : 4 , tm_yday : 365 , tm_mon : 11 , tm_isdst : 0 , 

Actual result:
--
Fatal error: Only variables can be passed by reference in test.php on line
3.



Line 3 has function datefmt_localtime().

-- 
Edit bug report at http://bugs.php.net/bug.php?id=53698edit=1
-- 
Try a snapshot (PHP 5.2):
http://bugs.php.net/fix.php?id=53698r=trysnapshot52
Try a snapshot (PHP 5.3):
http://bugs.php.net/fix.php?id=53698r=trysnapshot53
Try a snapshot (trunk):  
http://bugs.php.net/fix.php?id=53698r=trysnapshottrunk
Fixed in SVN:
http://bugs.php.net/fix.php?id=53698r=fixed
Fixed in SVN and need be documented: 
http://bugs.php.net/fix.php?id=53698r=needdocs
Fixed in release:
http://bugs.php.net/fix.php?id=53698r=alreadyfixed
Need backtrace:  
http://bugs.php.net/fix.php?id=53698r=needtrace
Need Reproduce Script:   
http://bugs.php.net/fix.php?id=53698r=needscript
Try newer version:   
http://bugs.php.net/fix.php?id=53698r=oldversion
Not developer issue: 
http://bugs.php.net/fix.php?id=53698r=support
Expected behavior:   
http://bugs.php.net/fix.php?id=53698r=notwrong
Not enough info: 
http://bugs.php.net/fix.php?id=53698r=notenoughinfo
Submitted twice: 

[PHP-BUG] Bug #53699 [NEW]: After destructor execution, object exists

2011-01-08 Thread hausner15 at gmail dot com
From: 
Operating system: *
PHP version:  Irrelevant
Package:  Class/Object related
Bug Type: Bug
Bug description:After destructor execution, object exists

Description:

I think, in this example after destructor executing, object shouldn`t
exist. But result of this code tells something else...

Test script:
---
?php



class A {

protected $var;



private static $instance = NULL;

public static function getInstance() {

if (is_null(self::$instance))

self::$instance = new A();



return self::$instance;

}



protected function __construct() {

echo creating instance of A\n;

$this-var = existing var in instance of A \n;

}



public function show() {

echo $this-var;

}



public function __destruct() {

echo deleting instance of A\n;

}

}



class B {

private static $instance = NULL;

public static function getInstance() {

if (is_null(self::$instance))

self::$instance = new B();



return self::$instance;

}



protected function __construct() {

echo creating instance of B\n;

}



public function __destruct() {

A::getInstance()-show();

echo deleting instance of B\n;

}

}





header('Content-type: text/plain');

A::getInstance()-show();

B::getInstance();



?

Expected result:

Some error?

Actual result:
--
creating instance of A

existing var in instance of A 

creating instance of B

deleting instance of A

existing var in instance of A 

deleting instance of B

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



Bug #51631 [Fbk]: MySQLi query result depend on browser

2011-01-08 Thread kalle
Edit report at http://bugs.php.net/bug.php?id=51631edit=1

 ID: 51631
 Updated by: ka...@php.net
 Reported by:evgpanchenko at gmail dot com
 Summary:MySQLi query result depend on browser
 Status: Feedback
 Type:   Bug
 Package:MySQLi related
 Operating System:   Windows/Linux
 PHP Version:5.3.2
 Block user comment: N
 Private report: N

 New Comment:

Thank you for this bug report. To properly diagnose the problem, we
need a short but complete example script to be able to reproduce
this bug ourselves. 

A proper reproducing script starts with ?php and ends with ?,
is max. 10-20 lines long and does not require any external 
resources such as databases, etc. If the script requires a 
database to demonstrate the issue, please make sure it creates 
all necessary tables, stored procedures etc.

Please avoid embedding huge scripts into the report.




Previous Comments:

[2010-05-18 09:15:32] evgpanchenko at gmail dot com

same code, different results.

log to file gave the same result:



12,00

in Opera and Chrome



12,00

in mozilla and IE


[2010-05-11 12:07:17] and...@php.net

Please check what the source of the page you are receiving. Is it the
same? If yes, then the browser is the problem.


[2010-04-22 11:50:22] evgpanchenko at gmail dot com

Description:

I have in MySQL Table with columns price DECIMAL(6,2), issm tinyint, cnt
int

When I run request SELECT IF(issm=1, ROUND(price/cnt, 6), price) AS
price, issm with mysqli i get



12,00  1

12,00  0

in Opera and Chrome



but i get 

12,00  1

12,00  0



in mozilla and IE











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


Bug #53698 [Opn]: datefmt_localtime() and IntlDateFormatter::localtime() causes Fatal Error

2011-01-08 Thread t at kahkonen dot com
Edit report at http://bugs.php.net/bug.php?id=53698edit=1

 ID: 53698
 User updated by:t at kahkonen dot com
 Reported by:t at kahkonen dot com
 Summary:datefmt_localtime() and
 IntlDateFormatter::localtime() causes Fatal Error
 Status: Open
 Type:   Bug
 Package:Date/time related
-Operating System:   Linux 32-bit
+Operating System:   Linux 32-bit (Centos 5)
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

Tested with php 5.3.5 and 5.3.3 (identical configure commands): the same
Fatal 

Error.



This seems to be a bug and is essential to get working, because I have
not found 

any other (easy) way to parse locale independent date/time-strings than


datefmt_localtime() function. You have to know only user locale (eg.
fi_FI.utf8) 

and the program knows how to parse/format correct full, median or short
date and 

time for this locale. datefmt_parse() is an other one, but it produces
timestamp 

with normal timestamp related problems (for example Year 2038 problem).


Meanwhile I use my own command line C program which uses directly ICU
library, 

but using is rather slow.


Previous Comments:

[2011-01-08 15:53:38] t at kahkonen dot com

Description:

PHP-version: PHP 5.3.3



When executing $arr = datefmt_localtime( $fmt, Wednesday, December 31,
1969 

4:00:00 PM PT,0), $arr should have parsed day, month, year, hour etc.
values, 

but there comes Fatal Error: Only variables can be passed by reference.



Configure Command: './configure'  '--build=i686-redhat-linux-gnu'
'--host=i686-

redhat-linux-gnu' '--target=i386-redhat-linux-gnu' 

 '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr'
'--bindir=/usr/bin' '-

-sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' 

 '--includedir=/usr/include' '--libdir=/usr/lib'
'--libexecdir=/usr/libexec' '--

localstatedir=/var' '--sharedstatedir=/usr/com' 

 '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-

file=../config.cache' '--with-libdir=lib' 

 '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d'
'--

disable-debug' '--with-pic' '--disable-rpath' 

'--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin'
'--with-freetype-

dir=/usr' '--with-png-dir=/usr' 

'--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm'
'--with-gettext' 

'--with-gmp' '--with-iconv' 

 '--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr'
'--with-zlib' 

'--with-layout=GNU' '--enable-exif' 

 '--enable-ftp' '--enable-magic-quotes' '--enable-sockets'
'--enable-sysvsem' '-

-enable-sysvshm' '--enable-sysvmsg' 

'--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop'
'--enable-calendar' 

'--without-mime-magic' '--without-sqlite' 

 '--without-sqlite3' '--with-libxml-dir=/usr' '--enable-xml'
'--with-system-

tzdata' '--enable-force-cgi-redirect' 

'--enable-pcntl' '--with-imap=shared' '--with-imap-ssl' '--enable-

mbstring=shared' '--enable-mbregex' '--with-gd=shared' 

 '--enable-bcmath=shared' '--enable-dba=shared' '--with-db4=/usr'
'--with-

xmlrpc=shared' '--with-ldap=shared' '--with-ldap-sasl' 

 '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config'
'--

enable-dom=shared' '--with-pgsql=shared' 

'--enable-wddx=shared' '--with-snmp=shared,/usr' '--enable-soap=shared'
'--with-

xsl=shared,/usr' '--enable-xmlreader=shared' 

'--enable-xmlwriter=shared' '--with-curl=shared,/usr' '--enable-fastcgi'
'--

enable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' 

'--with-pdo-mysql=shared,/usr' '--with-pdo-pgsql=shared,/usr'
'--with-pdo-

sqlite=shared,/usr' '--with-pdo-dblib=shared,/usr' 

'--enable-json=shared' '--enable-zip=shared' '--with-readline' '--with-

pspell=shared' '--enable-phar=shared' '--with-mcrypt=shared,/usr' 

'--with-tidy=shared,/usr' '--with-mssql=shared,/usr'
'--enable-sysvmsg=shared' 

'--enable-sysvshm=shared' '--enable-sysvsem=shared' 

'--enable-posix=shared' '--with-unixODBC=shared,/usr'
'--enable-fileinfo=shared' 

'--enable-intl=shared' '--with-icu-dir=/usr' 

'--with-recode=shared,/usr'





Test script:
---
?php

$fmt = datefmt_create( en_US
,IntlDateFormatter::FULL,IntlDateFormatter::FULL,'America/Los_Angeles',IntlDateFormatter::GREGORIAN
 );

$arr = datefmt_localtime( $fmt, Wednesday, December 31, 1969 4:00:00 PM
PT,0);

echo First parsed output is ;

if ($arr) {

foreach ($arr as $key = $value) {

echo $key : $value , ;

}

}

?

Expected result:

First parsed output is tm_sec : 0 , tm_min : 0 , tm_hour : 16 , tm_year
: 1969 , 

tm_mday : 31 , tm_wday : 4 , tm_yday : 365 , tm_mon : 11 , tm_isdst : 0
, 

Actual result:
--
Fatal error: Only variables can be passed by reference in test.php on
line 3.



Line 3 has function datefmt_localtime().



Bug #53698 [Opn]: datefmt_localtime() and IntlDateFormatter::localtime() causes Fatal Error

2011-01-08 Thread t at kahkonen dot com
Edit report at http://bugs.php.net/bug.php?id=53698edit=1

 ID: 53698
 User updated by:t at kahkonen dot com
 Reported by:t at kahkonen dot com
 Summary:datefmt_localtime() and
 IntlDateFormatter::localtime() causes Fatal Error
 Status: Open
 Type:   Bug
 Package:Date/time related
 Operating System:   Linux 32-bit (Centos 5)
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

PHP manual page for datefmt_localtime():

http://www.php.net/manual/en/intldateformatter.localtime.php


Previous Comments:

[2011-01-08 17:02:43] t at kahkonen dot com

Tested with php 5.3.5 and 5.3.3 (identical configure commands): the same
Fatal 

Error.



This seems to be a bug and is essential to get working, because I have
not found 

any other (easy) way to parse locale independent date/time-strings than


datefmt_localtime() function. You have to know only user locale (eg.
fi_FI.utf8) 

and the program knows how to parse/format correct full, median or short
date and 

time for this locale. datefmt_parse() is an other one, but it produces
timestamp 

with normal timestamp related problems (for example Year 2038 problem).


Meanwhile I use my own command line C program which uses directly ICU
library, 

but using is rather slow.


[2011-01-08 15:53:38] t at kahkonen dot com

Description:

PHP-version: PHP 5.3.3



When executing $arr = datefmt_localtime( $fmt, Wednesday, December 31,
1969 

4:00:00 PM PT,0), $arr should have parsed day, month, year, hour etc.
values, 

but there comes Fatal Error: Only variables can be passed by reference.



Configure Command: './configure'  '--build=i686-redhat-linux-gnu'
'--host=i686-

redhat-linux-gnu' '--target=i386-redhat-linux-gnu' 

 '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr'
'--bindir=/usr/bin' '-

-sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' 

 '--includedir=/usr/include' '--libdir=/usr/lib'
'--libexecdir=/usr/libexec' '--

localstatedir=/var' '--sharedstatedir=/usr/com' 

 '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-

file=../config.cache' '--with-libdir=lib' 

 '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d'
'--

disable-debug' '--with-pic' '--disable-rpath' 

'--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin'
'--with-freetype-

dir=/usr' '--with-png-dir=/usr' 

'--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm'
'--with-gettext' 

'--with-gmp' '--with-iconv' 

 '--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr'
'--with-zlib' 

'--with-layout=GNU' '--enable-exif' 

 '--enable-ftp' '--enable-magic-quotes' '--enable-sockets'
'--enable-sysvsem' '-

-enable-sysvshm' '--enable-sysvmsg' 

'--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop'
'--enable-calendar' 

'--without-mime-magic' '--without-sqlite' 

 '--without-sqlite3' '--with-libxml-dir=/usr' '--enable-xml'
'--with-system-

tzdata' '--enable-force-cgi-redirect' 

'--enable-pcntl' '--with-imap=shared' '--with-imap-ssl' '--enable-

mbstring=shared' '--enable-mbregex' '--with-gd=shared' 

 '--enable-bcmath=shared' '--enable-dba=shared' '--with-db4=/usr'
'--with-

xmlrpc=shared' '--with-ldap=shared' '--with-ldap-sasl' 

 '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config'
'--

enable-dom=shared' '--with-pgsql=shared' 

'--enable-wddx=shared' '--with-snmp=shared,/usr' '--enable-soap=shared'
'--with-

xsl=shared,/usr' '--enable-xmlreader=shared' 

'--enable-xmlwriter=shared' '--with-curl=shared,/usr' '--enable-fastcgi'
'--

enable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' 

'--with-pdo-mysql=shared,/usr' '--with-pdo-pgsql=shared,/usr'
'--with-pdo-

sqlite=shared,/usr' '--with-pdo-dblib=shared,/usr' 

'--enable-json=shared' '--enable-zip=shared' '--with-readline' '--with-

pspell=shared' '--enable-phar=shared' '--with-mcrypt=shared,/usr' 

'--with-tidy=shared,/usr' '--with-mssql=shared,/usr'
'--enable-sysvmsg=shared' 

'--enable-sysvshm=shared' '--enable-sysvsem=shared' 

'--enable-posix=shared' '--with-unixODBC=shared,/usr'
'--enable-fileinfo=shared' 

'--enable-intl=shared' '--with-icu-dir=/usr' 

'--with-recode=shared,/usr'





Test script:
---
?php

$fmt = datefmt_create( en_US
,IntlDateFormatter::FULL,IntlDateFormatter::FULL,'America/Los_Angeles',IntlDateFormatter::GREGORIAN
 );

$arr = datefmt_localtime( $fmt, Wednesday, December 31, 1969 4:00:00 PM
PT,0);

echo First parsed output is ;

if ($arr) {

foreach ($arr as $key = $value) {

echo $key : $value , ;

}

}

?

Expected result:

First parsed output is tm_sec : 0 , tm_min : 0 , tm_hour : 16 , tm_year
: 1969 , 

tm_mday : 31 , tm_wday : 4 , tm_yday : 365 , tm_mon : 11 , tm_isdst : 0
, 

Actual result:

Bug #53698 [Opn-Bgs]: datefmt_localtime() and IntlDateFormatter::localtime() causes Fatal Error

2011-01-08 Thread cataphract
Edit report at http://bugs.php.net/bug.php?id=53698edit=1

 ID: 53698
 Updated by: cataphr...@php.net
 Reported by:t at kahkonen dot com
 Summary:datefmt_localtime() and
 IntlDateFormatter::localtime() causes Fatal Error
-Status: Open
+Status: Bogus
 Type:   Bug
 Package:Date/time related
 Operating System:   Linux 32-bit (Centos 5)
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

As the documentation says, you need to pass a variable, so you can't use
a literal like the 0 you're passing for the last arg.



Closing as bogus.


Previous Comments:

[2011-01-08 17:11:57] t at kahkonen dot com

PHP manual page for datefmt_localtime():

http://www.php.net/manual/en/intldateformatter.localtime.php


[2011-01-08 17:02:43] t at kahkonen dot com

Tested with php 5.3.5 and 5.3.3 (identical configure commands): the same
Fatal 

Error.



This seems to be a bug and is essential to get working, because I have
not found 

any other (easy) way to parse locale independent date/time-strings than


datefmt_localtime() function. You have to know only user locale (eg.
fi_FI.utf8) 

and the program knows how to parse/format correct full, median or short
date and 

time for this locale. datefmt_parse() is an other one, but it produces
timestamp 

with normal timestamp related problems (for example Year 2038 problem).


Meanwhile I use my own command line C program which uses directly ICU
library, 

but using is rather slow.


[2011-01-08 15:53:38] t at kahkonen dot com

Description:

PHP-version: PHP 5.3.3



When executing $arr = datefmt_localtime( $fmt, Wednesday, December 31,
1969 

4:00:00 PM PT,0), $arr should have parsed day, month, year, hour etc.
values, 

but there comes Fatal Error: Only variables can be passed by reference.



Configure Command: './configure'  '--build=i686-redhat-linux-gnu'
'--host=i686-

redhat-linux-gnu' '--target=i386-redhat-linux-gnu' 

 '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr'
'--bindir=/usr/bin' '-

-sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' 

 '--includedir=/usr/include' '--libdir=/usr/lib'
'--libexecdir=/usr/libexec' '--

localstatedir=/var' '--sharedstatedir=/usr/com' 

 '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-

file=../config.cache' '--with-libdir=lib' 

 '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d'
'--

disable-debug' '--with-pic' '--disable-rpath' 

'--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin'
'--with-freetype-

dir=/usr' '--with-png-dir=/usr' 

'--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm'
'--with-gettext' 

'--with-gmp' '--with-iconv' 

 '--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr'
'--with-zlib' 

'--with-layout=GNU' '--enable-exif' 

 '--enable-ftp' '--enable-magic-quotes' '--enable-sockets'
'--enable-sysvsem' '-

-enable-sysvshm' '--enable-sysvmsg' 

'--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop'
'--enable-calendar' 

'--without-mime-magic' '--without-sqlite' 

 '--without-sqlite3' '--with-libxml-dir=/usr' '--enable-xml'
'--with-system-

tzdata' '--enable-force-cgi-redirect' 

'--enable-pcntl' '--with-imap=shared' '--with-imap-ssl' '--enable-

mbstring=shared' '--enable-mbregex' '--with-gd=shared' 

 '--enable-bcmath=shared' '--enable-dba=shared' '--with-db4=/usr'
'--with-

xmlrpc=shared' '--with-ldap=shared' '--with-ldap-sasl' 

 '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config'
'--

enable-dom=shared' '--with-pgsql=shared' 

'--enable-wddx=shared' '--with-snmp=shared,/usr' '--enable-soap=shared'
'--with-

xsl=shared,/usr' '--enable-xmlreader=shared' 

'--enable-xmlwriter=shared' '--with-curl=shared,/usr' '--enable-fastcgi'
'--

enable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' 

'--with-pdo-mysql=shared,/usr' '--with-pdo-pgsql=shared,/usr'
'--with-pdo-

sqlite=shared,/usr' '--with-pdo-dblib=shared,/usr' 

'--enable-json=shared' '--enable-zip=shared' '--with-readline' '--with-

pspell=shared' '--enable-phar=shared' '--with-mcrypt=shared,/usr' 

'--with-tidy=shared,/usr' '--with-mssql=shared,/usr'
'--enable-sysvmsg=shared' 

'--enable-sysvshm=shared' '--enable-sysvsem=shared' 

'--enable-posix=shared' '--with-unixODBC=shared,/usr'
'--enable-fileinfo=shared' 

'--enable-intl=shared' '--with-icu-dir=/usr' 

'--with-recode=shared,/usr'





Test script:
---
?php

$fmt = datefmt_create( en_US
,IntlDateFormatter::FULL,IntlDateFormatter::FULL,'America/Los_Angeles',IntlDateFormatter::GREGORIAN
 );

$arr = datefmt_localtime( $fmt, Wednesday, December 31, 1969 4:00:00 PM
PT,0);

echo First parsed output is ;

if ($arr) {


Bug #53698 [Bgs]: datefmt_localtime() and IntlDateFormatter::localtime() causes Fatal Error

2011-01-08 Thread t at kahkonen dot com
Edit report at http://bugs.php.net/bug.php?id=53698edit=1

 ID: 53698
 User updated by:t at kahkonen dot com
 Reported by:t at kahkonen dot com
 Summary:datefmt_localtime() and
 IntlDateFormatter::localtime() causes Fatal Error
 Status: Bogus
 Type:   Bug
 Package:Date/time related
 Operating System:   Linux 32-bit (Centos 5)
 PHP Version:5.3.5
 Block user comment: N
 Private report: N

 New Comment:

You are right. The documentation is not. I added a note to the page:

http://php.net/manual/en/intldateformatter.localtime.php


Previous Comments:

[2011-01-08 18:42:47] cataphr...@php.net

As the documentation says, you need to pass a variable, so you can't use
a literal like the 0 you're passing for the last arg.



Closing as bogus.


[2011-01-08 17:11:57] t at kahkonen dot com

PHP manual page for datefmt_localtime():

http://www.php.net/manual/en/intldateformatter.localtime.php


[2011-01-08 17:02:43] t at kahkonen dot com

Tested with php 5.3.5 and 5.3.3 (identical configure commands): the same
Fatal 

Error.



This seems to be a bug and is essential to get working, because I have
not found 

any other (easy) way to parse locale independent date/time-strings than


datefmt_localtime() function. You have to know only user locale (eg.
fi_FI.utf8) 

and the program knows how to parse/format correct full, median or short
date and 

time for this locale. datefmt_parse() is an other one, but it produces
timestamp 

with normal timestamp related problems (for example Year 2038 problem).


Meanwhile I use my own command line C program which uses directly ICU
library, 

but using is rather slow.


[2011-01-08 15:53:38] t at kahkonen dot com

Description:

PHP-version: PHP 5.3.3



When executing $arr = datefmt_localtime( $fmt, Wednesday, December 31,
1969 

4:00:00 PM PT,0), $arr should have parsed day, month, year, hour etc.
values, 

but there comes Fatal Error: Only variables can be passed by reference.



Configure Command: './configure'  '--build=i686-redhat-linux-gnu'
'--host=i686-

redhat-linux-gnu' '--target=i386-redhat-linux-gnu' 

 '--program-prefix=' '--prefix=/usr' '--exec-prefix=/usr'
'--bindir=/usr/bin' '-

-sbindir=/usr/sbin' '--sysconfdir=/etc' '--datadir=/usr/share' 

 '--includedir=/usr/include' '--libdir=/usr/lib'
'--libexecdir=/usr/libexec' '--

localstatedir=/var' '--sharedstatedir=/usr/com' 

 '--mandir=/usr/share/man' '--infodir=/usr/share/info' '--cache-

file=../config.cache' '--with-libdir=lib' 

 '--with-config-file-path=/etc' '--with-config-file-scan-dir=/etc/php.d'
'--

disable-debug' '--with-pic' '--disable-rpath' 

'--without-pear' '--with-bz2' '--with-exec-dir=/usr/bin'
'--with-freetype-

dir=/usr' '--with-png-dir=/usr' 

'--with-xpm-dir=/usr' '--enable-gd-native-ttf' '--without-gdbm'
'--with-gettext' 

'--with-gmp' '--with-iconv' 

 '--with-jpeg-dir=/usr' '--with-openssl' '--with-pcre-regex=/usr'
'--with-zlib' 

'--with-layout=GNU' '--enable-exif' 

 '--enable-ftp' '--enable-magic-quotes' '--enable-sockets'
'--enable-sysvsem' '-

-enable-sysvshm' '--enable-sysvmsg' 

'--with-kerberos' '--enable-ucd-snmp-hack' '--enable-shmop'
'--enable-calendar' 

'--without-mime-magic' '--without-sqlite' 

 '--without-sqlite3' '--with-libxml-dir=/usr' '--enable-xml'
'--with-system-

tzdata' '--enable-force-cgi-redirect' 

'--enable-pcntl' '--with-imap=shared' '--with-imap-ssl' '--enable-

mbstring=shared' '--enable-mbregex' '--with-gd=shared' 

 '--enable-bcmath=shared' '--enable-dba=shared' '--with-db4=/usr'
'--with-

xmlrpc=shared' '--with-ldap=shared' '--with-ldap-sasl' 

 '--with-mysql=shared,/usr' '--with-mysqli=shared,/usr/bin/mysql_config'
'--

enable-dom=shared' '--with-pgsql=shared' 

'--enable-wddx=shared' '--with-snmp=shared,/usr' '--enable-soap=shared'
'--with-

xsl=shared,/usr' '--enable-xmlreader=shared' 

'--enable-xmlwriter=shared' '--with-curl=shared,/usr' '--enable-fastcgi'
'--

enable-pdo=shared' '--with-pdo-odbc=shared,unixODBC,/usr' 

'--with-pdo-mysql=shared,/usr' '--with-pdo-pgsql=shared,/usr'
'--with-pdo-

sqlite=shared,/usr' '--with-pdo-dblib=shared,/usr' 

'--enable-json=shared' '--enable-zip=shared' '--with-readline' '--with-

pspell=shared' '--enable-phar=shared' '--with-mcrypt=shared,/usr' 

'--with-tidy=shared,/usr' '--with-mssql=shared,/usr'
'--enable-sysvmsg=shared' 

'--enable-sysvshm=shared' '--enable-sysvsem=shared' 

'--enable-posix=shared' '--with-unixODBC=shared,/usr'
'--enable-fileinfo=shared' 

'--enable-intl=shared' '--with-icu-dir=/usr' 

'--with-recode=shared,/usr'





Test script:
---
?php

$fmt = datefmt_create( en_US

Req #45543 [Com]: DateTime::setTimezone can not set timezones without ID

2011-01-08 Thread wrzasq at gmail dot com
Edit report at http://bugs.php.net/bug.php?id=45543edit=1

 ID: 45543
 Comment by: wrzasq at gmail dot com
 Reported by:tj at systisoft dot com
 Summary:DateTime::setTimezone can not set timezones without
 ID
 Status: Assigned
 Type:   Feature/Change Request
 Package:Date/time related
 Operating System:   All
 PHP Version:5.3CVS-2008-07-17 (CVS)
 Assigned To:derick
 Block user comment: N
 Private report: N

 New Comment:

I confirm the same on PHP 5.3.3, Debian 64bit.


Previous Comments:

[2009-06-29 16:25:01] scott at crisscott dot com

I was able to reproduce this with PHP 5.2.9 from the commandline. 



php -v

PHP 5.2.9 (cli) (built: May  1 2009 13:47:24) 



$ php -r '$d = new DateTime(2009-01-01 00:00:00+0400);
$d-setTimezone($d-getTimezone());'


[2008-07-17 14:34:47] tj at systisoft dot com

Description:



If you set a time zone for a DateTime via DateTime::setTimeZone() and
that time zone has no ID you get an error message and the time zone will
not be set.



This can lead to problems if you have two DateTime objects from a source
you do not control and want to format the second DateTime object in the
same time zone as the first.



Reproduce code:

---

$d1 = new DateTime('2008-01-01 12:00:00 +02:00');

$d2 = new DateTime('2008-01-01 12:00:00 UTC');

echo $d1-format(DATE_ISO8601), PHP_EOL;

echo $d2-format(DATE_ISO8601), PHP_EOL;

$d2-setTimeZone($d1-getTimeZone());

echo $d1-format(DATE_ISO8601), PHP_EOL;

echo $d2-format(DATE_ISO8601), PHP_EOL;



Expected result:



2008-01-01T12:00:00+0200

2008-01-01T12:00:00+

2008-01-01T12:00:00+0200

2008-01-01T14:00:00+0200



Actual result:

--

2008-01-01T12:00:00+0200

2008-01-01T12:00:00+

PHP Warning:  DateTime::setTimezone(): Can only do this for zones with

ID for now in /Users/tobias/test.php on line 5



Warning: DateTime::setTimezone(): Can only do this for zones with ID
for

now in /Users/tobias/test.php on line 5

2008-01-01T12:00:00+0200

2008-01-01T12:00:00+


[2008-07-17 13:07:47] tj at systisoft dot com

Description:

if you set a time zone for a DateTime via DateTime::setTimeZone() and
that time zone has no ID you get an error message and the time zone will
not be set.



This can lead to Problems if you have two DateTime objects from a surce
you do not control and want to format the secont DateTime object in the
same time zone as the first.

Reproduce code:
---
$d1 = new DateTime('2008-01-01 12:00:00 +02:00');

$d2 = new DateTime('2008-01-01 12:00:00 UTC');

echo $d1-format(DATE_ISO8601), PHP_EOL;

echo $d2-format(DATE_ISO8601), PHP_EOL;

$d2-setTimeZone($d1-getTimeZone());

echo $d1-format(DATE_ISO8601), PHP_EOL;

echo $d2-format(DATE_ISO8601), PHP_EOL;

Expected result:

2008-01-01T12:00:00+0200

2008-01-01T12:00:00+

2008-01-01T12:00:00+0200

2008-01-01T14:00:00+0200

Actual result:
--
2008-01-01T12:00:00+0200

2008-01-01T12:00:00+

PHP Warning:  DateTime::setTimezone(): Can only do this for zones with
ID for now in /Users/tobias/test.php on line 5



Warning: DateTime::setTimezone(): Can only do this for zones with ID for
now in /Users/tobias/test.php on line 5

2008-01-01T12:00:00+0200

2008-01-01T12:00:00+






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


Bug #53439 [Asn]: DatePeriod does not expose any properties

2011-01-08 Thread cataphract
Edit report at http://bugs.php.net/bug.php?id=53439edit=1

 ID: 53439
 Updated by: cataphr...@php.net
 Reported by:from dot php dot net at brainbox dot cz
 Summary:DatePeriod does not expose any properties
 Status: Assigned
 Type:   Bug
 Package:Date/time related
 Operating System:   Windows XP SP3
 PHP Version:5.3.3
-Assigned To:cataphract
+Assigned To:derick
 Block user comment: N
 Private report: N

 New Comment:

Reassigning to Derick, as the patch I've written is under his
consideration.


Previous Comments:

[2010-12-01 17:58:19] from dot php dot net at brainbox dot cz

Description:

The DatePeriod instance does not expose its internal properties, thus
makes impossible to extend the class.



The properties are not visible in the reflection as well. Also, when I
cast the instance to array (which usually exposes all properties), no
props are shown.



The draft of the test follows.

Test script:
---
$dp = new DatePeriod(new DateTime('2010-01-01'), new
DateInterval('P1D'), 2);

$r = new ReflectionObject($dp);

$arr = (array)$dp; // cast to array to see the values of propeties



echo Properties:\r\n;

foreach($r-getProperties() as $v) {

echo $v-getName().\r\n;

}

echo \r\n;



echo Methods:\r\n;

foreach($r-getMethods() as $v) {

echo $v-getName().\r\n;

}

echo \r\n;



echo Array cast:\r\n;

echo strtr(print_r($arr, true), \0, '_');

Expected result:

Properties:

any_valid_properties...

...listed_here_after_implementing



Array cast:

Array

(

   any_valid_properties...

   ...listed_here_after_implementing

)



Actual result:
--
Properties:



Array cast:

Array

(

)








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


Bug #53437 [Asn]: Crash when using unserialized DatePeriod instance

2011-01-08 Thread cataphract
Edit report at http://bugs.php.net/bug.php?id=53437edit=1

 ID: 53437
 Updated by: cataphr...@php.net
 Reported by:from dot php dot net at brainbox dot cz
 Summary:Crash when using unserialized DatePeriod instance
 Status: Assigned
 Type:   Bug
 Package:Date/time related
 Operating System:   Windows XP SP3
 PHP Version:5.3.3
-Assigned To:cataphract
+Assigned To:derick
 Block user comment: N
 Private report: N

 New Comment:

Reassigning to Derick, as the patch I've written is under his
consideration.


Previous Comments:

[2010-12-01 21:50:03] fel...@php.net

Duplicated of #52113


[2010-12-01 17:15:05] from dot php dot net at brainbox dot cz

Description:

DatePeriod class does not have the serialization/unserialization logic
implemented. Therefore, when unserialized instance is used, script
crashes.



This is result of serializing the DatePeriod instance:

O:10:DatePeriod:0:{}



unserialize() wents fine as well, but when I call foreach() on
unserialized instance, the script crashes.

Test script:
---
$dp = new DatePeriod(new DateTime('2010-01-01 UTC'), new
DateInterval('P1D'), 2);



echo Original:\r\n;

foreach($dp as $dt) {

echo $dt-format('Y-m-d H:i:s').\r\n;

}

echo \r\n;



$ser = serialize($dp); // $ser is: O:10:DatePeriod:0:{}



// Create dangerous instance

$dpu = unserialize($ser); // $dpu has invalid values…



echo Unserialized:\r\n;

// …which leads to CRASH:

foreach($dpu as $dt) {

echo $dt-format('Y-m-d H:i:s').\r\n;

}

Expected result:

Original:

2010-01-01 00:00:00

2010-01-02 00:00:00

2010-01-03 00:00:00



Unserialized:

2010-01-01 00:00:00

2010-01-02 00:00:00

2010-01-03 00:00:00



Actual result:
--
PHP crashes on the unserialize line.






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


Req #53146 [Asn]: DateInterval Object cannot be serialized

2011-01-08 Thread cataphract
Edit report at http://bugs.php.net/bug.php?id=53146edit=1

 ID: 53146
 Updated by: cataphr...@php.net
 Reported by:j dot lutz at lutz-it dot com
 Summary:DateInterval Object cannot be serialized
 Status: Assigned
 Type:   Feature/Change Request
 Package:Date/time related
 Operating System:   Win7
 PHP Version:5.3.3
-Assigned To:cataphract
+Assigned To:derick
 Block user comment: N
 Private report: N

 New Comment:

Reassigning to Derick, as the patch I've written is under his
consideration.


Previous Comments:

[2010-10-24 20:50:43] j dot lutz at lutz-it dot com

Description:

Same problem as in #39821 regarding DateTime Object which was not
serializabel until v5.3.



After unserialize of a DateInterval-Object it's not possible to use the
method format() onto this object. 



ErrorException [ Warning ]: DateInterval::format()

The DateInterval object has not been correctly initialized by its
constructor



but that would be very handy ;-)







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


[PHP-BUG] Req #53700 [NEW]: Correct city name

2011-01-08 Thread bimal at sanjaal dot com
From: 
Operating system: all
PHP version:  5.3.5
Package:  Date/time related
Bug Type: Feature/Change Request
Bug description:Correct city name

Description:

The city name is wrong in the binary compile.

 'Asia/Katmandu' = 5.45,



It should be actually typed as:

 'Asia/Kathmandu' = 5.45,



Many other applications use the correct name: Kathmandu.

May be PHP has to fix it and announce.


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