TypePHP 编译器
https://swoole.com/aot/
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
18 lines
415 B
18 lines
415 B
--TEST--
|
|
log edge cases: zero, negative, and base validation
|
|
--FILE--
|
|
<?php
|
|
var_dump(log(0));
|
|
var_dump(log(-1));
|
|
try { var_dump(log(1, 0)); } catch (ValueError $e) { echo get_class($e) . ": " . $e->getMessage() . "\n"; }
|
|
var_dump(log(1, 1));
|
|
var_dump(log(8, 2));
|
|
var_dump(log(100, 10));
|
|
?>
|
|
--EXPECT--
|
|
float(-INF)
|
|
float(NAN)
|
|
ValueError: log(): Argument #2 ($base) must be greater than 0
|
|
float(NAN)
|
|
float(3)
|
|
float(2)
|
|
|