PHP CLI is brilliant and once I found out about it writing scripts and cron jobs became a lot simpler.
I have php scripts that run on the command line that run for long periods of time. I have also found a lot of ways to reuse code originally written for our website.
I don't know about memory consumption problems, but I have php scripts that are coded functionally (not OO) that run for an hour (processing HUGE amounts of data).