php - 如何检测是否启用了 PHP JIT
问题描述
检测 PHP 是否使用 JIT 编译并从运行脚本启用 JIT 的最简单方法是什么?
解决方案
您可以通过调用直接查询 opcache 设置opcache_get_status()
:
opcache_get_status()["jit"]["enabled"];
或在以下位置执行查找php.ini
:
ini_get("opcache.jit")
这是一个整数(以字符串形式返回),其中最后一位表示 JIT 的状态:
0 - don't JIT
1 - minimal JIT (call standard VM handlers)
2 - selective VM handler inlining
3 - optimized JIT based on static type inference of individual function
4 - optimized JIT based on static type inference and call tree
5 - optimized JIT based on static type inference and inner procedure analyses
推荐阅读
- html - Bootstrap div 不是并排的
- bash - 如何修复 Bash 脚本中的 '[: missing `]' ' 错误?
- python - web2py - 使用相同身份验证的多个应用程序
- java - NoSuchMethodError:com.google.common.util.concurrent.MoreExecutors.directExecutor
- r - 如何从数组的每一行中删除元素?
- python-3.x - 为网格应用过滤器编写 meshlabserver 脚本
- laravel - “页面没有正确重定向”laravel
- python - 如何按降序编写多维的每个子列表?
- javascript - 尝试为 next.js 项目设置 ava 单元测试,但出现两个与设置相关的错误
- asp.net-core - 在带有 ASOS 的 OpenID Connect 服务器中返回 401 响应