php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #18143 writing binary number as raw binary
Submitted: 2002-07-03 12:57 UTC Modified: 2002-07-03 13:21 UTC
From: ericksbr at infocon-inc dot com Assigned:
Status: Not a bug Package: Filesystem function related
PHP Version: 4.1.2 OS: Windows NT 4.0 SP 5 (Intel)
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: ericksbr at infocon-inc dot com
New email:
PHP Version: OS:

 

 [2002-07-03 12:57 UTC] ericksbr at infocon-inc dot com
Basically, what I want to do is write the
hexadecimal value "0x0F000000L" out to a file,
without it being converted to a string.
I am using a C program to read the file and
the results don't match.

// #define COUNT_FLAG		0x0F000000L
define("COUNT_FLAG", "251658240", FALSE);
// define("COUNT_FLAG", "0x0F000000", FALSE);
	// Open file
	$fp = fopen($sTempFileName, "ab");

	fwrite($fp, COUNT_FLAG);
	// Copy Count
	fwrite($fp, $nCopyCount);
	fwrite($fp,
		intval(COUNT_FLAG)
		);
	fwrite($fp,
		serialize(intval($nCopyCount))
		);
	fclose($fp);

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-07-03 13:21 UTC] sander@php.net
Sorry, but the bug system is not the appropriate forum for asking
support questions. 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

Thank you for your interest in PHP.

Hint: use chr()
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 04 23:01:33 2025 UTC