Skip to content

Commit

Permalink
bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Leonid74 committed Feb 20, 2023
1 parent 11c47a9 commit 5d55c13
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/StringHelper.php
Original file line number Diff line number Diff line change
Expand Up @@ -482,9 +482,12 @@ public static function printVar( $mixVar, string $sTitle = '' ): void
// search pattern
$pat = '#(.*)' . __FUNCTION__ . ' *?\( *?(.*) *?\)(.*)#i';
// extract $varname from match no 2
$var = \preg_replace( $pat, '$2', $src );
$var = \trim( \preg_replace( $pat, '$2', $src ) );
// print to browser
if ( !empty( $sTitle ) ) {
$var = $sTitle . ': ' . \str_replace( ", '" . $sTitle . "'", '', $var );
}
// @codingStandardsIgnoreLine
echo '<pre>' . ( empty( \trim( $sTitle ) ) ? '' : \trim( $sTitle ) . ': ' ) . \trim( $var ) . ' = ' . \print_r( \current( \func_get_args() ), true ) . '</pre>';
echo '<pre>' . $var . ' = ' . \print_r( \current( \func_get_args() ), true ) . '</pre>';
}
}

0 comments on commit 5d55c13

Please sign in to comment.