I wrote a script that proves the above statements (the amount is not limited):
<?php $inters_string = ''; $interfaces_to_generate = 9999; for($i=0; $i <= $interfaces_to_generate; $i++) { $cur_inter = 'inter'.$i; $inters[] = $cur_inter; $inters_string .= sprintf('interface %s {} ', $cur_inter); } eval($inters_string); // creates all the interfaces due the eval (executing a string as code) eval(sprintf('class Bar implements %s {}', implode(',',$inters))); // generates the class that implements all that interfaces which were created before $quxx = new Bar(); print_r(class_implements($quxx));
You can change the var counter in a for loop to make the script create even more interfaces that will be implemented by the "Bar" class.
It works easily with interfaces up to 9999 (and obviously more), as you can see from the output of the last line of code (print_r) when executing this script.
Computer memory seems to be the only limit on the number of interfaces for which you get an exhausted memory error when the number is too large.
source share