How to access an object variable?

There is such an object:

JPagination Object
(
[limitstart] => 15
[limit] => 5
[total] => 16
[_viewall] => 
[_errors] => Array
    (
    )
[pages.total] => 4
[pages.current] => 4
[pages.start] => 1
[pages.stop] => 4
)

I need to change pages.total,
$this->pagination->??? = 5

So far I’m only getting errors, no matter how hard I tried.

Thank you


Answer 1, authority 100%

If php version > 5.3 then:

$obj_prop = 'pages.total';
$obj = new JPagination();
$obj->$obj_prop = 5;

Adding.

I completely forgot, if php is up to 5.3, then you can use the functions call_user_funcand call_user_func_array.