php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #65380 Unable to post note to manual documentation page
Submitted: 2013-08-02 14:57 UTC Modified: 2013-10-11 00:54 UTC
From: cgray at metamedia dot us Assigned:
Status: Not a bug Package: Website problem
PHP Version: Irrelevant OS: n/a
Private report: No CVE-ID: None
 [2013-08-02 14:57 UTC] cgray at metamedia dot us
Description:
------------
Attempted to post a note multiple times to page: 
http://php.net/manual/en/language.variables.variable.php but always fail spam 
test.

Bottom of page: "This mirror generously provided by: Yahoo! Inc."

I would like to contribute and payback help I have found via article notes by 
others.


Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2013-08-03 07:02 UTC] googleguy@php.net
-Status: Open +Status: Feedback
 [2013-08-03 07:02 UTC] googleguy@php.net
I'm not sure I'm clear on the parameters of the bug you're trying to report. Are 
you saying you attempted to submit to the user contributed notes and received a 
spam error? Can you provide the note you attempted to submit and email you used 
(if any)? There are certain things that can trigger the spam filter and yours may 
have gotten caught there.
 [2013-08-05 13:24 UTC] cgray at metamedia dot us
-Status: Feedback +Status: Open
 [2013-08-05 13:24 UTC] cgray at metamedia dot us
Yes, you understanding of the report is correct.
Using my email address @metamedia.us

Below is what I was attempting to post.
thanks
-c!
-----

Returning values from a multidimensional array based using variable variables 
and infinite key depth

I banged my head against this but could not find a way in language structure or 
in functions to retreive a value from a multidimensional array where the key 
path is known as a variable string. I considered some sort of recursive 
function, but it seemed cumbersome for what should be a one-liner.

My solution uses eval() to return the array value:

<?php

$geolocation = array("ip"=>"127.0.0.1", "location" => array("city" => 
"Knoxville", "state_province" => "TN", "country" => "USA"));

print_r($geolocation); // Array ( [ip] => 127.0.0.1 [location] => Array ( [city] 
=> Knoxville [state_province] => TN [country] => USA ) )

// typical use of variable variables
$key = "ip";
$result = $geolocation[$key];
print_r($result); // 127.0.0.1

$key = "location"; // another typical use of variable variables
$result = $geolocation[$key];
print_r($result); // Array ( [city] => Knoxville [state_province] => TN 
[country] => USA )

// but how do we go deeper? this does NOT work
$key = "location['city']";
// $result = $geolocation[$key]; // Notice: Undefined index: location['city']
// print_r($result);

// this does NOT work
$key = "['location']['city']";
// $result = $geolocation{$key}; // Notice: Undefined index: ['location']
['city']
// print_r($result);

// this works:
$key = "['location']['city']";
$result = eval('echo $geolocation'."$key;");
print_r($result); // Knoxville

?>
 [2013-08-05 14:20 UTC] salathe@php.net
-Status: Open +Status: Feedback
 [2013-08-05 14:20 UTC] salathe@php.net
I successfully managed to submit the quoted text using your email address (whilst logged out from php.net) without 
issue.  See http://news.php.net/php.notes/195872

However, I did stumble once on the spam challenge... twice. It was like "min(three, eleven)" and I answered with a 
number "3" instead of the word "three".  Were you doing the same as I did?

If not, then the email/content of the note doesn't seem to prevent it from getting posted, which (barring the above 
user error) would make it look like a DNS blacklist issue. If this might be the case, could you provide your public-
facing IP address?
 [2013-08-05 14:28 UTC] cgray at metamedia dot us
-Status: Feedback +Status: Open
 [2013-08-05 14:28 UTC] cgray at metamedia dot us
I was entering numbers as my challenge response (did not see any direction to 
SPELL the numeric answers (?)). Am I being dim here?

Public IP: 67.187.112.122
 [2013-08-05 14:38 UTC] salathe@php.net
Only as dim as I was!  There is a hint, but it is out of the way (on larger 
screens).

See http://i.imgur.com/aSEGMcU.png
 [2013-08-05 14:52 UTC] cgray at metamedia dot us
OK, sorry for wasting your time.

Perhaps this should be a web site UI enhancement request.

Either accept numerical as well as spellings for answers, or make the expected 
response more explicit.

thanks!
 [2013-10-11 00:54 UTC] bjori@php.net
-Status: Open +Status: Not a bug
 [2013-10-11 00:54 UTC] bjori@php.net
Its intentionally vague. We want to make sure you've read the rules of engagement and the entire page clearly before adding user contributed content :)

This happens every once in a while for the best of us, but it helps weed out silly comments and rage flooding
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu Mar 28 13:01:28 2024 UTC