Last active
January 3, 2016 18:39
-
-
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
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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