-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtest.php
More file actions
59 lines (49 loc) · 1.09 KB
/
test.php
File metadata and controls
59 lines (49 loc) · 1.09 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
<?php
$array = [
'int' => 123,
'float' => 123.4,
'string' => "string",
'bool' => true,
'more' => [
'int' => 123,
'float' => 123.4,
'string' => "string",
'bool' => true,
],
];
$a = 2;
$foo = $a;
$foo = $array;
$bar = $foo;
(new Foo(true, "foo"))->method3();
call_function("hello");
for ($i = 0; $i < 100; $i++) {
fwrite(STDOUT, $i . ": Hello World!".PHP_EOL);
fwrite(STDERR, $i . ': Goodbye Cruiel World!'.PHP_EOL);
}
echo "Bar";
function call_function(string $hello) {
$var = 123;
$obj = new Foo(false, 'good day');
another_function($hello);
another_function($hello);
another_function($hello);
}
function another_function(string $goodbye) {
echo $goodbye;
foreach (['one', 'two', 'three', 'four'] as $number) {
if ($number === 'one') {
echo "number";
}
echo $number;
}
}
class Foo {
public function __construct(public bool $true, public string $bar) {}
public function method1() {
}
public function method2() {
}
public function method3() {
}
}