Home  >  Q&A  >  body text

How do you calculate $cup to be equal to 13 by computer calculation?

$cup Computer calculation is equal to 13. How to calculate it?

phpcn_u11218phpcn_u112182669 days ago1505

reply all(2)I'll reply

  • MOMO

    MOMO2017-08-17 23:31:08

    <?php


    $x = 5;


    $y = ++$x;

    $z = $x + $y;

    echo "{$z} </ br>";

    echo "{$x} </br>";

    echo $y;

    ?>

    //You will get a plus sign for $y = ++$x; this code Change to the front and change to the back. Watch for changes. You will understand after thinking about it a few times

    reply
    0
  • PHP中文网

    PHP中文网2017-07-24 09:16:17

    <?php
    $x = 5;
    $y = 6;
    $foo = $x++ + $x--; //$x和$y不变
    $bar = ++$y + ++$x; //$x=6 $y=7
    $cup = $x-- + $y--; //$x和$y不变   6+7=13


    reply
    0
  • Cancelreply