1--TEST--
2Testing __debugInfo() magic method with bad returns RESOURCE
3--INI--
4allow_url_fopen=1
5--FILE--
6<?php
7
8class C {
9  public $val;
10  public function __debugInfo() {
11    return $this->val;
12  }
13  public function __construct($val) {
14    $this->val = $val;
15  }
16}
17
18$c = new C(fopen("data:text/plain,Foo", 'r'));
19var_dump($c);
20--EXPECTF--
21Fatal error: __debuginfo() must return an array in %s%eZend%etests%edebug_info-error-resource.php on line %d
22