Content · Programming · PHP

PHP asinh() Function: Usage and Examples

Learn how PHP asinh works with practical examples, important behavior, relevant alternatives and common mistakes.

1 views Published Oct 16, 2026 Updated Oct 16, 2026

Calculates the inverse hyperbolic sine of a number.

What Is asinh() in PHP?

Calculates the inverse hyperbolic sine of a number.

Its syntax is:

asinh(float $num): float

Parameters:

  • $num — Accepted as float; required argument.

Return type: float. Accepts both positive and negative inputs. Do not confuse it with asin(), the inverse ordinary sine.

Availability: Available in standard PHP.

Example 1: Basic Usage

<?php

echo asinh(0);

Output:

0

Accepts both positive and negative inputs. Do not confuse it with asin(), the inverse ordinary sine.

Example 2: A Different Input

<?php

echo round(asinh(1), 5);

Output:

0.88137

Accepts both positive and negative inputs. Do not confuse it with asin(), the inverse ordinary sine.

Practical Example: Applying It in a Program

<?php

$values = [-2, 0, 2];
foreach ($values as $value) { echo round(asinh($value), 3) . PHP_EOL; }

Output:

-1.444
0
1.444

Accepts both positive and negative inputs. Do not confuse it with asin(), the inverse ordinary sine.

Important Behavior and Edge Cases

  • Key behavior: Accepts both positive and negative inputs. Do not confuse it with asin(), the inverse ordinary sine.
  • Environment: Available in standard PHP.

Comparison With Related Functions

FunctionPurpose
asinh()calculates the inverse hyperbolic sine of a number.
asin()asin() calculates inverse ordinary sine over -1 to 1; asinh() calculates inverse hyperbolic sine.

Common Beginner Mistakes

MistakeCorrect Approach
Ignoring this behavior: Accepts both positive and negative inputsAccepts both positive and negative inputs. Do not confuse it with asin(), the inverse ordinary sine.

Key Takeaways

  • calculates the inverse hyperbolic sine of a number.
  • Accepts both positive and negative inputs. Do not confuse it with asin(), the inverse ordinary sine.
  • Available in standard PHP.

Summary: Accepts both positive and negative inputs. Do not confuse it with asin(), the inverse ordinary sine.

Share this resourceSend this page to someone who may find it useful.