Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: 36fa17a5fa
Fetching contributors…

Cannot retrieve contributors at this time

27 lines (19 sloc) 0.506 kb
--TEST--
An error is thrown when an unsupported type is encoded
--FILE--
<?php
$resource = fopen(__FILE__, "r");
var_dump($resource);
var_dump(json_encode($resource));
var_dump(json_last_error());
var_dump(json_encode($resource, JSON_PARTIAL_OUTPUT_ON_ERROR));
var_dump(json_last_error());
?>
--EXPECTF--
resource(5) of type (stream)
Warning: json_encode(): type is unsupported in %s on line %d
bool(false)
int(8)
Warning: json_encode(): type is unsupported in %s on line %d
string(4) "null"
int(8)
Jump to Line
Something went wrong with that request. Please try again.