3v4l.org

run code in 200+ php & hhvm versions
Bugs & Features
<?php $str = pi(); $a = strval($str); $b = (string)$str; $c = "$str"; $d = $str; settype($d, "string"); var_dump($a); var_dump($b); var_dump($c); var_dump($d); $p = M_PI; echo gettype($p);
based on QjLGu
Output for 4.3.0 - 7.2.0
string(15) "3.1415926535898" string(15) "3.1415926535898" string(15) "3.1415926535898" string(15) "3.1415926535898" double