diff --git a/features/bootstrap/debug.php b/features/bootstrap/debug.php new file mode 100644 index 0000000000..24ac40e5ad --- /dev/null +++ b/features/bootstrap/debug.php @@ -0,0 +1,29 @@ += 7. + function _var_dump( $var ) { + $ret = ''; + if ( $php_ver_7 = version_compare( PHP_VERSION, '7', '>=' ) ) { + $bt = debug_backtrace( 0, 1 ); + $file_line = isset( $bt[0] ) ? "{$bt[0]['file']}:{$bt[0]['line']}:\n" : ''; + } + for ( $i = 0, $cnt = func_num_args(); $i < $cnt; $i++ ) { + ob_start(); + var_dump( func_get_arg( $i ) ); + $v = ob_get_clean(); + $ret .= $php_ver_7 ? preg_replace( '/^.*?:\n/', $file_line, $v ) : $v; + } + return $ret; + } +}