Download the PHP package phunkie/console without Composer
On this page you can find all versions of the php package phunkie/console. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Informations about the package console
Phunkie Console
A powerful, interactive REPL (Read-Eval-Print Loop) console for Phunkie - bringing functional programming to PHP.
Features
- Interactive REPL: Evaluate PHP expressions and see results immediately
- Functional Programming: Full access to Phunkie's functional programming constructs
- Type Inspection: Query types and kinds of expressions with
:typeand:kindcommands - Import System: Import functions from Phunkie standard library on-the-fly
- Syntax Highlighting: Color-coded output for better readability
- Multi-line Support: Write complex expressions across multiple lines
- Rich Output: Formatted display of complex data structures
Requirements
- PHP 8.2, 8.3, 8.4, or 8.5
- Composer
Installation
Or install globally:
Usage
Start the REPL:
Or if installed globally:
Basic Examples
REPL Commands
:quitor:exit- Exit the REPL:type <expression>- Show the type of an expression:kind <type>- Show the kind of a type:import <function(s)>- Import a function from the Phunkie standard library:load <filepath>- Load a PHP file silently (all definitions become available in the session):help- Show help information
Working with Options
Working with Immutable Collections
Multi-line Expressions
The REPL automatically detects incomplete expressions and prompts for continuation:
Examples with REPL Commands
Configuration
Color Support
Enable colors with the -c flag:
Development
Running Tests
Run all tests:
Run version-specific tests:
Test Coverage
The project maintains comprehensive test coverage:
- Unit Tests: Testing individual components with PHPUnit
- Acceptance Tests: End-to-end REPL functionality with Behat
- Cross-version Testing: Automated testing across PHP 8.2, 8.3, 8.4, and 8.5
Code Quality
Architecture
The console is built with a modular architecture:
- Parser: Uses nikic/php-parser for PHP syntax analysis
- Evaluator: Safe evaluation of PHP expressions
- Session: Stateful session management using the State monad
- Display: Formatted output with type information
- Terminal: Readline integration for command history
Contributing
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/amazing-feature) - Commit your changes (
git commit -m 'Add some amazing feature') - Push to the branch (
git push origin feature/amazing-feature) - Open a Pull Request
License
This project is licensed under the MIT License - see the LICENSE file for details.
Links
- Phunkie Library
- Documentation
- Issue Tracker
All versions of console with dependencies
phunkie/phunkie Version ^1.0
phunkie/effect Version ^1.1
nikic/php-parser Version ^5.6