Arquivos
hhvm/hphp/test/quick/rename_function.php
T
ptarjan 503f75d08b Rename test directories
These names don't make sense now that we run both suites the same
way.
2013-04-17 09:06:51 -07:00

42 linhas
674 B
PHP

<?php
function one() {
echo "one\n";
}
function three() {
echo "three\n";
}
one();
var_dump(fb_rename_function("one", "two"));
two();
var_dump(fb_rename_function("three", "one"));
one();
// Try it with a builtin, too.
function my_microtime(bool $foob = false) {
static $x = 0.0;
echo "ca\$h m0n3y\n";
$x += 1.0;
if (false) {
return $x;
}
return (string)$x;
}
var_dump(fb_rename_function('microtime', '__dont_call_microtime'));
var_dump(fb_rename_function('my_microtime', 'microtime'));
echo microtime(true) . "\n";
function my_foo() {}
function bar() {
$orig = "foo";
$new = "my_$orig";
var_dump(fb_rename_function($new, "foo"));
}
bar();