1)); }); check('valid JSON raises no PHP warning', $warnings, array()); check('valid JSON logs nothing', array(ZM\Rec::$errors, ZM\Rec::$debug), array(array(), array())); // var_export() of a self-referencing array warns, so it shows whether the value // was dumped although there was no error. $loop = array(); $loop['self'] = &$loop; json_decode('1'); $warnings = run(function() use (&$loop) { checkJsonError($loop); }); check('a value is not dumped when there is no JSON error', $warnings, array()); echo "\n$passed passed, $failed failed\n"; exit($failed ? 1 : 0); }