Skip to content

Commit 150dc69

Browse files
Merge branch 'ZendEngine3'
* ZendEngine3: Restored zip/oci8 PHP 4 code, add PHP 7 checks Note macro removal in UPGRADING.INTERNALS Removed ZEND_ENGINE_2 checks (and ZE1 code, it's been a decade!) Zend Engine 3
2 parents b7251a8 + 8a065c5 commit 150dc69

File tree

9 files changed

+14
-30
lines changed

9 files changed

+14
-30
lines changed

UPGRADING.INTERNALS

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ PHP 7.0 INTERNALS UPGRADE NOTES
1212
k. get_class_entry object handler info
1313
l. get_class_name object handler info
1414
m. Other portable macros info
15+
n. ZEND_ENGINE_2 removal
1516

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

125+
n. The ZEND_ENGINE_2 macro has been removed. A ZEND_ENGINE_3 macro has been added.
126+
124127
========================
125128
2. Build system changes
126129
========================

Zend/zend.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,9 @@
2222
#ifndef ZEND_H
2323
#define ZEND_H
2424

25-
#define ZEND_VERSION "2.8.0-dev"
25+
#define ZEND_VERSION "3.0.0-dev"
2626

27-
#define ZEND_ENGINE_2
27+
#define ZEND_ENGINE_3
2828

2929
#define ZEND_MAX_RESERVED_RESOURCES 4
3030

Zend/zend_extensions.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,10 +25,10 @@
2525
#include "zend_compile.h"
2626
#include "zend_build.h"
2727

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

3333
typedef struct _zend_extension_version_info {
3434
int zend_extension_api_no;

ext/mysql/php_mysql.c

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,13 +35,7 @@
3535
#include "ext/standard/php_string.h"
3636
#include "ext/standard/basic_functions.h"
3737

38-
#ifdef ZEND_ENGINE_2
39-
# include "zend_exceptions.h"
40-
#else
41-
/* PHP 4 compat */
42-
# define OnUpdateLong OnUpdateInt
43-
# define E_STRICT E_NOTICE
44-
#endif
38+
#include "zend_exceptions.h"
4539

4640
#if HAVE_MYSQL
4741

@@ -2075,7 +2069,6 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
20752069
mysql_row_length_type *mysql_row_lengths;
20762070
#endif
20772071

2078-
#ifdef ZEND_ENGINE_2
20792072
if (into_object) {
20802073
zend_string *class_name = NULL;
20812074

@@ -2094,7 +2087,6 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
20942087
}
20952088
result_type = MYSQL_ASSOC;
20962089
} else
2097-
#endif
20982090
{
20992091
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "r|l", &res, &result_type) == FAILURE) {
21002092
return;
@@ -2162,7 +2154,6 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
21622154
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);
21632155
#endif
21642156

2165-
#ifdef ZEND_ENGINE_2
21662157
/* mysqlnd might return FALSE if no more rows */
21672158
if (into_object && Z_TYPE_P(return_value) != IS_FALSE) {
21682159
zval dataset;
@@ -2225,7 +2216,6 @@ static void php_mysql_fetch_hash(INTERNAL_FUNCTION_PARAMETERS, zend_long result_
22252216
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);
22262217
}
22272218
}
2228-
#endif
22292219

22302220
}
22312221
/* }}} */

ext/oci8/oci8.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,7 @@ ZEND_GET_MODULE(oci8)
148148
#endif /* COMPILE_DL */
149149
/* }}} */
150150

151-
#ifdef ZEND_ENGINE_2
151+
#if defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3)
152152

153153
/* {{{ Function arginfo */
154154
ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_define_by_name, 0, 0, 3)
@@ -645,7 +645,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_trim_method, 0, 0, 1)
645645
ZEND_END_ARG_INFO()
646646
/* }}} */
647647

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

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

760760
/* {{{ extension function prototypes
761761
*/

ext/pdo_firebird/firebird_driver.c

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,7 @@
2323
#define _GNU_SOURCE
2424

2525
#include "php.h"
26-
#ifdef ZEND_ENGINE_2
27-
# include "zend_exceptions.h"
28-
#endif
26+
#include "zend_exceptions.h"
2927
#include "php_ini.h"
3028
#include "ext/standard/info.h"
3129
#include "pdo/php_pdo.h"

ext/xmlwriter/php_xmlwriter.h

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,9 +37,6 @@ extern zend_module_entry xmlwriter_module_entry;
3737
typedef struct _xmlwriter_object {
3838
xmlTextWriterPtr ptr;
3939
xmlBufferPtr output;
40-
#ifndef ZEND_ENGINE_2
41-
xmlOutputBufferPtr uri_output;
42-
#endif
4340
} xmlwriter_object;
4441

4542

ext/zip/zip_stream.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
#endif
2323
#include "php.h"
2424
#if HAVE_ZIP
25-
#ifdef ZEND_ENGINE_2
25+
#if defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3)
2626

2727
#include "php_streams.h"
2828
#include "ext/standard/file.h"
@@ -348,5 +348,5 @@ php_stream_wrapper php_stream_zip_wrapper = {
348348
NULL,
349349
0 /* is_url */
350350
};
351-
#endif /* ZEND_ENGINE_2 */
351+
#endif /* defined(ZEND_ENGINE_2) || defined(ZEND_ENGINE_3) */
352352
#endif /* HAVE_ZIP */

main/internal_functions_win32.c

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,6 @@
2929
#include <stdlib.h>
3030
#include <stdio.h>
3131

32-
#ifndef ZEND_ENGINE_2
33-
#error HEAD does not work with ZendEngine1 anymore
34-
#endif
35-
3632
#include "ext/standard/dl.h"
3733
#include "ext/standard/file.h"
3834
#include "ext/standard/fsock.h"

0 commit comments

Comments
 (0)