php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #52235 can't use implode() as inline attribute in empty()
Submitted: 2010-07-02 14:01 UTC Modified: 2010-07-02 14:13 UTC
From: valcool at pisem dot net Assigned:
Status: Not a bug Package: Unknown/Other Function
PHP Version: 5.3.2 OS: windows 7 x64
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: valcool at pisem dot net
New email:
PHP Version: OS:

 

 [2010-07-02 14:01 UTC] valcool at pisem dot net
Description:
------------
using return value of implode() as empty() param causes "Fatal error: Can't use function return value in write context"
empty(implode($arr))

Test script:
---------------
<?php
$foo = array('b','a','r');
if (empty(implode('', $foo)
{
    echo 'ok';
}
else
{
    echo 'not ok';
}
?> 

Expected result:
----------------
'ok' or 'not ok' string, not fatal error :)

Actual result:
--------------
Fatal error: Can't use function return value in write context

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2010-07-02 14:12 UTC] valcool at pisem dot net
-Status: Open +Status: Closed
 [2010-07-02 14:12 UTC] valcool at pisem dot net
documented, my fault
 [2010-07-02 14:13 UTC] degeberg@php.net
-Status: Closed +Status: Bogus
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Sep 12 10:00:02 2025 UTC