summaryrefslogtreecommitdiff
path: root/Zend/tests/closure_015.phpt
blob: 33c732d72372257fe9f12ae8a494186132b4e914 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
--TEST--
Closure 015: converting to string/unicode
--FILE--
<?php
set_error_handler('myErrorHandler', E_RECOVERABLE_ERROR);
function myErrorHandler($errno, $errstr, $errfile, $errline) {
  echo "Error: $errstr at $errfile($errline)\n";
  return true;
}
$x = function() { return 1; };
print (string) $x;
print "\n";
print $x;
print "\n";
?>
--EXPECTF--
Error: Object of class Closure could not be converted to string at %sclosure_015.php(8)

Error: Object of class Closure could not be converted to string at %sclosure_015.php(10)