- 1
 
$x = [$x => $x];
                                    Нашли или выдавили из себя код, который нельзя назвать нормальным, на который без улыбки не взглянешь? Не торопитесь его удалять или рефакторить, — запостите его на говнокод.ру, посмеёмся вместе!
Всего: 30
−128
$x = [$x => $x];
                                    собеседование, Карл
−97
Мне было откровение -  Господь приподнял полу мантии...
Я понял, в чем смысл жизни: он в сосании мужских хуёв.
                                    
+153
public function indexAction()
    {
        if (Zend_Auth::getInstance()->hasIdentity()) {
            Zend_Auth::getInstance()->getIdentity();
        }
    }
                                    
+152
<?php
class Router
{
    /** @var array */
    protected static $routeTable = array(
        'default'                         => 'index.php',
        'dashboard'                       => 'task.php',
        'user'                            => 'user.php',
        'location'                        => 'location.php',
        'ship'                            => 'ship.php',
        'task'                            => 'task.php',
        'subtask'                         => 'subtask.php',
        'view-task-list'                  => 'view-task-list.php',
        'completed-task'                  => 'completed-task.php',
        'view-completed-task-list'        => 'view-completed-task-list.php',
        'view-question-list'              => 'view-question-list.php',
        'user-report-problem'             => 'user-report-problem.php',
        'view-report-problem-list'        => 'view-report-problem-list.php',
        'view-direct-report-problem-list' => 'view-direct-report-problem-list.php',
        'reviewer'                        => 'reviewer.php',
        'report-direct'                   => 'report-direct.php',
        'report-to-task'                  => 'report-to-task.php',
        //TODO theme forest related (not used in application) remove
        'charts'                          => 'charts.php',
        'calendar'                        => 'calendar.php',
        'files'                           => 'files.php',
        'form_layouts'                    => 'form_layouts.php',
        'form_elements'                   => 'form_elements.php',
        'form_wizard'                     => 'form_wizard.php',
        'table'                           => 'table.php',
        'widgets'                         => 'widgets.php',
        'typography'                      => 'typography.php',
        'grids'                           => 'grids.php',
        'gallery'                         => 'gallery.php',
        'error'                           => 'error.php',
        'icons'                           => 'icons.php'
    );
    /**
     * Map route to page controller file.
     * Route represented as $_GET param 'p'
     *
     * @param string $route The route
     * @return string Path to page controller file
     */
    public static function dispatch($route)
    {
        $route = (string)$route;
        if (array_key_exists($route, self::$routeTable)) {
            return self::$routeTable[$route];
        }
        header('Location: index.php');
        exit();
    }
}
                                    
+159
class Z {
   public function __toString() { return 'zzzzzzzz'; }
}
 $zz = array();
 $zz[call_user_func_array('sprintf', array('%s', new Z))] = 1;
                                    нахуй так жить?
+151
error_reporting( 0 );
unset( $x[new XSLTProcessor()][new RecursiveArrayIterator()] );
                                    
+158
empty ( $php->p['h']{'p'}{'p'}['h']->p );
                                    
+153
php_sapi_name() === 'cli' or exit('Only CLI mode allowed');
getenv('API_HOST') or exit(<<<EOT
  To run tests you should setup "API_HOST" environment variable.
  Try follow in bash command line:
  $ export API_HOST=<api_host>
  cd path/to/tests
  php direct_report_problem.php
EOT
);
defined('API_ENDPOINT') || define('API_ENDPOINT', getenv('API_HOST') . '/webservice/index.php');
$method = API_ENDPOINT . '?op=...';
$describe = function ($msg, $test) {
    printf("\n\n[%s]\n\n%s\n\n", $msg, shell_exec($test()));
    sleep(2);
};
$describe('Cannot upload empty report', function() use ($method) {
    return 'curl'
    . ' -F user_id=61'
    . ' ' . $method;
});
$describe('Can upload only direct report note', function() use ($method) {
    return 'curl'
    . ' -F user_id=61'
    . ' -F problem_note=NOTE'
    . ' ' . $method;
});
$describe('Can upload only direct report sound', function() use ($method) {
    return 'curl'
    . ' -F user_id=61'
    . ' -F [email protected]'
    . ' ' . $method;
});
$describe('Can upload only direct report image', function() use ($method) {
    return 'curl'
    . ' -F user_id=61'
    . ' -F [email protected]'
    . ' ' . $method;
});
$describe('Can upload all data direct report note, image, sound', function() use ($method) {
    return 'curl'
    . ' -F user_id=61'
    . ' -F problem_note=NOTE'
    . ' -F [email protected]'
    . ' -F [email protected]'
    . ' ' . $method;
});
                                    
−148
"class".class.class
                                    Не говнокод, просто забавно
+150
$duration_date = date(
    'Y-m-d H:i:s',
    strtotime(
        date(
            'Y-m-d H:i:s',
            strtotime($_REQUEST['task_start_date'])) . ' + ' . $_REQUEST['task_frequency'] . '  ' . $freq_type . ''
    )
);
                                    Кто-то может это упростить ? Я уже устал