zhangjingli35 / hamcrest

Automatically exported from code.google.com/p/hamcrest
0 stars 0 forks source link

callable() conflicts with "callable" keyword introduced by PHP 5.4 #172

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
From "Amjad Mohamed" <andhos@gmail.com>

Hamcrest fails with the following error. Apparently a token called 'callable' 
has been introduced which conflicts with Hamcrest's callable function.

PHP Parse error:  syntax error, unexpected 'callable' (T_CALLABLE), expecting 
identifier (T_STRING) or '(' in /usr/share/php/Hamcrest/hamcrest.php on line 390

Original issue reported on code.google.com by dharkn...@gmail.com on 20 Jan 2012 at 6:44

GoogleCodeExporter commented 8 years ago
Rename it callableValue() to match intValue() and friends.

Unfortunately there's no easy way to fix this while keeping backward 
comparability. While we could use version_compare() to create either callable() 
or callableValue(), the code that builds the helper functions is generated from 
the @factory annotations. This will require a special case or simply break 
backward compatibility.

Original comment by dharkn...@gmail.com on 20 Jan 2012 at 6:46

GoogleCodeExporter commented 8 years ago
I've changed it to callableValue() as all other type-based matchers are named 
as such.

Original comment by dharkn...@gmail.com on 20 Jan 2012 at 7:30