3 ms·
I think your code will work because 1234 can be converted to a string. I think the trouble starts once you pass around objects.
by maxxxxx 9y ago
I think your code will work because 1234 can be converted to a string. I think the trouble starts once you pass around objects.
- w0rd-driven 9y agoIt actually doesn't according to http://sandbox.onlinephpfunctions.com/code/8804b49c23d62022854e928ef433c0ab9a5cbc5f http://sandbox.onlinephpfunctions.com/code/8804b49c23d620228..., though different PHP versions could produce different results.
- maxxxxx 9y agoThis works with PHP 7 <?php //Enter your code here, enjoy! function foo(string $bar) { return $bar . $bar; } echo foo(1234);