Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions UPGRADING.INTERNALS
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ PHP 7.0 INTERNALS UPGRADE NOTES
k. get_class_entry object handler info
l. get_class_name object handler info
m. Other portable macros info
n. ZEND_ENGINE_2 removal

2. Build system changes
a. Unix build system changes
Expand Down Expand Up @@ -121,6 +122,8 @@ PHP 7.0 INTERNALS UPGRADE NOTES
ZEND_FASTCALL is defined to use __vectorcall convention on VS2013 and above
ZEND_NORETURN is defined as __declspec(noreturn) on VS

n. The ZEND_ENGINE_2 macro has been removed. A ZEND_ENGINE_3 macro has been added.

========================
2. Build system changes
========================
Expand Down
4 changes: 2 additions & 2 deletions Zend/zend.h
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@
#ifndef ZEND_H
#define ZEND_H

#define ZEND_VERSION "2.8.0-dev"
#define ZEND_VERSION "3.0.0-dev"

#define ZEND_ENGINE_2
#define ZEND_ENGINE_3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Since a lot of code may do #ifdef ZEND_ENGINE_2, maybe it'd be good to leave ZEND_ENGINE_2 there but also add ZEND_ENGINE_3 in addition to it?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That'd make sense, would avoid updating existing extensions. Maybe we should add a comment for clarity in that case, though? Something like this:

/* ZEND_ENGINE_2 is also defined for backwards-compatibility
 * Therefore, do not assume that because ZEND_ENGINE_2 is defined, it is ZE2
 * This only guarantees it is ZE2 or later
 */

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, actually, I don't think I'll keep ZEND_ENGINE_2 around. Code that checks for it should probably just be removed, since that's basically just checking for PHP 5, and it's been a decade since its release. Plus, this'd complicate checks by cross-5/7-compatible code, as ZEND_ENGINE_2 wouldn't guarantee it's actually ZE2, you'd have to do defined(ZEND_ENGINE_2) && !defined(ZEND_ENGINE_3), or worse, !defined(ZEND_ENGINE_3) which isn't future-proof against a hyptothetical Zend Engine 4.


#define ZEND_MAX_RESERVED_RESOURCES 4

Expand Down
4 changes: 2 additions & 2 deletions Zend/zend_extensions.h
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@
#include "zend_compile.h"
#include "zend_build.h"

/* The first number is the engine version and the rest is the date.
/* The first number is the engine version and the rest is the date (YYYYMMDD).
* This way engine 2/3 API no. is always greater than engine 1 API no..
*/
#define ZEND_EXTENSION_API_NO 220140815
#define ZEND_EXTENSION_API_NO 320140815

typedef struct _zend_extension_version_info {
int zend_extension_api_no;
Expand Down
12 changes: 1 addition & 11 deletions ext/mysql/php_mysql.c
Original file line number Diff line number Diff line change
Expand Up @@ -35,13 +35,7 @@
#include "ext/standard/php_string.h"
#include "ext/standard/basic_functions.h"

#ifdef ZEND_ENGINE_2
# include "zend_exceptions.h"
#else
/* PHP 4 compat */
# define OnUpdateLong OnUpdateInt
# define E_STRICT E_NOTICE
#endif
#include "zend_exceptions.h"

#if HAVE_MYSQL

Expand Down Expand Up @@ -2075,7 +2069,6 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
mysql_row_length_type *mysql_row_lengths;
#endif

#ifdef ZEND_ENGINE_2
if (into_object) {
zend_string *class_name = NULL;

Expand All @@ -2094,7 +2087,6 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
}
result_type = MYSQL_ASSOC;
} else
#endif
{
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &res, &result_type) == FAILURE) {
return;
Expand Down Expand Up @@ -2162,7 +2154,6 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
mysqlnd_fetch_into(mysql_result, ((result_type & MYSQL_NUM)? MYSQLND_FETCH_NUM:0) | ((result_type & MYSQL_ASSOC)? MYSQLND_FETCH_ASSOC:0), return_value, MYSQLND_MYSQL);
#endif

#ifdef ZEND_ENGINE_2
/* mysqlnd might return FALSE if no more rows */
if (into_object && Z_TYPE_P(return_value) != IS_FALSE) {
zval dataset;
Expand Down Expand Up @@ -2225,7 +2216,6 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
zend_throw_exception_ex(zend_exception_get_default(TSRMLS_C), 0 TSRMLS_CC, "Class %s does not have a constructor hence you cannot use ctor_params", ce->name->val);
}
}
#endif

}
/* }}} */
Expand Down
6 changes: 3 additions & 3 deletions ext/oci8/oci8.c
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ ZEND_GET_MODULE(oci8)
#endif /* COMPILE_DL */
/* }}} */

#ifdef ZEND_ENGINE_2
#if defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3)

/* {{{ Function arginfo */
ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_define_by_name, 0, 0, 3)
Expand Down Expand Up @@ -645,7 +645,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_trim_method, 0, 0, 1)
ZEND_END_ARG_INFO()
/* }}} */

#else /* ZEND_ENGINE_2 */
#else /* defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3) */
/* {{{ Keep the old arginfo behavior when building with PHP 4 */

static unsigned char arginfo_ocifetchinto[] = { 2, BYREF_NONE, BYREF_FORCE };
Expand Down Expand Up @@ -755,7 +755,7 @@ static unsigned char arginfo_oci_bind_array_by_name[] = { 3, BYREF_NONE, BYREF_N
#define arginfo_oci_collection_trim_method NULL
#define arginfo_oci_collection_free_method NULL
/* }}} */
#endif /* ZEND_ENGINE_2 */
#endif /* defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3) */

/* {{{ extension function prototypes
*/
Expand Down
4 changes: 1 addition & 3 deletions ext/pdo_firebird/firebird_driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,7 @@
#define _GNU_SOURCE

#include "php.h"
#ifdef ZEND_ENGINE_2
# include "zend_exceptions.h"
#endif
#include "zend_exceptions.h"
#include "php_ini.h"
#include "ext/standard/info.h"
#include "pdo/php_pdo.h"
Expand Down
3 changes: 0 additions & 3 deletions ext/xmlwriter/php_xmlwriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,6 @@ extern zend_module_entry xmlwriter_module_entry;
typedef struct _xmlwriter_object {
xmlTextWriterPtr ptr;
xmlBufferPtr output;
#ifndef ZEND_ENGINE_2
xmlOutputBufferPtr uri_output;
#endif
} xmlwriter_object;


Expand Down
4 changes: 2 additions & 2 deletions ext/zip/zip_stream.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#endif
#include "php.h"
#if HAVE_ZIP
#ifdef ZEND_ENGINE_2
#if defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3)

#include "php_streams.h"
#include "ext/standard/file.h"
Expand Down Expand Up @@ -348,5 +348,5 @@ php_stream_wrapper php_stream_zip_wrapper = {
NULL,
0 /* is_url */
};
#endif /* ZEND_ENGINE_2 */
#endif /* defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3) */
#endif /* HAVE_ZIP */
4 changes: 0 additions & 4 deletions main/internal_functions_win32.c
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,6 @@
#include <stdlib.h>
#include <stdio.h>

#ifndef ZEND_ENGINE_2
#error HEAD does not work with ZendEngine1 anymore
#endif

#include "ext/standard/dl.h"
#include "ext/standard/file.h"
#include "ext/standard/fsock.h"
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do wonder why this is here at all. Were people trying to build PHP5 internal files for PHP 4? Was this in an extension? Regardless, I doubt we still need this message after more than ten years.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

initially it came from 7c0e7b4#diff-89fb8b368c48bf62a149e0c2853141e7

and later on was moved to this location
914cf3c#diff-358b07727650bd64ec27ffb307a91f2f

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh wow, it's been 11 years, then!

Expand Down