Skip to content

Instantly share code, notes, and snippets.

@tmilewski
Created October 11, 2010 15:00
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tmilewski/620644 to your computer and use it in GitHub Desktop.
Save tmilewski/620644 to your computer and use it in GitHub Desktop.
$field_input_name always returns NULL. It doesn't get much simpler than this.
<?php
# Testing without inputs
function _xprofile_registration_display_field( $field_input_name = 'field_1' ) {
$fields = array(
'field_1' => true,
'field_10' => true,
'field_2' => true,
'field_4' => true,
'field_6' => false
);
var_dump($field_input_name); # Prints NULL - WTF?
return ( array_key_exists($field_input_name, $fields) ) ? $fields[$field_input_name] : false;
}
?>
@sholsinger
Copy link

var_dump always returns NULL, did you mean 'prints'? http://php.net/manual/en/function.var-dump.php

@tmilewski
Copy link
Author

I did mean print/echo/output.

Updated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment