faslatam/jsphp
最新稳定版本:v0.5
Composer 安装命令:
composer require faslatam/jsphp
包简介
Give your PHP projects a touch of JavaScript with JSPHP! 🚀
README 文档
README
Nota: Esta documentación está siendo traducida: > Ver en español
📚 JSPHP is a powerful PHP library that provides a set of classes designed to mimic the behavior of JavaScript's primitive classes such as Number, String, and more.
🎯 With JSPHP, PHP developers can leverage familiar JavaScript concepts and functionalities in their PHP projects. 🌈
This library aims to bridge the gap between JavaScript and PHP, allowing developers to write cleaner and more efficient code.
✨ Whether you're a PHP developer looking to explore JavaScript-like features or a JavaScript developer working with PHP, JSPHP is the perfect tool to enhance your development experience. 💪
Give your PHP projects a touch of JavaScript with JSPHP! 🚀
Requirements
Installation
🚀 Getting started with using JSPHP is super easy! Just follow these simple steps:
1- First, install JSPHP using composer:
composer require faslatam/jsphp
2. Include the composer autoloader:
<?php require '/path/to/vendor/autoload.php'; # Finally, you're all set! You can now start using JSPHP in your projects. $name = String('foo'); echo $name->toUpperCase(); # Output: FOO $user = JSON::parse('{ "id": 1, "name": "foo" }'); echo $user->name; # Output: foo $colors = JSArray(['red', 'purple', 'black']); $colors->forEach(function (?string $color): void { echo "I like the color $color\n"; }); echo "\ncolors = $colors"; /* Output: ---------- I like the color red I like the color purple I like the color black colors = red,purple,black */
Components
JSPHP is divided in components that are equivalent to JS classes. Some components are under development, feel free to contribute adding extra functionalities.
| Component | Status |
|---|---|
| JSON | ℹ️ (under development) |
| Math | ℹ️ (under development) |
| JSString | ℹ️ (under development) |
| JSNumber | ❌ (unimplement) |
| JSArray | ℹ️ (under development) |
| JSObject | ❌ (unimplement) |
| undefined | ✅ (finished) |
统计信息
- 总下载量: 11
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 3
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2023-11-10