Re: [PHP] version_compare

2010-09-30 Thread shiplu
On Thu, Sep 30, 2010 at 9:43 PM, Brian Smither bhsmit...@gmail.com wrote: I found this code... if (version_compare(PHP_VERSION, '5.2.0', '=')) { It means condition (PHP_VERSION = 5.2.0)  $text=filter_var($text, FILTER_SANITIZE_URL); } ...to be questionable. Under what conditions would

Re: [PHP] version_compare

2010-09-30 Thread Paul M Foster
On Thu, Sep 30, 2010 at 09:43:22AM -0600, Brian Smither wrote: I found this code... if (version_compare(PHP_VERSION, '5.2.0', '=')) { $text=filter_var($text, FILTER_SANITIZE_URL); } ...to be questionable. Under what conditions would version_compare() return true, yet the

Re: [PHP] version_compare

2010-09-30 Thread Jim Lucas
Brian Smither wrote: I found this code... if (version_compare(PHP_VERSION, '5.2.0', '=')) { $text=filter_var($text, FILTER_SANITIZE_URL); } ...to be questionable. Under what conditions would version_compare() return true, yet the filter_var() be undefined? Because that's what is

Re: [PHP] version_compare

2010-09-30 Thread Brian Smither
Personally, I would change that to be if ( function_exists('filter_var') ) { So would I: *But it's not my code. *I wish to learn and understand the cause of the problem - not walk around it. It means condition (PHP_VERSION = 5.2.0) I understand that. There was a second, more relevant, part to

Re: [PHP] version_compare

2010-09-30 Thread Jim Lucas
Brian Smither wrote: Personally, I would change that to be if ( function_exists('filter_var') ) { So would I: *But it's not my code. *I wish to learn and understand the cause of the problem - not walk around it. It means condition (PHP_VERSION = 5.2.0) I understand that. There was a

[PHP] filter_var (was: Re: [PHP] version_compare)

2010-09-30 Thread Brian Smither
As Paul pointed out, maybe your version of PHP was built without the filter_var function compiled in. This is what I have learned about PHP with filter_var() as an illustrative point: Many people who provide elaborations on PHP make too many assumptions or are blatently and woefully