<?php
$a="";
$a["1"]="";
$a["0"]="zzz";
var_dump($a);
echo "PHP:".phpversion();
?>
< H2 > results 001 version 7.0 < / H2 >
array(2) {
[1]=>
string(9) ""
[0]=>
string(3) "zzz"
}
PHP:7.0.0-dev
< H2 > Code 002 5.6 version < / H2 >
<?php
$a="";
$a["1"]="";
$a["0"]="zzz";
var_dump($a);
echo "PHP:".phpversion();
?>
< H2 > results 002 5.6 < / H2 >
array(2) {
[1]=>
string(9) ""
[0]=>
string(3) "zzz"
}
PHP:5.6.9-0+deb8u1
< H2 > Code 003 7.2 version < / H2 >
<?php
echo PHP_VERSION;
try {
$a = "";
// $a->a();
$a["1"] = "";
$a["0"] = "zzz";
var_dump($a);
} catch (Exception $e) {
var_dump($e->getMessage());
} catch (Error $Error) {
var_dump($Error->getMessage());
return;
} catch (ParseError $e) {
echo 123;
var_dump($Error->getMessage());
} finally {
echo "end";
}
< H2 > 7.2.3 results < / H2 >
7.2.3string(2) "z" end
< H2 > question < / H2 >
7.2 Why is this type conversion not supported internally, and where can I see the specific changes? Kernel code is also fine. .
< H2 > Test address: < / H2 >