Here is my code:
function phpwtf(string $s) { echo \"$s\\n\"; } phpwtf(\"Type hinting is da bomb\");
Which results in this error:
Maybe not safe and pretty but if you must:
class string { private $Text; public function __construct($value) { $this->Text = $value; } public function __toString() { return $this->Text; } } function Test123(string $s) { echo $s; } Test123(new string("Testing"));