![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/squizlabs/php_codesniffer/tests/Core/Sniffs/ |
<?php /* testSimpleValues */ $foo = [1,2,3]; /* testSimpleKeyValues */ $foo = ['1'=>1,'2'=>2,'3'=>3]; /* testMissingKeys */ $foo = ['1'=>1,2,'3'=>3]; /* testMultiTokenKeys */ $paths = array( Init::ROOT_DIR.'/a' => 'a', Init::ROOT_DIR.'/b' => 'b', ); /* testMissingKeysCoalesceTernary */ return [ $a => static function () { return [1,2,3]; }, $b ?? $c, $d ? [$e] : [$f], ]; /* testTernaryValues */ $foo = [ '1' => $row['status'] === 'rejected' ? self::REJECTED_CODE : self::VERIFIED_CODE, '2' => in_array($row['status'], array('notverified', 'unverified'), true) ? self::STATUS_PENDING : self::STATUS_VERIFIED, '3' => strtotime($row['date']), ]; /* testHeredocValues */ $foo = array( <<<HERE HERE , <<<HERE HERE , ); /* testArrowFunctionValue */ $foo = array( 1 => '1', 2 => fn ($x) => yield 'a' => $x, 3 => '3', );