Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/zonuexe/php.py
https://github.com/zonuexe/php.py
Last synced: 18 days ago
JSON representation
- Host: GitHub
- URL: https://github.com/zonuexe/php.py
- Owner: zonuexe
- License: other
- Created: 2022-10-15T12:47:05.000Z (about 2 years ago)
- Default Branch: master
- Last Pushed: 2022-10-16T02:31:53.000Z (about 2 years ago)
- Last Synced: 2024-11-06T02:49:15.590Z (2 months ago)
- Language: Python
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php.py
## How to use
```
$ python -m phpcodec target.py
```## Sample
`fizzbuzz.py`
```php
# encoding: php
=implode("\n",array_map(fn($n)=>match([($n%3==0)+0,($n%5==0)+0]){[1,1]=>'FizzBuzz',[1,0]=>'Fizz',[0,1]=>'Buzz',default=>$n},range(1,100)))?>
```## Copyright
```
Copying and distribution of this file, with or without modification,
are permitted in any medium without royalty provided the copyright
notice and this notice are preserved. This file is offered as-is,
without any warranty.
```## Acknowledgments
The great idea for this code comes from [an idea presented at LL Tiger](http://blog.shibu.jp/article/39920783.html) by [Yoshiki Shibukawa](https://github.com/shibukawa). And [a blog entry](https://doloopwhile.hatenablog.com/entry/20100801/1280688409) by [Kenji Omoto](https://github.com/doloopwhile) gave me a clue as to the missing code snippet. Many thanks to both.