It's a problem with the documentation not the code. The public argument is not just shorthand for the other four arguments; it can act as such if they aren't set themselves, but it is also saved and it can be used as an argument with get_post_types(). Just set public to something in addition to the other four.
As a side note, try coding some HTML forms to pass inputs to WP functions and compare the amount of work and debugging to coding forms for other CMS's...
I have. Checking variable types in addition to values is a choice not a bug. There are both benefits and issues with this.
Edit:
The public argument is by default set to false. This:
$args = array(
'publicly_queriable' => true,
'show_ui' => true,
'show_in_nav_menus' => true,
'exclude_from_search' => false
);
register_post_type( 'my_custom_post_type', $args );
is the same as this:
$args = array(
'public' => false,
'publicly_queriable' => true,
'show_ui' => true,
'show_in_nav_menus' => true,
'exclude_from_search' => false
);
register_post_type( 'my_custom_post_type', $args );
Which obviously makes this return nothing, since it's specifically checking for what public is set to:
$pts = get_post_types( array( 'public'=>true, '_builtin'=>false ) );
What you're seeing is not a bug.
To do what you're looking to do, use:
$args = array(
'public' => true,
);
register_post_type( 'my_custom_post_type', $args );
or, if you really want to:
$args = array(
'public' => true,
'publicly_queriable' => true,
'show_ui' => true,
'show_in_nav_menus' => true,
'exclude_from_search' => false
);
register_post_type( 'my_custom_post_type', $args );