PHP 8.5.0 Alpha 1 available for testing

Voting

: max(eight, two)?
(Example: nine)

The Note You're Voting On

kerosuppi
20 years ago
This does not work as expected.

<?php
class someclass
{
var
$query_string;
function
someclass($a_query_string)
{
$this->query_string = $a_query_string;
parse_str($this->query_string);
}
function
output()
{
echo
$this->action;
}
}

$a_class = new someclass("action=go");
$a_class->output();
?>

Use this instead.

<?php
class someclass
{
var
$arr;
function
someclass($a_query_string)
{
parse_str($a_query_string, $this->arr);
}
function
output()
{
echo
$this->arr['action'];
}
}

$a_class = new someclass("action=go");
$a_class->output();
?>

<< Back to user notes page

To Top