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
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: 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 21:01:26 2024 UTC