Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

h2tp: "$a" is converted to $a #7424

Closed
jesseschalken opened this issue Oct 17, 2016 · 7 comments
Closed

h2tp: "$a" is converted to $a #7424

jesseschalken opened this issue Oct 17, 2016 · 7 comments
Labels

Comments

@jesseschalken
Copy link
Contributor

HHVM Version

HipHop VM 3.16.0-dev (rel)
Compiler: heads/master-0-ge9eb3fc414fbae9b2c999a4f11390e23050b23b7
Repo schema: 9cc0ebe15bc9d2ba3609c5e4458deeef9ed86dcc

Standalone code, or other way to reproduce the problem

<?hh

$a = 1;
print \is_string("$a");

Run h2tp on file.

Expected result

<?php
require_once ($GLOBALS["HACKLIB_ROOT"]);
$a = 1;
echo (\is_string("$a"));

Actual result

<?php
require_once ($GLOBALS["HACKLIB_ROOT"]);
$a = 1;
echo (\is_string($a));

The conversion to a string via variable interpolation is lost.

@jesseschalken
Copy link
Contributor Author

Since "{$a}foo" is converted to $a."foo", my guess is that it converts interpolated variables to a list of expressions to be concatenated together, and if that list of expressions contains 1 element, it emits it directly since it has nothing to concat it with. A special case would be needed for an expr list of 1 element so it is emitted as $a."".

@paulbiss
Copy link
Contributor

Just to set some expectations here, there isn't anyone who's currently maintaining h2tp. If you or someone else from the community would like to fix this we'd gladly take a pull request but it's unlikely any of us will have the bandwidth to look at h2tp related issues right now.

@paulbiss paulbiss added the hack label Oct 17, 2016
@paulbiss
Copy link
Contributor

Aha, I just saw #7427

@SiebelsTim
Copy link
Contributor

h2tp is dead. This can be closed I guess.

@Pacerier
Copy link

Re "there isn't anyone who's currently maintaining h2tp", #2236 (comment)

@fredemmott
Copy link
Contributor

If someone in the community wants to build a replacement, https://github.com/hhvm/hhast could be a good starting point.

@fredemmott
Copy link
Contributor

We won't be revisiting our decision to drop support for H2TP; we expect Hack and PHP to continue to diverge, to the point where targeting PHP for cross-compilation won't make more sense than any other language.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

5 participants