Skip to content

Instantly share code, notes, and snippets.

@AndrewCarterUK
Last active May 12, 2016 10:53
Show Gist options
  • Save AndrewCarterUK/b4245f5e8adc5c0148d1f4cad8b41680 to your computer and use it in GitHub Desktop.
Save AndrewCarterUK/b4245f5e8adc5c0148d1f4cad8b41680 to your computer and use it in GitHub Desktop.
Verifying PHPixie fraud on SitePoint survey
<?php
// https://raw.githubusercontent.com/sitepoint-editors/php-fw-survey-2015/master/dump/survey.csv
$stream = fopen('survey.csv', 'r');
$headers = fgetcsv($stream);
$count = 0;
$phpixieCount = 0;
$nonPhpixieErrorCount = 0;
$phpixieErrorCount = 0;
while (($values = fgetcsv($stream))) {
$line = implode(',', $values);
$row = array_combine(
$headers,
$values
);
$error = $row['years-programming'] < $row['years-php'];
$phpixie = strstr($line, 'PHPixie') !== false;
$count++;
if ($error) {
if ($phpixie) {
$phpixieErrorCount++;
} else {
$nonPhpixieErrorCount++;
}
}
if ($phpixie) {
$phpixieCount++;
}
}
fclose($stream);
echo <<<EOT
Out of $count people surveyed:
- $phpixieCount mentioned PHPixie as a framework (PHPixie users)
- $phpixieErrorCount PHPixie users said they had more PHP experience than programming experience
- Only $nonPhpixieErrorCount other non PHPixie users said that
EOT;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment