cakephp - How can php code wrapped in if(false) produce an error? -


i have situation code wrapped in if(false) { /* code here */ } stops page loading when uncommented. browser says "the server reset connection". environment is:

  • cakephp: 2.5.2
  • php: 5.5.9-1ubuntu4.14
  • apache/2.2.22 (debian)

any pointers start looking reason happens welcome!

edit: actual code

// code above   exit();  if(false) {  /*     foreach($all_item_types $ait) {     $id = $ait['itemtype']['id'];     $itemsubtypeversionview->find('first', array('conditions' => array('item_type_id'=>$id)));     if(empty($itemsubtypeversionview->find('first', array('conditions' => array('item_type_id'=>$id))))) {         $empty_file_types[$id]= array('n'=>$ait['itemtype']['name']);      }   }   */ }  // code below 

in php < 5.5, empty() can accept variable parameter. minor refactor make code little cleaner anyways:

if (false) {     foreach ($all_item_types $ait) {         $id = $ait['itemtype']['id'];         $result = $itemsubtypeversionview->find('first', array('conditions' => array('item_type_id' => $id)));         if (empty($result)) {             $empty_file_types[$id]= array('n' => $ait['itemtype']['name']);          }     } } 

Comments

Popular posts from this blog

authentication - Mongodb revoke acccess to connect test database -

c - getting error: cannot take the address of an rvalue of type 'int' -

How to merge four videos on one screen with ffmpeg -