It should be simple, but I ran into a number of errors.
First I got stuck on
libtool: line 990: g++: command not found. It turns out I needed to install
yum install gcc-c++
Then I got stuck on this one:
platform.h:110:2: error: #error "Can not compile without isnan function or macro [...] "Coordinate.inl:38: error: ‘ISNAN’ was not declared in this scope
In these versions of g++
isnanis defined as a macro in
unless is included, in which case
std::isnan()is defined instead.
And so I tried replacing
#include <math.h> with
#include <cmath> in
include/geos/platform.h. Amazingly, that worked.
Testing how long it takes to assign a variable versus assigning through WordPress’ apply_filters(). Filters are core to WordPress, but I haven’t yet looked at the total number of apply_filters() calls used throughout the code. The answer to this question is that calling a non-existing filter before assignment is about 21 times more costly than […] » about 300 words
Question: Should you check for a file before attempting to include it, or just suppress errors? Calling file_exists requires stating it twice if the file does exist, so that could take longer. Answer: the file_exists pattern is more than five times faster than the @include pattern for a file that doesn’t exist, and not substantially […] » about 300 words
An argument has erupted over the WordPress actions wp_enqueue_scripts and admin_enqueue_scripts vs. init. One of the points was about specificity, and how wp_enqueue_scripts and admin_enqueue_scripts can reduce ambiguity. I didn’t realize I had strong opinions on it until the issue was pressed, but it turns out I think wp_enqueue_scripts and admin_enqueue_scripts are unnecessary and unfortunate additions […] » about 300 words
A short test to confirm references are preserved in cloned arrays. The result is: Now let’s mess with one piece of that to check if the object was passed by reference or got cloned: Confirmed, the object is passed by reference, even though the array that contained it was cloned: » about 300 words
Six years ago this month the Zend framework preview was released and Rasmus Lerdorf published a blog post titled “The no-framework PHP MVC framework” (italics added). R. Rajesh Jeba Anbiah noted irony.
Regular Expression Matching Can Be Simple And Fast, by Russ Cox:
Perl [and PHP and others] could not now remove backreference support, of course, but they could employ much faster algorithms when presented with regular expressions that don’t have backreferences.
How much faster? About a million times (no, I do not exaggerate).
I use a lot of regular expressions, and relatively few of them use backreferences. It’d be worth optimizing.
There it is in the PHP manual for
Note: since return() is a language construct and not a function, the parentheses surrounding its arguments are not required. It is common to leave them out, and you actually should do so as PHP has less work to do in this case.
I knew the parentheses were optional, but I’ve been merrily using them all along. And I probably would have continued doing so until I saw the second note attached to the docs:
Note: You should never use parentheses around your return variable when returning by reference, as this will not work. You can only return variables by reference, not the result of a statement. If you use return ($a); then you’re not returning a variable, but the result of the expression ($a) (which is, of course, the value of $a).