What's New
New Commands
phpvm exec <version> <command> [args...]— Run a command with a specific PHP version without globally switching. Uses subshell isolation so your current shell is unaffected.phpvm run <version> [script] [args...]— Shortcut forphpvm exec <version> php <script>.phpvm ls-remote [pattern]— List available PHP versions from your system package manager. Supports pattern filtering (e.g.,phpvm ls-remote 8.2).phpvm resolve <version|alias>— Resolve a version descriptor or alias to a locally installed version number.phpvm unload— Remove phpvm from the current shell session (deactivates, removes hooks, unsets all functions/variables).phpvm cache clear— Clear the phpvm cache directory.
New Features
--no-useflag on source:source phpvm.sh --no-useloads functions without auto-switching or registering the cd hook. Useful for lazy-loading setups.- Bash tab completion: Context-aware completions for commands, installed versions, and alias names. Auto-loaded when phpvm is sourced.
- Auto-set default alias on first install: The first
phpvm installnow automatically sets thedefaultalias (matches nvm behaviour). PHPVM_BINexport: After every version switch,$PHPVM_BINpoints to the active PHP binary directory.- XDG_CONFIG_HOME fallback:
PHPVM_DIRnow respects$XDG_CONFIG_HOME/phpvmwhen set.
Bug Fixes
hash -rafter version switch: Bash command hash table is now invalidated after switching, preventing stale binary resolution.phpvm_currentusesprintf: Consistent with project conventions.
Improved
phpvm listoutput: Active version marked with->arrow and green colouring. Default alias shown inline.- Help text: All commands now documented as implemented with usage examples.
Testing
- 78 BATS tests (22 new), 0 failures.
- ShellCheck clean (0 warnings).
Full Changelog: v1.10.0...v1.11.0
Compatibility
- macOS bash 3.2 fix: Replaced
caseinside$()withif/elseinls-remotebrew handler to avoid parser bug in bash 3.2.