<?php
$i = 10;
$a = $i++;
// Now $a is 10, and $i is 11
$i = 10;
$a = ++$i;
// Now $a is 11, and $i is 11
# There is sometimes a slight preformance cost for using $i++. See, when you do something like
$a = $i++;
# You're really doing this:
$temporary_variable = $i;
$i = $i+1;
$a = $temporary_variable;
Last active
June 28, 2018 09:39
-
-
Save houssemz/6f06b847380a74faa46d9f462bd7c991 to your computer and use it in GitHub Desktop.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment