This sounds a lot like JavaScript
PHP's gotchas are syntactic/semantic but mostly on its huge standard library, which is an haphazard collection of functions from sending emails to parsing ID3 tags from MP3 files.
EDIT: JS, as the legend says, was written in 10 days, while PHP grew without much long term vision for years.