php - How to output the methods from class -
<?php class { public $attribute1; function operation1() { echo 'operation1'; } } $a = new a(); var_dump($a);
it shows:
object(a)[1] public 'attribute1' => null
question:
it outputs property in class a
, if want see methods/functions in class a
, how do?
you can gets class methods' names
$class_methods = get_class_methods('a'); // or $class_methods = get_class_methods(new a()); foreach ($class_methods $method_name) { echo "$method_name\n"; }
Comments
Post a Comment