Created
September 10, 2023 18:37
-
-
Save ryangjchandler/6d2e864112732b97508b3fc918da0fbd to your computer and use it in GitHub Desktop.
Syntax Highlighting Kitchen Sink
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
namespace Sample; | |
class SampleClass implements SampleInterface | |
{ | |
public string $public; | |
protected SampleClass $protected; | |
private SampleClass $private; | |
public static string $static; | |
public function __construct() | |
{ | |
// | |
} | |
public function sampleSample() | |
{ | |
} | |
final public static function sample(string $sample): void | |
{ | |
} | |
} | |
interface SampleInterface | |
{ | |
public function __construct() | |
{ | |
// | |
} | |
} | |
enum SampleEnum: int | |
{ | |
case Sample = 0; | |
} | |
function sample() | |
{ | |
} | |
if (true) { | |
} elseif (false) { | |
} else { | |
} | |
foreach ([] as $foo => $bar) { | |
} | |
for ($i = 0; $i < 10; $i += 1) { | |
} | |
while (true) { | |
} | |
do { | |
} while (true); | |
$numbers = [1, 2, 3, 4, 5]; | |
$string = 'Hello!'; | |
$true = true; | |
$false = false; | |
$null = null; | |
const SAMPLE = 'sample'; | |
sample(); | |
match (true) { | |
sample() => null, | |
default => SAMPLE, | |
}; | |
switch (sample()) { | |
case SAMPLE: | |
break; | |
case sample(): | |
break; | |
default: | |
break; | |
} | |
$string = '<span></span>'; | |
$object = new SampleClass(); | |
$object->public; | |
$object->sampleSample(); | |
SampleClass::$static; | |
SampleClass::sample(sample: SAMPLE); | |
?> | |
<h1> | |
Hello, world! | |
</h1> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello, I saw your tweet and here's a file from a project I'm currently working on. It's written in Typescript.