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
 [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

Add a Patch

Pull Requests

Add a Pull Request

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-2024 The PHP Group
All rights reserved.
Last updated: Thu Apr 25 07:01:31 2024 UTC