Q; PhpStorm; Debugging; Log evaluated expression : Is it possible to to specify comment along with expression?

Location: Breakpoints property windows -> Actions: Log Evaluated Expression

The console is a great way to keep track of the order of execution and key variables that control that order.
I'd like to be able to give myself hints as to whats going, like this:
- "The current callback function is" : $calback
- "The current node being work on is" : $node->nid
Current, written as above, the console reads:
- "Cannot evaluate expression '"The current callback function is" : $router_item['page_callback']' "
Also, is there some way to ouput the elements of array, currently if I refer to an array: $user[tasks](where 'tasks' is an array) - the console ruturns "array" only?

Thanks

2 comments
Comment actions Permalink

Hello Kiril,

Current, written as above, the console reads:

- "Cannot evaluate expression '"The current callback function is" : $router_item['page_callback']' "

This feature works over standard evaluate action, so the text in the editor should be a valid php expression.

Try to write it in the following way (using concatenation operator):

"The current callback function is: " . $rounter['page_callback'']

Also, is there some way to ouput the elements of array, currently if I refer to an array: $user[tasks](where 'tasks' is an array) - the console ruturns "array" only?

Use php internal function implode:

implode(",",$user[tasks])


Thank you for feedback!

0
Comment actions Permalink

'Kirils current operation is: ' . $Expressions_of_Gratitude->Purchasing_Alcohol(Beer) . ' for Nikolay.' ;

0

Please sign in to leave a comment.