summaryrefslogtreecommitdiff
path: root/Zend/tests/self_instanceof_outside_class.phpt
blob: ecb593a6a580a0c948cb52f9a0a9c7bd1d3f977d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
--TEST--
instanceof self outside a class
--FILE--
<?php

$fn = function() {
    try {
        new stdClass instanceof self;
    } catch (Error $e) {
        echo $e->getMessage(), "\n";
    }
};
$fn();

?>
--EXPECT--
Cannot access "self" when no class scope is active