#!/bin/sh # get functions and constants [ "$#" = 0 ] && php -r '$functions = get_defined_functions(); foreach ($functions["internal"] as $function) { echo $function . "\n"; };' [ "$#" = 0 ] && php -r '$constants = get_defined_constants(true); foreach ($constants as $constant) { print_r(array_keys($constant)); };' | grep -oP "=>\s+\K\w+" # psysh doc wrapper [ -z "$1" ] || echo doc "$1" | psysh;