A simple search for "php test memory usage" returns the memory_get_usage function as its first result. There are even AI examples provided by some search engines to give you a head start (YMMV). There are also examples for you in the documentation itself.
Was there something in particular you were having trouble with to determine how much memory your scripts need?