<?php $t = 1; $p = (string) ($t ? 2 : 3); var_dump($p);
Standard input is empty
string(1) "2"
The brand new service which powers Ideone!
Widget for compiling and running the source code in a web browser!