jefftanner Posted March 31, 2008 Share Posted March 31, 2008 I dumbfounded as to why the following code - is_null( $array['foo'] ) fails to parse: [pre] if ( is_null( $parsed['text_product_ids'] ) { $parsed['text_product_ids'] = '5, 6, 7, 8, 9, 10'; } [/pre] But this succeeds to be parsed and executes: [pre] $showSelectedProducts = $parsed['text_product_ids']; if ( is_null( $showSelectedProducts ) ) { $parsed['text_product_ids'] = '5, 6, 7, 8, 9, 10'; } [/pre] Just curious -- Jeff in Seattle Link to comment https://forums.phpfreaks.com/topic/98861-php-fails-to-parse-with-arrayfoo-as-the-value-within-is_null/ Share on other sites More sharing options...
papaface Posted March 31, 2008 Share Posted March 31, 2008 if ( is_null( $parsed['text_product_ids'] ) { $parsed['text_product_ids'] = '5, 6, 7, 8, 9, 10'; } You have missed a ) should be: if (is_null($parsed['text_product_ids'])) { $parsed['text_product_ids'] = '5, 6, 7, 8, 9, 10'; } Link to comment https://forums.phpfreaks.com/topic/98861-php-fails-to-parse-with-arrayfoo-as-the-value-within-is_null/#findComment-505861 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.