<?php
class Me
{
# Özellikler
public $property_1 = 'Özellik 1';
public $property_2 = 'Özellik 2';
# Özellikler
public static $static_property_1 = 'Statik Özellik 1';
public static $static_property_2 = 'Statik Özellik 2';
# Davranışlar
public function method_1() { return __FUNCTION__; }
public function method_2() { return __FUNCTION__; }
# Statik Davranışlar
public static function static_method_1() { return __FUNCTION__; }
public static function static_method_2() { return __FUNCTION__; }
}
$x = 1;
$me = new Me();
# Özellik çağır
$prop = 'property_' . $x;
echo $me->$prop;
echo '<br>';
# Statik Özellik çağır
$staticprop = 'static_property_' . $x;
echo Me::${$staticprop};
echo '<br>';
# Davranış çağır
$func = 'method_' . $x;
echo $me->$func();
echo '<br>';
# Statik davranış çağır
$staticfunc = 'static_method_' . $x;
echo Me::$staticfunc() . '<br>';
exit;
?>Umarım probleminizi bu kodlardaki örnekler giderebilir.