# Tool convert php to haxe

**URL:** <https://community.haxe.org/t/tool-convert-php-to-haxe/1659>\
**Category:** Haxe\
**Tags:** haxe-php\
**Created:** [April 5, 2019, 10:12am UTC](https://community.haxe.org/t/tool-convert-php-to-haxe/1659 "2019-04-05T10:12:57Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![rivetweb](https://community.haxe.org/user_avatar/community.haxe.org/rivetweb/32/1338_2.png) [@rivetweb](https://community.haxe.org/u/rivetweb)\
**Post date:** [April 5, 2019, 10:12am UTC](https://community.haxe.org/t/tool-convert-php-to-haxe/1659/1 "2019-04-05T10:12:57Z")

</div>

found this [Code - PhpToHaxe (php to haXe convert tool)](http://phptohaxe.haqteam.com/code.php)

is there some cli version for local using without internet?

---

<div class="post-metadata">

**Author:** ![andyli](https://community.haxe.org/user_avatar/community.haxe.org/andyli/32/26_2.png) [@andyli](https://community.haxe.org/u/andyli)\
**Post date:** [April 5, 2019, 10:24am UTC](https://community.haxe.org/t/tool-convert-php-to-haxe/1659/2 "2019-04-05T10:24:48Z")

</div>

Try contact the author? There is an email address under [haqteam.com](http://haqteam.com).

---

<div class="post-metadata">

**Author:** ![RealyUniqueName](https://community.haxe.org/user_avatar/community.haxe.org/realyuniquename/32/10_2.png) [@RealyUniqueName](https://community.haxe.org/u/RealyUniqueName)\
**Post date:** [April 5, 2019, 10:29am UTC](https://community.haxe.org/t/tool-convert-php-to-haxe/1659/3 "2019-04-05T10:29:01Z")

</div>

I don’t think so.  
But here are the sources: [https://bitbucket.org/yar3333/phptohaxe](https://bitbucket.org/yar3333/phptohaxe)

---

<div class="post-metadata">

**Author:** ![Matt](https://avatars.discourse-cdn.com/v2/letter/m/a6a055/32.png) [@Matt](https://community.haxe.org/u/Matt)\
**Post date:** [April 5, 2019, 11:39am UTC](https://community.haxe.org/t/tool-convert-php-to-haxe/1659/4 "2019-04-05T11:39:56Z")

</div>

…which can then be used to turn it into Haxe!  
…which can then be used to turn it into php…  
…which can then be used to turn it into Haxe!  
…

---

<div class="post-metadata">

**Author:** ![Confidant](https://community.haxe.org/user_avatar/community.haxe.org/confidant/32/63_2.png) [@Confidant](https://community.haxe.org/u/Confidant)\
**Post date:** [April 5, 2019, 7:08pm UTC](https://community.haxe.org/t/tool-convert-php-to-haxe/1659/5 "2019-04-05T19:08:51Z")

</div>

You’re one of those people who makes funny sentences with Google Translate, aren’t you? 😄

---

<div class="post-metadata">

**Author:** ![sundialservices](https://avatars.discourse-cdn.com/v2/letter/s/9e8a1a/32.png) [@sundialservices](https://community.haxe.org/u/sundialservices)\
**Post date:** [April 15, 2019, 3:32pm UTC](https://community.haxe.org/t/tool-convert-php-to-haxe/1659/6 "2019-04-15T15:32:14Z")

</div>

Like it or not, PHP and Haxe are _radically_ different languages – built at different times and for different worlds. Asking for an automatic tool to convert between one and the other is, to me, like asking for a tool that will convert an apple into a watermelon. Yes, both of them might be “edible things,” but they truly bear no exploitable resemblance to one another.

---

<div class="post-metadata">

**Author:** ![ibilon](https://community.haxe.org/user_avatar/community.haxe.org/ibilon/32/13_2.png) [@ibilon](https://community.haxe.org/u/ibilon)\
**Post date:** [April 15, 2019, 3:49pm UTC](https://community.haxe.org/t/tool-convert-php-to-haxe/1659/7 "2019-04-15T15:49:06Z")

</div>

> [@sundialservices](#):
>
> Like it or not, PHP and Haxe are _radically_ different languages – built at different times and for different worlds. Asking for an automatic tool to convert between one and the other is, to me, like asking for a tool that will convert an apple into a watermelon. Yes, both of them might be “edible things,” but they truly bear no exploitable resemblance to one another.

The haxe compiler is a tool which does automatic conversion between haxe and php 😉  
And doing a php compiler which outputs to haxe might be possible as well.

---

<div class="post-metadata">

**Author:** ![kevinresol](https://community.haxe.org/user_avatar/community.haxe.org/kevinresol/32/272_2.png) [@kevinresol](https://community.haxe.org/u/kevinresol)\
**Post date:** [April 16, 2019, 7:09am UTC](https://community.haxe.org/t/tool-convert-php-to-haxe/1659/8 "2019-04-16T07:09:55Z")

</div>

Haxe compiles to PHP _very_ well.

---

<div class="post-metadata">

**Author:** ![sundialservices](https://avatars.discourse-cdn.com/v2/letter/s/9e8a1a/32.png) [@sundialservices](https://community.haxe.org/u/sundialservices)\
**Post date:** [April 16, 2019, 4:30pm UTC](https://community.haxe.org/t/tool-convert-php-to-haxe/1659/9 "2019-04-16T16:30:36Z")

</div>

Yes, it compiles _ **to** _ PHP quite nicely, although deficiencies of the PHP language’s design leave a lot of things to be desired.

However, that’s not what we’re talking about here. You can’t take PHP code and meaningfully convert it _into_ Haxe code. Certainly you will not wind up with something that gains particular advantage by being “Haxe” source-code.

Sure, the PHP language is inching forward, as it always does, in various ways (that are usually incompatible with prior versions of itself), but I just finished an enormous conversion-and-rehab project in which _none_ of the source-code started out as PHP-7 and some of it was in _(dear God)_ versions of the language. “It wasn’t pretty.” **5,993** files’ worth of stuff that was _not_ pretty.

. . . _(but, by gawd, it works)_ . . . 🤯 . . . does _four+ million dollars every month,_ and it . . . works.

---

<div class="post-metadata">

**Author:** ![rivetweb](https://community.haxe.org/user_avatar/community.haxe.org/rivetweb/32/1338_2.png) [@rivetweb](https://community.haxe.org/u/rivetweb)\
**Post date:** [April 20, 2019, 7:12am UTC](https://community.haxe.org/t/tool-convert-php-to-haxe/1659/10 "2019-04-20T07:12:56Z")

</div>

> Asking for an automatic tool to convert between one and the other is, to me, like asking for a tool that will convert an apple into a watermelon

no it’s just class syntax converter  
so it not so complicate

i’m in the middle of some writing this tool  
of course i use perl language for this

`bx haxe src/tutorials/examples/Main.php`

[github.com](http://github.com) / 6umpukc-uHKBu3umop/6umpukc/tree/master/example-haxe

---

<div class="post-metadata">

**Author:** ![RealyUniqueName](https://community.haxe.org/user_avatar/community.haxe.org/realyuniquename/32/10_2.png) [@RealyUniqueName](https://community.haxe.org/u/RealyUniqueName)\
**Post date:** [April 20, 2019, 10:14am UTC](https://community.haxe.org/t/tool-convert-php-to-haxe/1659/11 "2019-04-20T10:14:37Z")

</div>

> [@sundialservices](#):
>
> I just finished an enormous conversion-and-rehab project in which _none_ of the source-code started out as PHP-7 and some of it was in _(dear God)_ versions of the language. “It wasn’t pretty.” **5,993** files’ worth of stuff that was _not_ pretty.

Did you convert to Haxe? Any chance for a detailed (blog) post?
