php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #4586 if (!empty($class_a->get('aa'))) { produces parse error
Submitted: 2000-05-24 21:02 UTC Modified: 2000-05-30 19:12 UTC
From: wints at hot dot ee Assigned:
Status: Closed Package: Scripting Engine problem
PHP Version: 4.0 Release Candidate 2 OS: redhat 6.0
Private report: No CVE-ID: None
View Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
If you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: wints at hot dot ee
New email:
PHP Version: OS:

 

 [2000-05-24 21:02 UTC] wints at hot dot ee
this script produces error: 
parse error ,expecting ?')" in ... on line ... 

  if (!empty($t_dtd->get('group_field'))) {    
        $group_field = 'v'.$t_dtd->get('group_field');
        if (!empty($t_dtd->get('group_func'))){
	$group_func = "g_fn_".$t_dtd->get('group_func');
        }else{     
	$group_func = "g_fn_base";
        }   
  }    


this one is ok

$t = $t_dtd->get('group_field');
if (!empty($t)) {    
      $group_field = 'v'.$t_dtd->get('group_field');    
      $t = $t_dtd->get('group_func');
      if (!empty($t)){
     	$group_func = "g_fn_".$t_dtd->get('group_func');
      }else{ 
	$group_func = "g_fn_base";    
     }   
}

Patches

Pull Requests

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2000-05-30 19:12 UTC] stas at cvs dot php dot net
You cannot use empty() on non-variable. 
Use  or $t_dtd->get('group_field') != 0
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Sat Sep 28 19:01:26 2024 UTC