summaryrefslogtreecommitdiff
path: root/Zend/tests/closure_015.phpt
blob: f6903ebdb183d0245ad9df1313943cc0cfe19051 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
--TEST--
Closure 015: converting to string/unicode
--FILE--
<?php

$x = function() { return 1; };
try {
    print (string) $x;
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}
try {
    print $x;
} catch (Error $e) {
    echo $e->getMessage(), "\n";
}

?>
--EXPECT--
Object of class Closure could not be converted to string
Object of class Closure could not be converted to string