When bw_backtrace() is passed an incomplete object, which could have been created during unserialize(), then it produces the following message:
Catchable fatal error: Object of class __PHP_Incomplete_Class could not be converted to string in oik-bwtrace\includes\bwtrace.php on line 964
Expected output
oik-bwtrace should not be producing this message during bw_backtrace().
Explanation
The logic to determine what to print for function parameters doesn't detect the __PHP_Incomplete_Class and there is no try / catch logic.
Proposed solution
The simplest solution is to check is_scalar() before appending the value.
In the final else situation just print unsupported.
This is only a back trace after all.
If you really want to see the values you should bw_trace2() the parameter in a separate call.
Better test that as well!
Actual output
When bw_backtrace() is passed an incomplete object, which could have been created during unserialize(), then it produces the following message:
Catchable fatal error: Object of class __PHP_Incomplete_Class could not be converted to string in oik-bwtrace\includes\bwtrace.php on line 964
Expected output
oik-bwtrace should not be producing this message during bw_backtrace().
Explanation
The logic to determine what to print for function parameters doesn't detect the __PHP_Incomplete_Class and there is no try / catch logic.
Proposed solution
The simplest solution is to check is_scalar() before appending the value. In the final else situation just print
unsupported
. This is only a back trace after all. If you really want to see the values you should bw_trace2() the parameter in a separate call. Better test that as well!Additional notes
In certain circumstances this message will cause the invoking routine to terminate unexpectedly. This problem was discovered when analysing https://deliciousbrains/wp-migrate-db/issues/70