hhvm icon indicating copy to clipboard operation
hhvm copied to clipboard

behaviour diff: class_alias()

Open karpa13a opened this issue 15 years ago • 3 comments

http://php.net/class_alias

karpa13a avatar Sep 06 '11 06:09 karpa13a

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:

  1. Give detailed repro steps
  2. Write a test case in hphp/tests/quick (run it with hphp/tests/run) and send the pull request
  3. Fix it in a pull request

ptarjan avatar May 13 '13 21:05 ptarjan

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

karpa13a avatar May 14 '13 04:05 karpa13a

We have an implementation now that should be out soon.

jdelong avatar Jun 01 '13 18:06 jdelong