Last active
May 12, 2016 10:53
-
-
Save AndrewCarterUK/b4245f5e8adc5c0148d1f4cad8b41680 to your computer and use it in GitHub Desktop.
Verifying PHPixie fraud on SitePoint survey
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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