hhvm
hhvm copied to clipboard
behaviour diff: class_alias()
http://php.net/class_alias
We're closing out all bugs older than 2 months. http://www.hiphop-php.com/wp/?p=575
If this is still an issue, please re-open it, and in order of goodness:
- Give detailed repro steps
- Write a test case in hphp/tests/quick (run it with hphp/tests/run) and send the pull request
- Fix it in a pull request
code from example at php.net:
karp@karp:~/tmp/php/1$ php -v
PHP 5.3.10-1ubuntu3.6 with Suhosin-Patch (cli) (built: Mar 11 2013 14:31:48)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
karp@karp:~/tmp/php/1$ hhvm --version
HipHop VM v2.0.2 (rel)
Compiler: tags/HPHP-2.0.2-0-ga3803ffa8aab6dd582af9f6e28bb8878954310dd
Repo schema: c9334168ca1d6fbba2f465f1bdf1e96e0e53b0cf
karp@karp:~/tmp/php/1$ cat class_alias.php
<?php
class foo { }
class_alias('foo', 'bar');
$a = new foo;
$b = new bar;
var_dump($a == $b, $a === $b);
var_dump($a instanceof $b);
var_dump($a instanceof foo);
var_dump($a instanceof bar);
var_dump($b instanceof foo);
var_dump($b instanceof bar);
?>
karp@karp:~/tmp/php/1$ php class_alias.php
bool(true)
bool(false)
bool(true)
bool(true)
bool(true)
bool(true)
bool(true)
karp@karp:~/tmp/php/1$ hhvm class_alias.php
HipHop Fatal error: Undefined function: class_alias in /home/karp/tmp/php/1/class_alias.php on line 5
We have an implementation now that should be out soon.