Example 1 — Print the Value of Pi
Call pi() with no arguments to get the value of pi.
<?php
echo pi(), PHP_EOL;
echo M_PI, PHP_EOL; How It Works
- pi() takes no arguments, so the parentheses stay empty.
- PHP prints the float using its default display precision.
- M_PI is the built-in constant with the same value.
- Both lines print the same number.

