-
-
Notifications
You must be signed in to change notification settings - Fork 468
Fixed is_php_version #1646
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed is_php_version #1646
Conversation
Fixed RegExp for optimizer | Issue 1404
* @param int|double|string $version - PHP version in any format: 7, 7.1, "7.1.1" | ||
* @return boolean | ||
*/ | ||
private function is_php_version($version) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Method name "
Issue1404Test::is_php_version
" is not in camel caps format
kernels/ZendEngine2/main.h
Outdated
@@ -550,7 +550,7 @@ int zephir_fetch_parameters(int num_args TSRMLS_DC, int required_args, int optio | |||
|
|||
#define ZEPHIR_CHECK_POINTER(v) if (!v) fprintf(stderr, "%s:%d\n", __PRETTY_FUNCTION__, __LINE__); | |||
|
|||
#define zephir_is_php_version(id) (PHP_VERSION_ID / 10 == id / 10 ? 1 : 0) | |||
int zephir_is_php_version(id); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
a parameter list without types is only allowed in a function definition
kernels/ZendEngine2/main.c
Outdated
{ | ||
int php_major = PHP_VERSION_ID / 10000; | ||
int php_minor = PHP_VERSION_ID / 100 - php_major * 100; | ||
int php_release = PHP_VERSION_ID - (php_major * 10000 + php_minor * 100); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- int php_major = PHP_VERSION_ID / 10000;
+ int php_major = PHP_MAJOR_VERSION;
- int php_minor = PHP_VERSION_ID / 100 - php_major * 100;
+ int php_minor = PHP_MINOR_VERSION;
- int php_release = PHP_VERSION_ID - (php_major * 10000 + php_minor * 100);
+ int php_release = PHP_RELEASE_VERSION;
Fix optimizer tests for CI
Fixed PSR2 for test
Refs: #1404
/cc @Jurigag