#42272 [NEW]: var_export() incorrectly escapes char(0)

2007-08-11 Thread pilots at rambler dot ru
From: pilots at rambler dot ru
Operating system: WindowsXP
PHP version:  5.2.4RC1
PHP Bug Type: Variables related
Bug description:  var_export() incorrectly escapes char(0)

Description:

var_export() incorrectly escapes char(0) in strings. It returns '\000' in
single quotes, therefore then this string can not be imported correctly.


Reproduce code:
---
eval('echo '.var_export(\0,true).';');

Expected result:

// chr(0)

Actual result:
--
\000

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


Bug #15651 Updated: Output is broken

2002-02-23 Thread pilots

 ID:   15651
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
-Status:   Feedback
+Status:   Open
 Bug Type: *General Issues
 Operating System: Win2K-Server / UNIX
 PHP Version:  4.1.1
 New Comment:

I made test using the advised method, and found that crush appears in
one my simple function call. A simple example goes below:

?
// --\
// Apply specified function to arguments
//   if 2'nd argument is an array, its elements replace arguments
//   it's a way to apply function to arguments by their references
// Examples:
//   list($c1)=call(intval,$a1);
//   list($c2,$c3)=call(htmlspecialchars,$b2,$b3);
//   call(htmlspecialchars,array($b2,$b3));
// \
function call() {
  if (func_num_args()2) return false;
  $argv=func_get_args();
  $func=array_shift($argv);
error_log(__FILE__.'('.__LINE__.')');   //
  if (is_array($argv[0])) $argv=$argv[0];  // Crush is here
error_log(__FILE__.'('.__LINE__.')');   //
  reset($argv);
  while (list($k,$v)=each($argv)) $argv[$k]=$func($v);
  reset($argv);
  return $argv;
  }
// /


call(intval,1);   // OK
call(intval,array(1));// Crush
?

Note: actually cutting line goes some earlier than that crush point,
but, I think it's because some PHP bufferization, and is not important
now.


Previous Comments:


[2002-02-22 06:35:16] [EMAIL PROTECTED]

Could you set up linux/freebsd box to reproduce this bug? 
And generate backtrace. (Or get exit code with gdb)

You can write error_log(__FILE__.'(.'__LINE__.')')
to locate to find ofending function/line also.





[2002-02-21 21:27:48] [EMAIL PROTECTED]

Sorry. I wanted to say ... My site is complex enough...



[2002-02-21 21:25:45] [EMAIL PROTECTED]

I tryed to make some small scripts before, but there were no problems
with them. My site is complete enough, there is a lot of includes (but
execution time for homepage on my PC is less than 1 sec.). It looks
like there are no problems for simply scripts, but I'll try again to
make something ...
By that time, if you like you may watch the results on different
servers:
1) php4.0.6: http://www.sec4.wfdns.com/www.freetakeout.com/
2) php4.1.1: http://vh110014.radntech.ca/fto/ 
- you may try to click some links there (log-in to your account, for
example) to see the difference in cutting point.



[2002-02-21 20:26:05] [EMAIL PROTECTED]

If you can create _short_  _complete_ script that reproduces the
problem. We can fix it :)



[2002-02-21 18:37:26] [EMAIL PROTECTED]

Unfortunately, my home OS is Win2K-Server, and I myself don't have VC++
to try to build PHP from sources...
Can I provide any useful information for you, using my OS software
which I already have?
I have both IIS and Apache web servers.



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/15651

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




Bug #14391 Updated: gmmktime, gmdate work incorrect

2002-02-22 Thread pilots

 ID:   14391
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
 Status:   No Feedback
 Bug Type: Date/time related
 Operating System: Windows 2000 Server
 PHP Version:  4.0.6
 New Comment:

I setuped php4.1.1 on my Win2K, and now there is no problem with Z
parameter in gmdate() function, but timestamp returned by gmmktime in
winter time is still wrong. 
Will be this bug fixed?


Previous Comments:


[2002-02-22 05:16:06] [EMAIL PROTECTED]

Hi,

This bug is still here, and still causing grief. Sadly, it's been
marked No Feedback now. Will someone please sort this? I can't
imagine it's a particularly complicated thing to fix, since it seems to
be okay on some platforms.

Max



[2002-02-19 15:40:37] [EMAIL PROTECTED]

Any updates on this bug as it appears to still be in 4.1.1



[2002-02-14 00:00:03] [EMAIL PROTECTED]

No feedback was provided for this bug for over a month, so it is
being suspended automatically. If you are able to provide the
information that was originally requested, please do so and change
the status of the bug back to Open.



[2002-01-27 18:40:15] [EMAIL PROTECTED]

i have two systems a)redhat 7.0 and b) win2000.
both have PHP Version 4.1.1

each has exactly the same code.

any calls to gmmktime on linux are fine, but win2000 is not, which is
unfortunate due to the fact that it's a calendar application.

any idea when this will be cleared up?



[2002-01-20 10:54:51] [EMAIL PROTECTED]

Here's an example:

first of all, to show that the system understands what's going on:

$ date +%c %Z
Tue Dec 18 22:51:16 2001 GMT
$ date -u +%c %Z
Tue Dec 18 22:51:21 2001 GMT

 - same result. so the machine knows what tz it's in.

Now, I'm in GMT at the moment, so 

echo date(H:i,mktime(22,20,00,12,18,01)).p;  //gives 22.20
echo gmdate(H:i,mktime(22,20,00,12,18,01)).p; // gives 22.20

as expected. but...

echo date(H:i,gmmktime(22,20,00,12,18,01)).p;  //gives 21.20
echo gmdate(H:i,gmmktime(22,20,00,12,18,01)).p; // gives 21.20

These should also give 22.20, so it looks to me that gmmktime() is
screwed.

Max



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/14391

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




Bug #15651 Updated: Output is broken

2002-02-21 Thread pilots

 ID:   15651
 Updated by:   [EMAIL PROTECTED]
 Reported By:  [EMAIL PROTECTED]
 Status:   Open
 Bug Type: *General Issues
 Operating System: Win2K-Server / UNIX
 PHP Version:  4.1.1
 New Comment:

Sorry. I wanted to say ... My site is complex enough...


Previous Comments:


[2002-02-21 21:25:45] [EMAIL PROTECTED]

I tryed to make some small scripts before, but there were no problems
with them. My site is complete enough, there is a lot of includes (but
execution time for homepage on my PC is less than 1 sec.). It looks
like there are no problems for simply scripts, but I'll try again to
make something ...
By that time, if you like you may watch the results on different
servers:
1) php4.0.6: http://www.sec4.wfdns.com/www.freetakeout.com/
2) php4.1.1: http://vh110014.radntech.ca/fto/ 
- you may try to click some links there (log-in to your account, for
example) to see the difference in cutting point.



[2002-02-21 20:26:05] [EMAIL PROTECTED]

If you can create _short_  _complete_ script that reproduces the
problem. We can fix it :)



[2002-02-21 18:37:26] [EMAIL PROTECTED]

Unfortunately, my home OS is Win2K-Server, and I myself don't have VC++
to try to build PHP from sources...
Can I provide any useful information for you, using my OS software
which I already have?
I have both IIS and Apache web servers.



[2002-02-21 06:04:33] [EMAIL PROTECTED]

Then you are having crash bug(s).
First grab snapshot http://snaps.php.net and check if you still have
the problem. (Make sure you build with --enable-debug)

If you still have problems, check your httpd error logs. If you see
segfaults, send a backtrace. 



[2002-02-21 05:49:16] [EMAIL PROTECTED]

I use default settings:

output_buffering = Off
zlib.output_compression = Off

and don't use any output buffering functions



The remainder of the comments for this report are too long. To view
the rest of the comments, please view the bug report online at
http://bugs.php.net/15651

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