Declaring Variable Types in PHP?

I was trying to get my Netbeans to autocomplete with PHP, and I learned that this code is valid in PHP:

function blah(Bur $bur) {}

A couple of questions:

  1. Does this actually impose any limits on what type of variable I can pass to the blah method?
  2. If this is just to help the IDE, that's fine with me. How can I declare the type of a variable in PHP if I'm not in a function?


Read more here: https://stackoverflow.com/questions/390932/declaring-variable-types-in-php

Content Attribution

This content was originally published by Dan Rosenstark at Recent Questions - Stack Overflow, and is syndicated here via their RSS feed. You can read the original post over there.

%d bloggers like this: