8000 Fixed is_php_version by sergeyklay · Pull Request #1646 · zephir-lang/zephir · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

Merged
merged 7 commits into from
May 7, 2018
Merged

Fixed is_php_version #1646

merged 7 commits into from
May 7, 2018

Conversation

sergeyklay
Copy link
Contributor
@sergeyklay sergeyklay commented May 4, 2018

Refs: #1404


/cc @Jurigag

AlexNDRmac added 2 commits May 1, 2018 22:22
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)
Copy link
Contributor Author

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

8000
@@ -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);
Copy link
Contributor Author

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

{
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);
Copy link
Contributor Author

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;

@sergeyklay sergeyklay self-assigned this May 4, 2018
@sergeyklay sergeyklay merged commit 7309846 into development May 7, 2018
@sergeyklay sergeyklay deleted the issue_1404 branch May 7, 2018 04:48
@sergeyklay sergeyklay mentioned this pull request May 14, 2018
sergeyklay added a commit that referenced this pull request May 24, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants
0