[Phpmyadmin-devel] a PHP 5.1.2 bug?
Marc.Delisle at cegepsherbrooke.qc.ca
Fri Jan 13 05:15:03 CET 2006
Sebastian Mendel a écrit :
> Garvin Hicking schrieb:
>>>Look at this sample code:
>>>$the_query = "INSERT INTO `aaa` (`f1`, `f2`) VALUES ('1', 'aaa')";
>>>preg_match('@INSERT\sINTO\s\`([^\`]+)\`@iu', $the_query, $error_table = array()
>>It surprises me that this has ever worked :)
> me not!
> it is more than logical that this should work, as = is always evaluated
>>I guess that PHP 5.1.2 has a different way of evaluating/processing the order of
>>the array assignment. But the way of specifieing an assignment within a function
>>call is something I've never seen before, and also looks a bit
>>So you might want to ask how this problem came, but I'm pretty sure the answer
>>will be "It was never meant to work, so you shouldn't have relied on it. We
>>fixed this because of memory corruption issues" ;-)
> i don't think so.
> whats the difference between
> function( anotherFunction() );
> function( $var = 'value' );
> why should this not work?
> for example in C i often see this to clarify parameters
> function(true, false, true);
> function($use_utf8 = true, $return = false, $escape = true);
> what do you think is easier to read? and why should this not work in PHP?
Please do not draw too general conclusions about what I wrote. This
example works in PHP 5.1.2:
$error_table = array();
$the_query = "INSERT INTO `aaa` (`f1`, `f2`) VALUES ('1', 'aaa')",
I was just talking about using
$error_table = array()
as a function argument.
Anyway, I could not find this syntax in the doc. If you can't find it in
the doc either, then this would be a PHP feature request :)
More information about the Developers