Created
September 2, 2020 16:23
-
-
Save derickr/11dade87d7d9ec65d7529b9e5b99b627 to your computer and use it in GitHub Desktop.
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 | |
function a() | |
{ | |
$maybe = 1; | |
$a = match($maybe) { | |
1 => "one", | |
2 => "twee", | |
default => "three", | |
}; | |
return $a; | |
} | |
$result = a(); |
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
function name: a | |
number of ops: 16 | |
compiled vars: !0 = $maybe, !1 = $a | |
line #* E I O op fetch ext return operands | |
------------------------------------------------------------------------------------- | |
2 0 E > EXT_NOP | |
4 1 EXT_STMT | |
2 ASSIGN !0, 1 | |
6 3 EXT_STMT | |
4 > MATCH !0, [ 1:->5, 2:->7, ] | |
7 5 > QM_ASSIGN ~4 'one' | |
6 > JMP ->11 | |
8 7 > QM_ASSIGN ~4 'twee' | |
8 > JMP ->11 | |
9 9 > QM_ASSIGN ~4 'three' | |
10 > JMP ->11 | |
11 > ASSIGN !1, ~4 | |
12 12 EXT_STMT | |
13 > RETURN !1 | |
13 14* EXT_STMT | |
15* > RETURN null | |
branch: # 0; line: 2- 6; sop: 0; eop: 4; out0: 5; out1: 7; out2: 9 | |
branch: # 5; line: 7- 7; sop: 5; eop: 6; out0: 11 | |
branch: # 7; line: 8- 8; sop: 7; eop: 8; out0: 11 | |
branch: # 9; line: 9- 9; sop: 9; eop: 10; out0: 11 | |
branch: # 11; line: 9- 13; sop: 11; eop: 15 | |
path #1: 0, 5, 11, | |
path #2: 0, 7, 11, | |
path #3: 0, 9, 11, | |
End of function a |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment