1--TEST-- 2Test implode() function: error conditions 3--FILE-- 4<?php 5/* only glue */ 6try { 7 var_dump(implode("glue")); 8} catch (TypeError $e) { 9 echo $e->getMessage(), "\n"; 10} 11 12/* NULL as pieces */ 13try { 14 var_dump(implode("glue", NULL)); 15} catch (TypeError $e) { 16 echo $e->getMessage(), "\n"; 17} 18 19/* integer as glue */ 20try { 21 var_dump(implode(12, "pieces")); 22} catch (TypeError $e) { 23 echo $e->getMessage(), "\n"; 24} 25?> 26--EXPECT-- 27implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given 28implode(): If argument #1 ($separator) is of type string, argument #2 ($array) must be of type array, null given 29implode(): Argument #2 ($array) must be of type ?array, string given 30