|
Posted by rustysmith on 09/18/06 23:58
Anyone know how to sniff out the PHP version that a current file is
running on? This would be helpful in the instance where you are trying
to make a package that can be distributed publicly for use in a variety
of configurations. This code should(?) work:
$ver=PHP_VERSION;
if(ereg('^[1-4]',$ver))
$post_ids=array_flip(&$post_ids); // Old syntax
else
$post_ids=array_flip($post_ids); // PHP 5+ syntax
but it still throws the error:
Warning: Call-time pass-by-reference has been deprecated - argument
passed by value; If you would like to pass it by reference, modify the
declaration of array_flip(). If you would like to enable call-time
pass-by-reference, you can set allow_call_time_pass_reference to true
in your INI file. However, future versions may not support this any
longer.
When executed in PHP 5.+
Thanks in advance for any ideas how to make this work?
Navigation:
[Reply to this message]
|