Missing signature violation warnings suck
I've been working on some code, while developing on PHP 5.3. The code resembles the following structure:
<?php
interface ezcSearchQuery
{
public function limit( $limit, $offset = '' );
}
interface ezcSearchFindQuery extends ezcSearchQuery
{
}
class ezcSearchFindQuerySolr implements ezcSearchFindQuery
{
public function limit( $limit = 10, $offset = 0 )
{
$this->limit = $limit;
$this->offset = $offset;
}
}
?>
No problems at all while development, no warnings, no errors. Now when I deployed this on a PHP 5.2 machine it bombed out, with the following correct message:
Fatal error: Declaration of ezcSearchFindQuerySolr::limit() must be compatible with that of ezcSearchQuery::limit() in /tmp/index.php on line 11
And this really sucks. I made a mistake in my code (wrongly implemented interface) and I get no warning (not even E_STRICT)... and then deploy it and it bails out on me. We can't have this. We need warnings (actually, it should be E_FATAL) for those cases in order to avoid problems. I don't know how this check got removed, but it should be put back in ASAP!
Comments
this code throws a Fatal error under 5.2.5 and also under 5.2.6-RC3 for me so whats the problem?
@Marco: The problem is that there is no warning at all in PHP 5.3.
The problem is, that this has been changed in 5.3.
Actually there's nothing wrong with different parameters in an implemented method. It's something you won't want to do often but you will want to do it and so this categorically should not cause a fatal error. The language should not attempt to impose misguided rules upon us.
"while developing on PHP 5.3."
@Marco: read, read and read again :P "while developing on PHP 5.3" != "when I deployed this on a PHP 5.2 machine" :)
It sounds like an interesting feature to me, in 5.3. It kind of brings about a BC break, and from that point of view, the different error levels sounds acceptable. That said, i guess this should be better signified as one of the 5.2 -> 5.3 migration tricks. And the question of having properly discussed this feature on the php core mailing list prior to implementing it is yet another issue :)
Life Line
Updated an information and a bench
Created 2 benches
Created 4 picnic_tables, a bench, and a fitness_station; Updated a pub and a sport club
Created 2 benches and 2 waste_baskets; Updated 4 benches, a bus_stop, and a cafe; Confirmed a dentist
Created 3 waste_baskets, 2 main entrances, and a bench; Deleted a cycle_barrier, a bench, and a waste_basket
Created an information; Updated a waste_basket and a bench
Updated 2 waste_baskets and a bench
Created 3 benches
Created a waste_basket; Updated 2 benches and a tree
I walked 3.5km in 35m31s
Created a main entrance and a home entrance
Created an entrance
Updated a house building
Created an entrance
I walked 5.8km in 1h15m06s
I've just finished reading "A Cheese-Monger's Tour de France", by Ned Palmer.
Now I want to try many of those! 🧀
I'm thrilled to announce that I'll be speaking at the 23rd edition of #phpday, the international PHP conference in Italy, organised by @grusp.
I’ll be presenting a talk titled: "Better Debugging With Xdebug".
It's in Verona, Italy, on May 14-15th 2026.
You can use my speaker’s discount code "speaker_10OFF" for 10% off at https://www.phpday.it/tickets/?utm_medium=organic&utm_source=linkedin&utm_campaign=post-speaker
I walked 5.5km in 1h11m00s
I walked 1.1km in 9m37s
Merged pull request #1066
PHP 8.6: Changes to opcache optimisations wrt function arguments
I walked 10.5km in 1h49m54s
Fixed building type
Fixed addresses and building type
Updated a bus_stop, a waste_basket, and a bench


Shortlink
This article has a short URL available: https://drck.me/msvws-6ah