1--TEST-- 2ReflectionClass::__constructor() - bad arguments 3--FILE-- 4<?php 5try { 6 var_dump(new ReflectionClass()); 7} catch (Exception $e) { 8 echo $e->getMessage() . "\n"; 9} 10 11try { 12 var_dump(new ReflectionClass(null)); 13} catch (Exception $e) { 14 echo $e->getMessage() . "\n"; 15} 16 17try { 18 var_dump(new ReflectionClass(true)); 19} catch (Exception $e) { 20 echo $e->getMessage() . "\n"; 21} 22 23try { 24 var_dump(new ReflectionClass(1)); 25} catch (Exception $e) { 26 echo $e->getMessage() . "\n"; 27} 28 29try { 30 var_dump(new ReflectionClass(array(1,2,3))); 31} catch (Exception $e) { 32 echo $e->getMessage() . "\n"; 33} 34 35try { 36 var_dump(new ReflectionClass("stdClass", 1)); 37} catch (Exception $e) { 38 echo $e->getMessage() . "\n"; 39} 40 41try { 42 var_dump(new ReflectionClass("X")); 43} catch (Exception $e) { 44 echo $e->getMessage() . "\n"; 45} 46 47?> 48--EXPECTF-- 49Warning: ReflectionClass::__construct() expects exactly 1 parameter, 0 given in %s on line 3 50object(ReflectionClass)#%d (1) { 51 ["name"]=> 52 string(0) "" 53} 54Class does not exist 55Class 1 does not exist 56Class 1 does not exist 57 58Notice: Array to string conversion in %s on line 27 59Class Array does not exist 60 61Warning: ReflectionClass::__construct() expects exactly 1 parameter, 2 given in %s on line 33 62object(ReflectionClass)#%d (1) { 63 ["name"]=> 64 string(0) "" 65} 66Class X does not exist 67