Home > Backend Development > PHP Tutorial > PHP version extension comparison code sharing

PHP version extension comparison code sharing

小云云
Release: 2023-03-20 22:08:01
Original
1395 people have browsed it

This article mainly shares with you the PHP version extension comparison code, hoping to help everyone.

phpversion();//获取php版本1
if (version_compare(phpversion(), &#39;7.1&#39;, &#39;<&#39;)) {//php版本比较
        die("PHP version\e[31m must >= 7.1\e[0m\n");
    }
    if (version_compare(phpversion(&#39;swoole&#39;), &#39;1.9.5&#39;, &#39;<&#39;)) {//扩展比较
        die("Swoole extension version\e[31m must >= 1.9.5\e[0m\n");
    }
Copy after login

Related recommendations:

Detailed explanation on the error of PHP version number

Detailed explanation on how to upgrade the PHP version under Windows server

PHP version difference

The above is the detailed content of PHP version extension comparison code sharing. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template