data = array( $message, $data ); } /** * Print the message and data inside the console of the browser. */ public function dump() { // Buffering. ob_start(); $output = ''; foreach ( $this->data as $entry ) { $output .= 'console.info(' . json_encode( $entry[0] ) . ');'; $output .= 'console.log(' . json_encode( $entry[1] ) . ');'; } echo sprintf( '', $output ); } }