I just took a mock Zend PHP 5 certification exam which had the following question…
What should go in the ??? assignment below to create a Zlib-compressed file foo.gz with a compression level of 9?
$file = '???????';
$fr = fopen($file, 'wb9');
fwrite($fr, $data);
fclose($fr);
I don’t know a ton about creating compressed files, but I was under the impression you were supposed to use gzopen, and that the number 9 in ‘wb9’ above wasn’t valid with fopen.
Anyway, the multiple choice answers given are…
- gzip://foo.gz?level=9
- compress.zip://foo.gz?level=9
- compress.zlib://foo.gz
- compress.gzip://foo.gz?level=9
- zlib://foo.gz
Anyone know the answer?
On a side note, I know people have mixed feelings on this exam, but I figure it’s pretty cheap and supposedly not too difficult so what the hell. I actually passed the practice exam with “Excellent”. But I have a couple weak areas (streams, network programming, and RegEx) Has anyone taking the practice exams and real exam? If so, how would you say they compare?