@@ -11,15 +11,21 @@ alias:
11
11
12
12
php.js is a resource that offers community-built JavaScript alternatives to PHP functions.
13
13
14
- If you want to perform high-level operations on JavaScript platforms such as
15
- webbrowsers, node.js, etc, you probably need to write JS that combines its
16
- lower-level functions and build it up until you have something useful like:
14
+ ** Why on earth would you port php to js?**
15
+
16
+ - to see if we can
17
+ - to learn JavaScript
18
+ - to help others learn JavaScript
19
+ - to see how a php program performs with V8 strapped on it's back
20
+ - to run & debug php code in the browser
21
+ - to profit from helpful functions like:
17
22
[ strip_tags] ( http://phpjs.org/functions/strip_tags/ ) ,
18
23
[ strtotime] ( http://phpjs.org/functions/strtotime/ ) ,
19
24
[ strftime] ( http://phpjs.org/functions/strftime/ ) ,
20
25
[ number_format] ( http://phpjs.org/functions/number_format/ ) ,
21
- [ wordwrap] ( http://phpjs.org/functions/wordwrap/ ) , or
22
- [ date] ( http://phpjs.org/functions/date/ ) .
26
+ [ wordwrap] ( http://phpjs.org/functions/wordwrap/ ) ,
27
+ [ vsprintf] ( http://phpjs.org/functions/vsprintf/ ) , and
28
+ [ date] ( http://phpjs.org/functions/date/ ) , that are too high-level for JavaScript.
23
29
24
30
PHP is a language with many high-level functions and while they're not always
25
31
implemented as consistently as we'd like (mimicking their underlying C parts),
@@ -28,13 +34,13 @@ or abstractions.
28
34
29
35
We recognize JS has beautiful language features, and we encourage you to learn them.
30
36
Never let php.js be an excuse not to. For the this reason we don't offer
31
- gigantic php.js packages or compilers anymore .
37
+ gigantic php.js packages or compilers.
32
38
33
39
That said, we do think it's a challenge to port everything and decided to also port
34
40
low-level PHP functions like
35
41
[ strpos] ( http://phpjs.org/functions/strpos/ )
36
- even though it has a perfectly fine (and more performant!) JavaScript
37
- counterpart ([ String.indexOf] ( https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/indexOf ) ).
42
+ that have a perfectly fine (and more performant!) JavaScript
43
+ counterparts ([ String.indexOf] ( https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/String/indexOf ) in this case ).
38
44
39
45
Besides the geeky-challenge of seeing how far we could come, porting ALL THE THINGS also
40
46
opens up php.js to other fun experiments such as realtime in-browser debugging/running of
@@ -50,12 +56,12 @@ And what not.
50
56
51
57
Going by [ The McDonald's Theory] ( https://medium.com/what-i-learned-building/9216e1c9da7d )
52
58
we have plently of functions here online that aren't perfect just yet.
53
- If you know how to improve, just send us a pull request on GitHub.
59
+ If you know how to improve, just send us a pull request on GitHub!
54
60
55
61
## Contributing
56
62
57
63
We use [ GitHub] ( http://github.com/kvz/phpjs ) for collaboration. Comments are for remarks only.
58
- Please adhere to our [ coding standards] ( https ://github .com/kvz/phpjs/wiki/DeveloperGuidelines ) before
64
+ Please adhere to our [ coding standards] ( http ://nodeguide .com/style.html ) before
59
65
sending a pull request.
60
66
61
67
## Licensing
0 commit comments