php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #38297 empty() crashed during parsing if not variable given
Submitted: 2006-08-02 15:16 UTC Modified: 2006-08-03 07:49 UTC
From: pityu-kg at rainstorm dot org Assigned:
Status: Not a bug Package: Reproducible crash
PHP Version: 4CVS-2006-08-02 (snap) OS: Win32
Private report: No CVE-ID: None
 [2006-08-02 15:16 UTC] pityu-kg at rainstorm dot org
Description:
------------
<?php
  empty(' ');
?>

crashes without any message, despite E_ALL config. It crashes during parsing, this code doesn't have to be accessible.

empty() should get only variables as parameter, not values.

Reproduce code:
---------------
<?php
  empty(' ');
?>


Expected result:
----------------
Some error or warning telling empty() should get variable, not a value.

Actual result:
--------------
PHP crash without any message. Apache does not crash.

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2006-08-02 15:32 UTC] tony2001@php.net
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting T_VARIABLE or '$'
 [2006-08-03 07:39 UTC] pityu-kg at rainstorm dot org
Sorry, you're right.
 [2006-08-03 07:49 UTC] derick@php.net
.
 
PHP Copyright © 2001-2025 The PHP Group
All rights reserved.
Last updated: Fri Jul 25 00:00:02 2025 UTC