smali

среда, 16 сентября 2015 г.

PHP Sadness


http://phpsadness.com/

These are things in PHP which make me sad. They are real, objective issues which I have personally encountered in my normal day-to-day activites. Nothing on this site should be taken to be the view of my employer or is related to my employer in any way.
If you'd like to contact me (in a polite and constructive way), I'm @ericwastl on Twitter.
Update 2015-03-28: Updated array_fill for PHP 5.6.

USELESS ERROR REPORTING

#44Detail in error messages

#16Exception thrown without a stack frame

#1Unexpected T_PAAMAYIM_NEKUDOTAYIM

#7Parse error: syntax error, unexpected T_SL in...


INCONSISTENCY

#4Function naming (underscores)

#15Function naming (prefixes)

#48Function naming (to/2)

#6Order of arguments (array manipulations)

#9Order of arguments (array/string search)

#51Occasionally significant parentheses

#52Comparison operators

OUTRIGHT BUGS

#50Segfault during deep recursion

#13Segfault with dba_*() functions

#19(<5.3) Can point a variable into raw memory with array_walk and debug_backtrace

#22(documented) The stream_tell() method cannot be overridden with a wrapper

#23Can't inspect some kinds of arguments with reflection

#30Ternary operator associativity

#36(<5.3) Segfault when calling an undefined method on PDOStatement

#39Declaring a function called __lambda_func() completely breaks create_function()

CRUFT

#11(<5.5) PHPE9568F34-D428-11d2-A769-00AA001ACF42

#45Syntax verbosity (arrays and array keys)

MISLEADING/CONFUSING TOPICS

#26(<5.4) E_ALL = E_ACTUALLY_ALL & ~E_STRICT

#27Bad function names - parse_str()

#34mktime() argument order (not inconsistent, just confusing)

#47Type-coercing comparison operators will convert numeric strings to numbers

#28The empty($v) function is actually (!isset($v) || $v != true)-and-silence-warnings

ARBITRARY RESTRICTIONS

#14Can't throw exceptions from __toString() functions

#25(<5.3) The func_get_args() function can't be used as a parameter

#38Some error conditions are simply uncatchable

#40(<5.4) The ob_start() function doesn't allow for a buffer length of 1 ("special value" for 4096)

#43(<5.6) The array_fill() function doesn't allow length 0

#35The explode() function won't split with empty string

ANTI-FUNCTIONAL DESIGN

#5Sort functions operate in-place

#12Functions that do many unrelated things

#21(<5.4) Cannot chain lookups/calls

#32(dubious) Function calls have enormous overhead (15x perl)

#42Instanceof produces a syntax error on expressions

MISSING FEATURES

#17Standard libc process control (fork/exec/etc)

#20(<5.4) No string escape code for ESC (ascii 27), normally \e

#29Can't decode php-session-format serialization outside a session

#49(<5.5) No support for finally-type error handling

OBJECT-ORIENTED SYSTEM ISSUES

#8Implementing all the right methods (array) still doesn't work in array functions

#18(intended) Static variables in methods are bound to all instances of the class

#24Seemingly redundant reflection methods with no documentation

#33No good way to modify private method behavior in a testing environment

#41Cannot create a final abstract class

LEXER/PARSER ISSUES

#2Member variable definition to function call is a syntax error

#31Fails to produce errors on bad octal

#37(<5.6) Cannot do static concatenation in member variable definition

#46Semicolon required at end of block

Комментариев нет:

Отправить комментарий