PATH:
opt
/
cpanel
/
ea-wappspector
/
vendor
/
squizlabs
/
php_codesniffer
/
src
/
Standards
/
Squiz
/
Tests
/
PHP
<?php function getVar($varname='var', $var='var') { $var = $var2 = getVar(); $var = $var2 = $var3 = ''; if ($varname === 'var' || $var2 === 'varname' || $var = true) { $var[($var + 1)] = $var2; $var[($var = 1)] = $var2; } for ($i = $var; (null !== ($key = key($i))); next($i)) { while ($i = true) { echo $i = getVar(); echo \A\B\C::$d = getVar(); } } while ($row = $query->fetch(PDO::FETCH_NUM)) { $result[$row[0]] = array(); $result[$row[0]][] = $current; self::$_inTransaction = TRUE; parent::$_inTransaction = TRUE; static::$_inTransaction = TRUE; $$varName = $varValue; } }//end getVar() class myClass { private static $_dbh = NULL; public $dbh = NULL; protected $dbh = NULL; var $dbh = NULL; // Old PHP4 compatible code. } A::$a = 'b'; \A::$a = 'c'; \A\B\C::$d = 'd'; B\C::$d = 'e'; @$a = 1; $a = []; foreach ($a as $b) $c = 'd'; $var = $var2; list ($a, $b) = explode(',', $c); $var1 ? $var2 = 0 : $var2 = 1; $obj->$classVar = $prefix.'-'.$type; $closureWithDefaultParamter = function(array $testArray=array()) {}; ?> <?php $var = false; ?> <?php while ( ( $csvdata = fgetcsv( $handle, 2000, $separator ) ) !== false ) { // Do something. } // Issue #2787. class Foo { protected ?int $id = null; } class Bar { // Multi-property assignments. private $a = false, $b = true; // Non-typed. public bool $c = false, $d = true; protected int $e = 123, $f = 987; } switch ($b < 10 && $a = 10) { case true: break; } $array = [ match ($b < 10 && $a = 10) { true => 10, false => 0 }, ]; $arrow_function = fn ($a = null) => $a; function ($html) { $regEx = '/regexp/'; return preg_replace_callback($regEx, function ($matches) { [$all] = $matches; return $all; }, $html); }; function () { $a = false; some_label: $b = getB(); }; ?> <?= $var = false; ?> // Issue PHPCSStandards/PHP_CodeSniffer#537. <?php $a * $b ?> <?php list ($c, $d) = explode(',', '1,2'); ?> <?= $a * $b ?> <?php list ($c, $d) = explode(',', '1,2'); ?> <?= $a * $b ?> <?= list ($c, $d) = explode(',', '1,2'); ?> <?php $a * $b ?> <?php [$c, $d] = explode(',', '1,2'); ?> <?= $a * $b ?> <?php [$c, $d] = explode(',', '1,2'); ?> <?= $a * $b ?> <?= [$c, $d] = explode(',', '1,2'); ?> <?php // Issue #598. $filtered_results->field = $result; $filtered_results->$field = $result; $filtered_results->$row->field = $result; $filtered_results->$row->$field = $result; $filtered_results[ $i ]->field = $result; $filtered_results[ $i ]->$field = $result; $filtered_results[ $i ]->$row->field = $result; $filtered_results[ $i ]->$row->$field = $result; $filtered_results[ $i ]->$row[0]->field = $result; $filtered_results[ $i ]->$row[$j]->$field = $result;
[-] DisallowMultipleAssignmentsUnitTest.php
[edit]
[-] DisallowSizeFunctionsInLoopsUnitTest.php
[edit]
[-] DisallowComparisonAssignmentUnitTest.php
[edit]
[-] DisallowBooleanStatementUnitTest.inc
[edit]
[-] EmbeddedPhpUnitTest.6.inc
[edit]
[-] EmbeddedPhpUnitTest.3.inc.fixed
[edit]
[-] HeredocUnitTest.php
[edit]
[-] DisallowInlineIfUnitTest.php
[edit]
[-] EmbeddedPhpUnitTest.22.inc
[edit]
[-] EmbeddedPhpUnitTest.4.inc
[edit]
[-] EmbeddedPhpUnitTest.19.inc.fixed
[edit]
[+]
..
[-] DisallowInlineIfUnitTest.inc
[edit]
[-] EmbeddedPhpUnitTest.12.inc
[edit]
[-] EmbeddedPhpUnitTest.21.inc
[edit]
[-] DisallowMultipleAssignmentsUnitTest.1.inc
[edit]
[-] EmbeddedPhpUnitTest.15.inc
[edit]
[-] NonExecutableCodeUnitTest.php
[edit]
[-] NonExecutableCodeUnitTest.2.inc
[edit]
[-] GlobalKeywordUnitTest.inc
[edit]
[-] EmbeddedPhpUnitTest.5.inc.fixed
[edit]
[-] EmbeddedPhpUnitTest.4.inc.fixed
[edit]
[-] CommentedOutCodeUnitTest.php
[edit]
[-] EmbeddedPhpUnitTest.18.inc.fixed
[edit]
[-] LowercasePHPFunctionsUnitTest.inc.fixed
[edit]
[-] EmbeddedPhpUnitTest.2.inc.fixed
[edit]
[-] DisallowInlineIfUnitTest.js
[edit]
[-] NonExecutableCodeUnitTest.4.inc
[edit]
[-] DisallowComparisonAssignmentUnitTest.inc
[edit]
[-] EmbeddedPhpUnitTest.18.inc
[edit]
[-] LowercasePHPFunctionsUnitTest.inc
[edit]
[-] HeredocUnitTest.1.inc
[edit]
[-] EmbeddedPhpUnitTest.23.inc
[edit]
[-] EmbeddedPhpUnitTest.3.inc
[edit]
[-] DisallowSizeFunctionsInLoopsUnitTest.js
[edit]
[-] EmbeddedPhpUnitTest.10.inc
[edit]
[-] EmbeddedPhpUnitTest.21.inc.fixed
[edit]
[-] EmbeddedPhpUnitTest.13.inc
[edit]
[-] EmbeddedPhpUnitTest.5.inc
[edit]
[-] NonExecutableCodeUnitTest.3.inc
[edit]
[-] DiscouragedFunctionsUnitTest.php
[edit]
[-] GlobalKeywordUnitTest.php
[edit]
[-] InnerFunctionsUnitTest.inc
[edit]
[-] EmbeddedPhpUnitTest.php
[edit]
[-] NonExecutableCodeUnitTest.1.inc
[edit]
[-] EmbeddedPhpUnitTest.25.inc.fixed
[edit]
[-] EmbeddedPhpUnitTest.14.inc
[edit]
[-] EmbeddedPhpUnitTest.13.inc.fixed
[edit]
[-] EmbeddedPhpUnitTest.22.inc.fixed
[edit]
[-] CommentedOutCodeUnitTest.inc
[edit]
[-] EmbeddedPhpUnitTest.20.inc
[edit]
[-] EmbeddedPhpUnitTest.7.inc
[edit]
[-] EmbeddedPhpUnitTest.11.inc
[edit]
[-] EvalUnitTest.php
[edit]
[-] DisallowMultipleAssignmentsUnitTest.2.inc
[edit]
[-] EmbeddedPhpUnitTest.19.inc
[edit]
[-] DiscouragedFunctionsUnitTest.inc
[edit]
[-] EmbeddedPhpUnitTest.12.inc.fixed
[edit]
[-] EmbeddedPhpUnitTest.9.inc
[edit]
[-] DisallowSizeFunctionsInLoopsUnitTest.inc
[edit]
[-] EmbeddedPhpUnitTest.8.inc
[edit]
[-] EmbeddedPhpUnitTest.16.inc
[edit]
[-] EmbeddedPhpUnitTest.20.inc.fixed
[edit]
[-] EmbeddedPhpUnitTest.24.inc.fixed
[edit]
[-] LowercasePHPFunctionsUnitTest.php
[edit]
[-] InnerFunctionsUnitTest.php
[edit]
[-] EmbeddedPhpUnitTest.25.inc
[edit]
[-] HeredocUnitTest.2.inc
[edit]
[-] EmbeddedPhpUnitTest.1.inc
[edit]
[-] EmbeddedPhpUnitTest.17.inc
[edit]
[-] EvalUnitTest.inc
[edit]
[-] EmbeddedPhpUnitTest.1.inc.fixed
[edit]
[-] CommentedOutCodeUnitTest.css
[edit]
[-] EmbeddedPhpUnitTest.24.inc
[edit]
[-] EmbeddedPhpUnitTest.2.inc
[edit]
[-] DisallowBooleanStatementUnitTest.php
[edit]