<?php
enum ArrayKeys { case IncludeAll; }
$array = [
'empty' => '',
'enum' => ArrayKeys::IncludeAll,
'zero' => 0,
'one' => 1,
'null' => null,
'false' => false,
'true' => true,
];
var_export(array_keys($array, ArrayKeys::IncludeAll));
- Output for 8.1.0 - 8.1.33, 8.2.0 - 8.2.29, 8.3.5 - 8.3.25, 8.4.1 - 8.4.12
- array (
0 => 'enum',
)
- Output for 8.0.1 - 8.0.29
- Parse error: syntax error, unexpected identifier "ArrayKeys" in /in/5Br1a on line 3
Process exited with code 255.
preferences:
65.14 ms | 407 KiB | 5 Q