php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #60410 script stops when closure used without open brackets
Submitted: 2011-11-29 14:15 UTC Modified: 2013-02-18 00:35 UTC
From: zarzu dot razvan at gmail dot com Assigned:
Status: No Feedback Package: Variables related
PHP Version: Irrelevant OS: Windows XP
Private report: No CVE-ID: None
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: zarzu dot razvan at gmail dot com
New email:
PHP Version: OS:

 

 [2011-11-29 14:15 UTC] zarzu dot razvan at gmail dot com
Description:
------------
When declaring a closure and using it without the open brackets (as if it were a variable), PHP stops from executing next instructions.

Test script:
---------------
$a = function(){};
echo $a;
echo 'Hey!';

Expected result:
----------------
Hey!

Actual result:
--------------
nothing

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-11-29 14:20 UTC] felipe@php.net
Check if your display_errors is set to 0 (zero)
 [2011-11-29 15:49 UTC] zarzu dot razvan at gmail dot com
display_errors was set to 1. Changed it to 0, same result.
 [2011-11-30 00:27 UTC] yohgaki@php.net
That's strange. With cli/Linux, I get this for both trunk and PHP 5.3

PHP Catchable fatal error:  Object of class Closure could not be converted to 
string in /home/yohgaki/ext/svn/oss/php.net/php-src/t3.php on line 3

Try with cli binary.
 [2011-11-30 00:28 UTC] yohgaki@php.net
-Status: Open +Status: Feedback
 [2013-02-18 00:35 UTC] php-bugs at lists dot php dot net
No feedback was provided. The bug is being suspended because
we assume that you are no longer experiencing the problem.
If this is not the case and you are able to provide the
information that was requested earlier, please do so and
change the status of the bug back to "Open". Thank you.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sun Dec 22 10:01:28 2024 UTC