#29258 [Com]: conversion between unix timestamp and variant VT_date

2004-10-26 Thread norny at yahoo dot com
 ID:   29258
 Comment by:   norny at yahoo dot com
 Reported By:  arnout at argeweb dot nl
 Status:   Closed
 Bug Type: COM related
 Operating System: Windows 2003 server,standard
 PHP Version:  5.0.0
 New Comment:

Was this applied to php 4.3.9? I'm having a similar problem with times
after applying some Win2k3 server critical updates.


Previous Comments:


[2004-07-28 09:13:36] arnout at argeweb dot nl

Seems to be fixed in CVS. Thanks!



[2004-07-22 14:49:13] [EMAIL PROTECTED]

Please try using this CVS snapshot:

  http://snaps.php.net/php5-latest.tar.gz
 
For Windows:
 
  http://snaps.php.net/win32/php5-win32-latest.zip

Please try a snapshot.



[2004-07-19 15:19:43] arnout at argeweb dot nl

Description:

Converting dates using variant_date_from_timestamp() loses 2 hours. 
Might be some timezone-like thing but then again:
variant_date_to_timestamp() does give a precise translation.

I'm running apache 2 with php 5.0.0 RC 2. I tried both CGI and through
apache.

Reproduce code:
---
?

$nu = date('Ymd');
echo now: $nu\n;

$timestamp = mktime( 0, 0, 0, date('m'), date('d'), date('Y') );   //
Ymd = 2004 07 19
echo now timestamp: $timestamp\n;

echo a.k.a. : .$timestamp. = .date('Ymd', $timestamp ).\n;

$variant = variant_date_from_timestamp( $timestamp );
//$variant = variant_date_from_timestamp( time() );

echo variant: .$variant.\n;

$var_timestamp = variant_date_to_timestamp( $variant );
echo and back again: .$var_timestamp. = .date('Ymd', $var_timestamp
).\n;

?

Expected result:

now: 20040719
now timestamp: 1090188000
a.k.a. : 1090188000 = 20040719
variant: 19-7-2004 0:00:00
and back again: 1090188000 = 20040719


Actual result:
--
now: 20040719
now timestamp: 1090188000
a.k.a. : 1090188000 = 20040719
variant: 18-7-2004 22:00:00
and back again: 1090180800 = 20040718

// 2 hours gone! And even worse: The date changed!





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


#24822 [NEW]: order of function scope searching doesn't match docs

2003-07-26 Thread norny at yahoo dot com
From: norny at yahoo dot com
Operating system: Windows XP
PHP version:  5CVS-2003-07-26 (dev)
PHP Bug Type: Zend Engine 2 problem
Bug description:  order of function scope searching doesn't match docs

Description:

According to http://www.php.net/ZEND_CHANGES.txt,

WIth both constants and functions, if you don't specify a class context
the current class will be searched first and if the search fails then the
global scope will be searched. If you want to force PHP to only check the
global scope you can use the main:: accessor.

The snap I just downloaded seems to be search global first then the class
second. Main:: doesn't seem to exist.

Reproduce code:
---
?php

function asdf() {
   echo 'global';
}

class FooClass {
  function asdf() {
echo 'class';
  }
  function printFoo() {
asdf(); // outputs 'global'
self::asdf(); // outputs 'class'
main::asdf(); // Fatal error: Class 'main' not found in
C:\Apache2\htdocs\test.php on line 14
  }
}
$qwerty = new FooClass;
$qwerty-printFoo();
?

Expected result:

The first call to asdf() in printFoo should produce 'class'. The second
self::asdf() seems to be correct, and the main::asdf() should print
'global'

Actual result:
--
The first call to asdf() in printFoo() should print 'class', not 'global'.
The main:: accessor doesn't seem to be known but ZEND_CHANGES.txt says it
does exist.

-- 
Edit bug report at http://bugs.php.net/?id=24822edit=1
-- 
Try a CVS snapshot (php4):  http://bugs.php.net/fix.php?id=24822r=trysnapshot4
Try a CVS snapshot (php5):  http://bugs.php.net/fix.php?id=24822r=trysnapshot5
Fixed in CVS:   http://bugs.php.net/fix.php?id=24822r=fixedcvs
Fixed in release:   http://bugs.php.net/fix.php?id=24822r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=24822r=needtrace
Try newer version:  http://bugs.php.net/fix.php?id=24822r=oldversion
Not developer issue:http://bugs.php.net/fix.php?id=24822r=support
Expected behavior:  http://bugs.php.net/fix.php?id=24822r=notwrong
Not enough info:http://bugs.php.net/fix.php?id=24822r=notenoughinfo
Submitted twice:http://bugs.php.net/fix.php?id=24822r=submittedtwice
register_globals:   http://bugs.php.net/fix.php?id=24822r=globals
PHP 3 support discontinued: http://bugs.php.net/fix.php?id=24822r=php3
Daylight Savings:   http://bugs.php.net/fix.php?id=24822r=dst
IIS Stability:  http://bugs.php.net/fix.php?id=24822r=isapi
Install GNU Sed:http://bugs.php.net/fix.php?id=24822r=gnused