PHP Version 3

Table of Contents

  1. Introduction
  2. Configuration Directives
  3. Changed behaviour
  4. Miscellaneous
  5. Migration
  6. Debugger
  7. Internals

Introduction

The PHP 3 documentation was removed from the PHP Manual and placed here for historical purposes. An attempt was made to preserve all of the text although it's highly likely that some is missing. The last PHP 3 release (3.0.18) was made on October 20, 2000.

See the PHP Museum for downloads, and also read the history for further information about PHP 3.

Configuration Directives

Most directives are prepended with php3_ instead of php_. These differences are not mentioned in this document.

Changed

FTP configure option changed from --with-ftp to --enable-ftp

The value of E_ALL is 63.

The asp_tags directive was added in PHP 3.0.4.

The E_* constants have no meaning in php3.ini, but numeric values do.

Removed

--with-imsp[=DIR] includes IMSP support (DIR is IMSP's include dir and libimsp.a dir).

--with-mck[=DIR] includes Cybercash MCK support. DIR is the cybercash mck build directory, defaults to /usr/src/mck-3.2.0.3-linux

--with-mod-dav=DIR includes DAV support through Apache's mod_dav, DIR is mod_dav's installation directory (Apache module version only).

If the sybase.compatability_mode directive is on, this will cause PHP to automatically assign types to results according to their Sybase type, instead of treating them all as strings.

Changed Behaviour

Return values

unset() returns 1.

Multiple calls to setcookie() in the same script will be performed in reverse order. And put the insert before the delete when trying to delete one cookie before inserting another.

eval() does not return a value.

Function parameters

gettype() has a 'user function' return value.

htmlspecialchars() added the second parameter in PHP 3.0.17.

error_log()'s second parameter, message, goes through the debugger.

empty() considers "0" as non-empty, a value that for example may come from an HTML form.

Other

Variables are always assigned by value, as there are no references.

Using arrays within HTML forms is limited to single dimensional arrays.

When escaping characters in single quoted strings, an E_NOTICE level error is generated.

Objects lose their class association throughout the process of serialization and unserialization.

Functions must be defined before use. In other words, top to bottom.

Variable number of arguments are not supported.

Return may only be used within function blocks.

Miscellaneous

The PCRE modifier is not available.

is_uploaded_file() exists as of PHP 3.0.16.

BC Math is enabled by default, --disable-bcmath disables it.

The behaviour of register_globals is always on, because the directive does not exist.

The short_tags() function may be used to enable short tags (<?).

The CGI build has a 'make bench' tool for benchmarking the build. It will likely take over 30 seconds to run so be sure to allow the appropriate time limit.

SAPI support is not available.

The HTTP PUT method is allowed for saving files, which are handled similarly to POST method file saves. $PHP_PUT_FILENAME holds the location of the temporary file created, which must be moved during the request else it will be deleted.

ODBC is enabled by default, to disable use --disable-unified-odbc

GD is enabled by default, to disable use --without-gd

Installing PHP 3 in Apache:

   AddModule mod_php3.c
   LoadModule php3_module modules/libphp3.so
   AddType application/x-httpd-php3 .php3
  

The SESAM extension is specific to PHP 3 and was removed.

Migration

There are a few migration specific documents involving PHP 3 but due to their size and structure they were not added to this document.

Debugger

Information related to the debugger that comes standard with PHP 3 was not added to this document.

Internals

Information related to the internal workings of PHP 3 that is commonly used to create extensions was not added to this document.