php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #55487 crash when calling of empty and isset functions
Submitted: 2011-08-23 09:37 UTC Modified: 2011-08-23 09:40 UTC
From: jamal at tantaoui dot com Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 5.3.7 OS: Windows XP SP3
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: jamal at tantaoui dot com
New email:
PHP Version: OS:

 

 [2011-08-23 09:37 UTC] jamal at tantaoui dot com
Description:
------------
calling a class instance in isset causes an error 500

Test script:
---------------
<?php 
class MyClass {
  private $myobj;

  public function __construct() 
  {
    $this->myobj = 'Test OK';
  }

  public function getMyObject()
  {
    return $this->myobj;
  }
}

$instance = new MyClass();
echo empty($instance->getMyObject()) ? 'Empty value' : $instance->getMyObject();

//$myobj = $instance->getMyObject();    
//echo empty($myobj) ? 'Empty value' : $instance->getMyObject(); //Work correctly

?>

Expected result:
----------------
Test OK

Actual result:
--------------
500 Internal Server Error

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2011-08-23 09:40 UTC] pajoye@php.net
-Status: Open +Status: Bogus
 [2011-08-23 09:40 UTC] pajoye@php.net
There is no crash but an error:

"Fatal error: Can't use method return value in write context in G:\php-sdk\php-
src\55487.php on line 17"

Check your log or enable display_error in development mode.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Wed Jul 09 16:02:26 2025 UTC