On Wed, 2008-02-13 at 08:05 -0200, Felipe Pena wrote:
> Em Qua, 2008-02-13 às 09:47 +0100, Pierre Joye escreveu:
> > I can't test the patch right now but does it change the result or only 
> > raises
> > a notice?
> 
> It changes the result when a string is given, and issue notice when the
> string starts with numeric.
> 
> var_dump(acos("nonsense")); 
> Warning: acos() expects parameter 1 to be double, string given ...
> NULL
> 
> var_dump(acos("1000ABC"));
> Notice: A non well formed numeric value encountered ...
> float(NAN)

# php -n -derror_reporting=E_ALL -r 'var_dump(acos("ABC"));'
float(1.5707963267949)
# php -n -derror_reporting=E_ALL -r 'var_dump(acos("100ABC"));'
float(NAN)

That's with PHP 5.2.5. I rather like the idea of these functions not
doing magical conversion like this.

-- 
Patches/Donations: http://pecl.php.net/~jani/

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to