2008-07-10 07:55:48 +00:00
|
|
|
--TEST--
|
|
|
|
Closure 015: converting to string/unicode
|
|
|
|
--FILE--
|
|
|
|
<?php
|
2008-07-31 07:10:43 +00:00
|
|
|
set_error_handler('myErrorHandler', E_RECOVERABLE_ERROR);
|
|
|
|
function myErrorHandler($errno, $errstr, $errfile, $errline) {
|
|
|
|
echo "Error: $errstr at $errfile($errline)\n";
|
|
|
|
return true;
|
|
|
|
}
|
2008-07-10 07:55:48 +00:00
|
|
|
$x = function() { return 1; };
|
|
|
|
print (string) $x;
|
|
|
|
print "\n";
|
|
|
|
print (unicode) $x;
|
|
|
|
print "\n";
|
|
|
|
print $x;
|
|
|
|
print "\n";
|
|
|
|
?>
|
2008-07-31 07:10:43 +00:00
|
|
|
--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)
|
|
|
|
|
|
|
|
Error: Object of class Closure could not be converted to string at %sclosure_015.php(12)
|