- You MUST load PDO before loading any PDO drivers
- An iterator cannot be used with foreach by reference
- Cannot create references to elements of a temporary array expression
- Cannot create references to/from string offsets nor overloaded objects
- Cannot assign by reference to overloaded objects
- Only variable references should be returned by reference
- Only variables can be passed by reference
- Cannot return string offsets by reference
- Cannot use string offset as an array
Cannot use object as array-- See Dans comment- Cannot use a NULL value as an array
- Cannot use a scalar value as an array
- foreach() can not iterate over objects without PHP class
- Cannot use assign-op operators with overloaded objects nor string offsets
- __HALT_COMPILER() can only be used from the outermost scope
- Assigning the return value of new by reference is deprecated
- Variables passed to each() must be an array or object
- Constants may only evaluate to scalar values
is_a() is deprecated. The "instanceof" operator should be used insteadThis has changed as of PHP 5.3, see Gregs comment- Cannot add internal functions to return value from get_defined_functions()
- Cannot add user functions to return value from get_defined_functions()
- Static functions cannot be abstract
- Exceptions must be derived from the Exception base class
- Need to supply an object when throwing an exception
- Cannot declare self-referencing constants
- Cannot use call_user_function on objects without a class entry
- Cannot access self:: when no class scope is active
- Cannot access parent:: when no class scope is active
- Cannot access parent:: when current class scope has no parent
- add_assoc_function() is no longer supported
- Usage of {} to access string offsets is deprecated and will be removed in PHP 6
- Cannot re-assign $this
- __toString() must not throw an exception
- Can't use method return value in write context
- Can't use function return value in write context
- Multiple access type modifiers are not allowed
- Cannot use the final modifier on an abstract class member
- Default value for parameters with a class type hint can only be NULL
- Default value for parameters with array type hint can only be an array or NULL
- Cannot call __clone() method on objects - 'clone $obj' should be used instead
- Clone method does not require arguments
- Interfaces cannot not implement themselves
- Classes may not inherit from classes declared final
- Classes cannot inherit previously-inherited constants from interfaces
- Classes cannot implement previously-implemented interfaces
- Class declarations may not be nested
- Cannot use reserved words as class or interface names
- Interfaces may not include member variables
- Properties cannot be declared abstract
- Cannot declare properties final, the final modifier is allowed only for methods
Tuesday, June 17, 2008
50 Random PHP5 Facts
Subscribe to:
Post Comments (Atom)
6 comments:
I disagree with 10.
Example code provided:
Code
Good wrap-up. Thanks.
51. PHP Cannot be used to write nice code.
Ironically Re: 19 is_a is undeprecated in 5.3 so for now it just throws annoying notices.
#33 __toString can not throw an exception is mindless and messing up my life at the moment.
As is the inability to have methods with the same name but different signatures. PHP is a toy but some of us have no choice.
I have to agree. I can't think of a reason other than someone not wanting to change something under the hood that being able to use exceptions within __toString shouldn't be allowed.
Post a Comment