Run php from command line without script file

Do you want to run a quick php script, a line or two, without having file? Thanks for PHP’s cute command line option you can do that.
If you have some file the way to run it, as you know would be

php file.php

But without file if you want to run a simple function like date then use -r option

php -r "echo date();"

would do the trick

Also if you want to get explanation on some built-in function

php --rf strtoupper

would give you an explanation that is something like

Function [  function strtoupper ] {

  - Parameters [1] {
    Parameter #0 [  $str ]
  }
}

For more use php –help!!