Skip to content

Commit 9d79d01

Browse files
committed
[Delete] Add some "mistakes" to check that PHPCompatability catches those
1 parent 2357c0c commit 9d79d01

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

judge/judgedaemon.second.php

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
<?php declare(strict_types=1);
2+
3+
$result = "Hello World"
4+
|> strtoupper(...)
5+
|> str_shuffle(...)
6+
|> trim(...);
7+
8+
interface I {
9+
// We may naively assume that the PHP constant is always a string.
10+
const PHP = 'PHP 8.2';
11+
}
12+
13+
class Foo implements I {
14+
// But implementing classes may define it as an array.
15+
const PHP = [];
16+
}
17+
18+
class Foo2 {
19+
const PHP = 'PHP 8.3';
20+
}
21+
22+
$searchableConstant = 'PHP';
23+
24+
var_dump(json_validate('{ "test": { "foo": "bar" } }')); // true
25+
var_dump(Foo2::{$searchableConstant});

0 commit comments

Comments
 (0)