"") {
$test = true;
} else {
$test = true;
}
}
?>
some text
function ($a) {
if ($a === true) {
echo 'hi';
}
}
];
$list = [
'fn' => function ($a) {
if ($a === true) {
echo 'hi';
}
}
];
if ($foo) {
foreach ($bar as $baz) {
if ($baz) {
?>
1) {
echo '1';
}
?>
1) {
echo '1';
}
?>
1) {
echo '1';
}
?>
= CHtml::encode($this->pageTitle); ?>
expects($this->at(2))
->with($this->callback(
function ($subject)
{
}
)
);
/** @var Database $mockedDatabase */
/** @var Container $mockedContainer */
echo $string->append('foo')
->appaend('bar')
->appaend('baz')
->outputUsing(
function ()
{
}
);
echo PHP_EOL;
switch ($arg) {
case 1:
break;
case 2:
if ($arg2 == 'foo') {
}
case 3:
default:
echo 'default';
}
if ($tokens[$stackPtr]['content']{0} === '#') {
} else if ($tokens[$stackPtr]['content']{0} === '/'
&& $tokens[$stackPtr]['content']{1} === '/'
) {
}
$var = call_user_func(
function() {
if ($foo) {
$new_var = function() {
if ($a > 0) {
return $a++;
} else {
return $a--;
}
}
}
}
);
a(
function() {
$a = function() {
$b = false;
};
true
}
);
$var = [
[
'1' =>
function () {
return true;
},
],
[
'1' =>
function () {
return true;
},
'2' => true,
]
];
if ($foo) {
?>
self::_replaceKeywords($failingComment, $result),
'screenshot' => Test::getScreenshotPath(
$projectid,
$result['class_name'],
),
);
}
$this->mockedDatabase
->with(
$this->callback(
function () {
return;
}
)
);
$this->subject->recordLogin();
function a()
{
if (true) {
static::$a[$b] =
static::where($c)
->where($c)
->where(
function ($d) {
$d->whereNull();
$d->orWhere();
}
)
->first();
if (static::$a[$b] === null) {
static::$a[$b] = new static(
array(
'a' => $a->id,
'a' => $a->id,
)
);
}
}
return static::$a[$b];
}
$foo->load(
array(
'bar' => function ($baz) {
$baz->call();
}
)
);
hello();
$foo = array_unique(
array_map(
function ($entry) {
return $entry * 2;
},
array()
)
);
bar($foo);
class PHP_CodeSniffer_Tokenizers_JS
{
public $scopeOpeners = array(
T_CASE => array(
'end' => array(
T_BREAK => T_BREAK,
T_RETURN => T_RETURN,
),
'strict' => true,
),
);
}
echo $string->
append('foo')->
appaend('bar')->
appaend('baz')->
outputUsing(
function ()
{
}
);
$str = 'the items I want to show are: ' .
implode(
', ',
array('a', 'b', 'c')
);
echo $str;
$str = 'foo'
. '1'
. '2';
echo $str;
bar([
'foo' => foo(function () {
return 'foo';
})
]);
$domains = array_unique(
array_map(
function ($url) {
$urlObject = new \Purl\Url($url);
return $urlObject->registerableDomain;
},
$sites
)
);
return $domains;
if ($a == 5) :
echo "a equals 5";
echo "...";
elseif ($a == 6) :
echo "a equals 6";
echo "!!!";
else :
echo "a is neither 5 nor 6";
endif;
if ($foo):
if ($bar) $foo = 1;
elseif ($baz) $foo = 2;
endif;
$this
->method(array(
'foo' => 'bar',
), 'arg', array(
'foo' => 'bar',
));
class Foo
{
use Bar {
myMethod as renamedMethod;
}
}
class Foo
{
use Bar {
myMethod as renamedMethod;
}
}
foo();
array(
'key1' => function ($bar) {
return $bar;
},
'key2' => function ($foo) {
return $foo;
},
);
?>
1,
];
$c = 2;
class foo
{
public function get()
{
$foo = ['b' => 'c',
'd' => [
['e' => 'f']
]];
echo '42';
$foo = array('b' => 'c',
'd' => array(
array('e' => 'f')
));
echo '42';
}
}
switch ($foo) {
case 1:
return array();
case 2:
return '';
case 3:
return $function();
case 4:
return $functionCall($param[0]);
case 5:
return array() + array(); // Array Merge
case 6:
// String connect
return $functionReturningString('') . $functionReturningString(array());
case 7:
return functionCall(
$withMultiLineParam[0],
array(),
$functionReturningString(
$withMultiLineParam[1]
)
);
case 8:
return $param[0][0];
}
class Test {
public
$foo
,$bar
,$baz = [ ]
;
public function wtfindent() {
}
}
switch ($x) {
case 1:
return [1];
default:
return [2];
}
switch ($foo) {
case self::FOO:
return $this->bar($gfoo, function ($id) {
return FOO::bar($id);
}, $values);
case self::BAR:
$values = $this->bar($foo, $values);
break;
}
$var = array(
'long description' =>
array(0, 'something'),
'another long description' =>
array(1, "something else")
);
$services = array(
'service 1' =>
Mockery::mock('class 1')
->shouldReceive('setFilter')->once()
->shouldReceive('getNbResults')->atLeast()->once()
->shouldReceive('getSlice')->once()->andReturn(array())
->getMock(),
'service 2' =>
Mockery::mock('class 2')
->shouldReceive('__invoke')->once()
->getMock()
);
class Foo
{
public function setUp()
{
$this->foo = new class {
public $name = 'Some value';
};
}
}
try {
foo();
} catch (\Exception $e) {
$foo = function() {
return 'foo';
}
if (true) {
}
}
if ($foo) {
foo();
} else if (\Exception $e) {
$foo = function() {
return 'foo';
}
if (true) {
}
} else {
$foo = function() {
return 'foo';
}
if (true) {
}
}
switch ($parameter) {
case null:
return [
'foo' => in_array(
'foo',
[]
),
];
default:
return [];
}
class SomeClass
{
public function someFunc()
{
a(function () {
echo "a";
})->b(function () {
echo "b";
});
if (true) {
echo "c";
}
echo "d";
}
}
$params = self::validate_parameters(self::read_competency_framework_parameters(),
array(
'id' => $id,
));
$framework = api::read_framework($params['id']);
self::validate_context($framework->get_context());
$output = $PAGE->get_renderer('tool_lp');
class Test123
{
protected static
$prop1 = [
'testA' => 123,
],
$prop2 = [
'testB' => 456,
],
protected static
$prop3 = array(
'testA' => 123,
),
$prop4 = array(
'testB' => 456,
),
protected static $prop5;
}
$foo = foo(
function () {
$foo->debug(
$a,
$b
);
if ($a) {
$b = $a;
}
}
);
if (somethingIsTrue()) {
?>
bar(foo(function () {
}), foo(function () {
}));
echo 'foo';
class Test {
public function a() {
?>adebug(
$a,
$b
);
if ($a) {
$b = $a;
}
}
);
function test()
{
$array = [];
foreach ($array as $data) {
[
'key1' => $var1,
'key2' => $var2,
] = $data;
foreach ($var1 as $method) {
echo $method . $var2;
}
}
}
switch ($a) {
case 0:
function () {
};
case 1:
break;
}
class Test
{
public function __construct()
{
if (false) {
echo 0;
}
}
}
return [
'veryLongKeySoIWantToMakeALineBreak'
=> 'veryLonValueSoIWantToMakeALineBreak',
'someOtherKey' => [
'someValue'
],
'arrayWithArraysInThere' => [
['Value1', 'Value1']
],
];
switch ($sContext) {
case 'SOMETHING':
case 'CONSTANT':
do_something();
break;
case 'GLOBAL':
case 'GLOBAL1':
do_something();
// Fall through
default:
{
do_something();
}
}
array_map(
static function ( $item ) {
echo $item;
},
$some_array
);
/**
* Comment.
*/
(function () use ($app) {
echo 'hi';
})();
$app->run();
public function foo()
{
$foo('some
long description', function () {
});
$foo('some
long
description', function () {
});
$foo(
'some long description', function () {
});
}
function foo()
{
$foo = array(
);
if ($foo) {
echo 'foo';
}
return false;
}
?>