PHP3 magic bytes (.php3)
.php3 file signature: 3C 3F 70 68 70 | text/x-php
PHP3 is a legacy server-side script file associated with PHP 3, the open-source scripting language created by Rasmus Lerdorf and later maintained by the PHP development community. It is used to generate dynamic web pages, process forms, and interact with databases on web servers configured to interpret PHP content. As an obsolete format, it may still be encountered in older applications, and its safety depends on server configuration and the trustworthiness of the script source.
Magic Bytes
Offset 0
3C 3F 70 68 70
Sources: Apache Tika
Validation Code
How to validate .php3 files in Python
def is_php3(file_path: str) -> bool:
"""Check if file is a valid PHP3 by magic bytes."""
signature = bytes([0x3C, 0x3F, 0x70, 0x68, 0x70])
with open(file_path, "rb") as f:
return f.read(5) == signature
How to validate .php3 files in Node.js
function isPHP3(buffer: Buffer): boolean {
const signature = Buffer.from([0x3C, 0x3F, 0x70, 0x68, 0x70]);
return buffer.subarray(0, 5).equals(signature);
}
How to validate .php3 files in Go
func IsPHP3(data []byte) bool {
signature := []byte{0x3C, 0x3F, 0x70, 0x68, 0x70}
if len(data) < 5 {
return false
}
return bytes.Equal(data[:5], signature)
}
API Endpoint
/api/v1/php3
curl https://filesignature.org/api/v1/php3
See the full API documentation for all endpoints and parameters.
Related Formats
Frequently Asked Questions
What is a .php3 file?
A .php3 file is identified by the magic bytes 3C 3F 70 68 70 at byte offset 0. PHP3 is a legacy server-side script file associated with PHP 3, the open-source scripting language created by Rasmus Lerdorf and later maintained by the PHP development community. It is used to generate dynamic web pages, process forms, and interact with databases on web servers configured to interpret PHP content. As an obsolete format, it may still be encountered in older applications, and its safety depends on server configuration and the trustworthiness of the script source.
What are the magic bytes for .php3 files?
The magic bytes for PHP3 (.php3) files are 3C 3F 70 68 70 at byte offset 0. These bytes identify the file format more reliably than the extension alone.
How do I validate a .php3 file?
To validate a .php3 file, read the first bytes of the file and compare them against the known magic bytes (3C 3F 70 68 70) at offset 0. This is more reliable than checking the file extension alone, as extensions can be renamed.
What is the MIME type for .php3 files?
The primary MIME type for .php3 files is text/x-php.
Is it safe to open .php3 files?
PHP3 (.php3) files are generally safe to open. They are classified as low risk because they primarily contain data rather than executable code. However, always ensure files come from a trusted source.