|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2020-04-20 03:07 UTC] requinix@php.net
-Summary: zend_compile_assign
+Summary: Modifying and evaluating a variable in the same
expression
-Status: Open
+Status: Not a bug
-Package: *Compile Issues
+Package: *General Issues
[2020-04-20 03:07 UTC] requinix@php.net
[2020-04-20 03:22 UTC] maple_ at outlook dot com
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Wed Oct 29 05:00:01 2025 UTC |
Description: ------------ The following two pieces of code have the same output. i want to know is that the correct feature of php or something? Test script: --------------- $b=1; $a=array(1=>"maple"); $a[$b+1]=$b=2; var_dump($a); $b=1; $a=array(1=>"maple"); $a[$b]=$b=2; var_dump($a); Expected result: ---------------- array(2) { [1]=> string(5) "maple" [3]=> int(2) } array(2) { [1]=> string(5) "maple" [2]=> int(2) } Actual result: -------------- array(2) { [1]=> string(5) "maple" [2]=> int(2) } array(2) { [1]=> string(5) "maple" [2]=> int(2) }