Created
March 28, 2017 00:36
-
-
Save porty/97e8f4cc2a9d05fa60bf4e92d90906e6 to your computer and use it in GitHub Desktop.
How to debug in php
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
private function log($args) | |
{ | |
$str = ''; | |
foreach ($args as $arg) { | |
if (is_string($arg)) { | |
$str .= $arg; | |
} else { | |
ob_start(); | |
var_dump($arg); | |
$str .= ob_get_clean(); | |
} | |
} | |
$str .= "\n"; | |
file_put_contents('/some-mount-point-shared-with-host/log.log', $str, FILE_APPEND); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment