/hphp/test/slow/ir_inlining/unset.php
PHP | 39 lines | 32 code | 5 blank | 2 comment | 0 complexity | a093f5c3b17e94122613c0c45b433240 MD5 | raw file
Possible License(s): LGPL-2.1, BSD-2-Clause, BSD-3-Clause, MPL-2.0-no-copyleft-exception, MIT, LGPL-2.0, Apache-2.0
- <?hh
- class NonExistProp {
- private $x;
- public function __construct() {
- $x = "str";
- }
- public function unsetIt() {
- unset($this->x);
- }
- public function getX() {
- return $this->x;
- }
- }
- // TODO: this will need a hopt to enable throw
- function thrower() {
- //var_dump(debug_backtrace());
- throw new Exception("Yo");
- }
- function test7() {
- set_error_handler(fun('thrower'));
- try {
- $obj = new NonExistProp();
- $obj->unsetIt();
- $k = new Dtor();
- echo $obj->getX();
- echo "\n";
- }
- catch (Exception $x) {
- }
- }
- <<__EntryPoint>>
- function main_unset() {
- test7();
- }