Skip to content
This repository was archived by the owner on Mar 29, 2024. It is now read-only.

Drop PHP 7.1 support #104

Merged
merged 1 commit into from
Feb 28, 2018
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
2 changes: 0 additions & 2 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,6 @@ env:
matrix:
- PHP=7.2
- PHP=7.2 TEST_PHP_ARGS=-m
- PHP=7.1
- PHP=7.1 TEST_PHP_ARGS=-m

before_install:
# docker on travis doesn't allow anything before FROM, let's fix that
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ PHP extension for V8 JavaScript engine
[![Docs](https://readthedocs.org/projects/php-v8/badge/)](https://php-v8.readthedocs.io)


**This extension requires PHP >= 7.1**. Last version that supports PHP 7.0 is v0.1.9.
**This extension requires PHP >= 7.2**. Last version that supports PHP 7.1 is v0.2.2 and for PHP 7.0 is v0.1.9.

**This extension is still under heavy development and its public API may change without any warning. Use at your own risk.**

Expand Down Expand Up @@ -108,7 +108,7 @@ on top of php-v8 extension and makes embedding JavaScript in PHP easier.
You will need a recent v8 Google JavaScript engine version installed. At this time v8 >= 6.6.313 required.

#### PHP
This extension is PHP7-only. It works and tested with both PHP 7.0 and PHP 7.1.
**This extension requires PHP >= 7.2**. Last version that supports PHP 7.1 is v0.2.2 and for PHP 7.0 is v0.1.9.

#### OS
This extension works and tested on x64 Linux and macOS. As of written it is Ubuntu 16.04 LTS Xenial Xerus, amd64
Expand All @@ -122,7 +122,7 @@ and macOS 10.12.5. Windows is not supported at this time.
$ sudo add-apt-repository -y ppa:ondrej/php
$ sudo add-apt-repository -y ppa:pinepain/php
$ sudo apt-get update -y
$ sudo apt-get install -y php7.1 php-v8
$ sudo apt-get install -y php7.2 php-v8
$ php --ri v8
```

Expand All @@ -139,7 +139,7 @@ extensions with dependencies, you may find
$ brew tap homebrew/dupes
$ brew tap homebrew/php
$ brew tap pinepain/devtools
$ brew install php71 php71-v8
$ brew install php72 php72-v8
$ php --ri v8
```

Expand Down
4 changes: 2 additions & 2 deletions config.m4
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ if test "$PHP_V8" != "no"; then
PHP_REF_FOUND_VERSION=`${PHP_CONFIG} --version`
PHP_REF_FOUND_VERNUM=`${PHP_CONFIG} --vernum`

if test "$PHP_REF_FOUND_VERNUM" -lt "70100"; then
AC_MSG_ERROR([not supported. PHP version >= 7.1 required (found $PHP_REF_FOUND_VERSION)])
if test "$PHP_REF_FOUND_VERNUM" -lt "70200"; then
AC_MSG_ERROR([not supported. PHP version >= 7.2 required (found $PHP_REF_FOUND_VERSION)])
else
AC_MSG_RESULT([supported ($PHP_REF_FOUND_VERSION)])
fi
Expand Down
3 changes: 2 additions & 1 deletion docs/getting-started/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,8 @@ You will need a recent v8 Google JavaScript engine version installed. At this ti
PHP
"""

This extension is PHP7-only. It works and tested with both PHP 7.0 and PHP 7.1.
**This extension requires PHP >= 7.2**. Last version that supports PHP 7.1 is v0.2.2 and for PHP 7.0 is v0.1.9.


OS
"""
Expand Down
2 changes: 1 addition & 1 deletion package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -423,7 +423,7 @@
<dependencies>
<required>
<php>
<min>7.1</min>
<min>7.2</min>
</php>
<pearinstaller>
<min>1.4.0</min>
Expand Down
2 changes: 1 addition & 1 deletion perf/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
}
],
"require": {
"php": "~7.1",
"php": "~7.2",
"phpbench/phpbench": "^0.13.0"
},
"autoload": {
Expand Down
21 changes: 6 additions & 15 deletions php_v8.h
Original file line number Diff line number Diff line change
Expand Up @@ -50,9 +50,9 @@ extern zend_module_entry php_v8_module_entry;
#define PHP_V8_LIBV8_VERSION "undefined"
#endif

#if PHP_VERSION_ID < 70100
#if PHP_VERSION_ID < 70200
// should never get her, but just in case
#error PHP >= 7.1 required
#error PHP >= 7.2 required
#endif


Expand All @@ -61,20 +61,11 @@ ZEND_BEGIN_MODULE_GLOBALS(v8)
v8::Platform *platform;
ZEND_END_MODULE_GLOBALS(v8)

// Add zend_type support (new since PHP 7.2)
#ifdef ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX
#define PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, classname, allow_null) \
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, classname, allow_null)
#define PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, classname, allow_null) \
ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, classname, allow_null)

#define PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null)
#else
#define PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_OBJ_INFO_EX(name, return_reference, required_num_args, classname, allow_null) \
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, IS_OBJECT, #classname, allow_null)

#define PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, NULL, allow_null)
#endif
#define PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null) \
ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(name, return_reference, required_num_args, type, allow_null)

#define PHP_V8_ZEND_BEGIN_ARG_WITH_CONSTRUCTOR_INFO_EX(name, required_num_args) ZEND_BEGIN_ARG_INFO_EX(name, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, required_num_args)
#define PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_VOID_INFO_EX(name, required_num_args) ZEND_BEGIN_ARG_INFO_EX(name, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, required_num_args)
Expand Down
4 changes: 2 additions & 2 deletions src/php_v8_null.cc
Original file line number Diff line number Diff line change
Expand Up @@ -47,10 +47,10 @@ PHP_V8_ZEND_BEGIN_ARG_WITH_CONSTRUCTOR_INFO_EX(arginfo___construct, 1)
ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0)
ZEND_END_ARG_INFO()

// no strict typing as it returns NULL and null typehint doesn't work on PHP 7.1
ZEND_BEGIN_ARG_INFO_EX(arginfo_value, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0)
PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_value, ZEND_RETURN_VALUE, 0, IS_NULL, 0)
ZEND_END_ARG_INFO()


static const zend_function_entry php_v8_null_methods[] = {
PHP_V8_ME(NullValue, __construct, ZEND_ACC_PUBLIC | ZEND_ACC_CTOR)
PHP_V8_ME(NullValue, value, ZEND_ACC_PUBLIC)
Expand Down
3 changes: 1 addition & 2 deletions src/php_v8_undefined.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ PHP_V8_ZEND_BEGIN_ARG_WITH_CONSTRUCTOR_INFO_EX(arginfo___construct, 1)
ZEND_ARG_OBJ_INFO(0, isolate, V8\\Isolate, 0)
ZEND_END_ARG_INFO()

// no strict typing as it returns NULL and null typehint doesn't work on PHP 7.1
ZEND_BEGIN_ARG_INFO_EX(arginfo_value, ZEND_SEND_BY_VAL, ZEND_RETURN_VALUE, 0)
PHP_V8_ZEND_BEGIN_ARG_WITH_RETURN_TYPE_INFO_EX(arginfo_value, ZEND_RETURN_VALUE, 0, IS_NULL, 0)
ZEND_END_ARG_INFO()


Expand Down
2 changes: 1 addition & 1 deletion stubs/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,6 @@
}
],
"require": {
"php": "~7.1"
"php": "~7.2"
}
}
2 changes: 1 addition & 1 deletion stubs/src/NullValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct(Isolate $isolate)
/**
* @return null
*/
public function value()
public function value(): null
{
}
}
2 changes: 1 addition & 1 deletion stubs/src/UndefinedValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function __construct(Isolate $isolate)
/**
* @return null
*/
public function value()
public function value(): null
{
}
}
4 changes: 2 additions & 2 deletions tests/001-verify_extension_entities.phpt
Original file line number Diff line number Diff line change
Expand Up @@ -615,12 +615,12 @@ abstract class V8\PrimitiveValue
class V8\UndefinedValue
extends V8\PrimitiveValue
public function __construct(V8\Isolate $isolate)
public function value()
public function value(): null

class V8\NullValue
extends V8\PrimitiveValue
public function __construct(V8\Isolate $isolate)
public function value()
public function value(): null

class V8\BooleanValue
extends V8\PrimitiveValue
Expand Down