Y
Hacker News
new
|
ask
|
show
|
jobs
by
zackattack
5698 days ago
'z'++ is
not
'aa'. 'z'++ is not even valid PHP. $z='z';$p=$z++; does nothing either.
it's only in the for-loop context.
2 comments
Nitramp
5698 days ago
Not really, after $p = $z++ $p is 'z', $z is 'aa', as you'd kind-of expect. But the difference between literals and expressions/variable references of course just adds icing to the cake of bizareness.
link
rythie
5698 days ago
try...
<?php $z='z'; echo ++$z;
which produces 'aa'
link