Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@tlevi
Last active January 3, 2016 18:39
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tlevi/8503668 to your computer and use it in GitHub Desktop.
Save tlevi/8503668 to your computer and use it in GitHub Desktop.
This test demonstrates a problem with HHVM not seeing when included files have been updated. hhvm#1595
<?php
# This test demonstrates a problem with HHVM not seeing when included files have been updated.
# hhvm#1595
# Expected output:
# $ php test.php
# $included has value: [a]
# $included has value: [b]
# Incorrect HHVM output:
# $ hhvm test.php
# $included has value: [a]
# $included has value: [a]
$included = null;
$file = tempnam(sys_get_temp_dir(), 'hhvm-incl-test');
if (!file_put_contents($file, "<?php \$included = 'a';")) {
die('Failed to put test file content, weird');
}
include $file;
echo "\$included has value: [$included]\n";
if (!file_put_contents($file, "<?php \$included = 'b';")) {
die('Failed to put test file content, weird');
}
include $file;
echo "\$included has value: [$included]\n";
unlink($file);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment