adspace


Explain Type hinting in PHP?

Answer Posted / Pankaj Sahu

Type hinting is a feature in PHP that allows specifying the expected data type of a function parameter or return value. By declaring the type of a variable as part of a function's signature, it can help prevent errors and make code more self-documenting. For example:nfunction myFunction(string $name): void {$$} // Here, we're saying that the function 'myFunction' expects a string parameter named 'name', and will not return any value.

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is the difference between htmlentities() and htmlspecialchars()?

1089


hello all, I need some sample placement papers in lion bridge.. can anyone help me?

2174


Explain me is it possible to destroy a cookie?

1025


What is trait in php?

1065


What is the current stable version of php?

1122


Name and explain five of the PHP error constants?

1033


How to calculate the difference between two dates using php?

1142


List some features of php that are deprecated in php7?

1021


Tell me what kind of things have you done on the social side?

1063


How can we extract string "pcds.co.in" from a string "https://info@pcds.co.in" using regular expression of php? More on reg can you explain

1076


What does $_files means?

1162


how to detect a mobile device using php

1172


What is difference between static and final in php?

1107


sort term descripttion form, report and uery

2254


How to create a web form?

1109