PHP sinh() Function

Beginner
5 min read
Updated: Nov 2026
3 examples
Math

Definition

In PHP, sinh() returns the hyperbolic sine of a number.

The hyperbolic sine is calculated as (e^x - e^-x) / 2. It looks like the sine function but is used in areas such as physics, engineering, and curves like the catenary.

Syntax

Call sinh() with the values you need. Start with this line.

PHP
$result = sinh(1);
CallWhat it does
sinh(0)Returns 0.
sinh(1)Returns about 1.1752.
sinh(-1)Returns about -1.1752.

Unlike sin(), sinh() is not limited to -1 to 1. It grows very fast for large inputs. The inverse function is asinh().

Library declarations
PHP
sinh(float $num): float

Parameters

ParameterDescription
numRequired. The number to calculate the hyperbolic sine for.

Return Value

Return ValueDescription
floatThe hyperbolic sine of num. Very large inputs return INF or -INF.

PHP Examples

Example 1 — Basic Hyperbolic Sine

Try sinh() with a few simple values.

PHP
<?php
echo sinh(0), PHP_EOL;
echo round(sinh(1), 4), PHP_EOL;
echo round(sinh(-1), 4), PHP_EOL;

How It Works

  1. sinh(0) is 0, just like sin(0).
  2. sinh(1) is about 1.1752 after rounding.
  3. sinh(-1) gives the same number with a negative sign.
  4. This shows that sinh() is an odd function.

Example 2 — Very Large Inputs

Hyperbolic sine grows quickly. Huge inputs overflow to infinity.

PHP
<?php
echo sinh(1000), PHP_EOL;
echo sinh(-1000), PHP_EOL;
echo sinh(2) == -sinh(-2) ? "Odd function" : "Not equal", PHP_EOL;

How It Works

  1. sinh(1000) is too big for a float, so PHP returns INF.
  2. sinh(-1000) is a huge negative number, so PHP returns -INF.
  3. sinh(2) equals -sinh(-2) because sinh() is an odd function.
  4. The ternary prints a message when the comparison is true.

Example 3 — Check the Formula with exp()

The hyperbolic sine can be built from exp(). Compare both results.

PHP
<?php
$x = 2;
$formula = (exp($x) - exp(-$x)) / 2;

echo "sinh():  ", round(sinh($x), 4), PHP_EOL;
echo "formula: ", round($formula, 4), PHP_EOL;

How It Works

  1. Set x to 2.
  2. Build the formula (e^x - e^-x) / 2 using exp().
  3. Call sinh() on the same value.
  4. Both results match after rounding to four decimals.

Frequently Asked Questions

sinh() returns the hyperbolic sine of a number, calculated as (e^x - e^-x) / 2.
sin() works with angles on a circle and stays between -1 and 1. sinh() works with a hyperbola and grows without limit.
The inverse is asinh(), which returns the number whose hyperbolic sine is the given value.
The result grows exponentially. When it is larger than the biggest float PHP can store, you get INF or -INF.
Neither. The input is a plain number, not an angle, so no conversion is needed.

Next: sqrt()

sqrt() returns the square root of a number.

sqrt() tutorial →

About the author

Mari Selvan M P
Mari Selvan M P 🔗

Developer, cloud engineer, and technical writer

  • Experience 12 years building web and cloud systems
  • Focus Full Stack Development, AWS, and Developer Education

I write practical tutorials so students and working developers can learn by doing—from databases and APIs to deployment on AWS.

8 people found this page helpful