what is ++ operator? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

what is ++ operator?

i cannot understand $x++

29th Aug 2016, 1:58 PM
NepZ
NepZ - avatar
15 Answers
+ 7
$x++ is same as $x = $x + 1 so it increases the value of $x by one.
29th Aug 2016, 4:18 PM
Celal Aybar
Celal Aybar - avatar
+ 4
increment operator $s++; is same to $s=$s+1;
1st Oct 2016, 1:18 AM
Alpha Oumar Pathé BAH
Alpha Oumar Pathé BAH - avatar
+ 2
number + 1
29th Aug 2016, 10:14 PM
sina massoumian
sina massoumian - avatar
+ 2
++ is a incriment operator which means plus 1 value to it 1++ is same as 1+1
4th Sep 2016, 11:22 AM
keshav sharma
keshav sharma - avatar
+ 2
it is just +1
11th Sep 2016, 5:53 PM
ELECTR0ZED
+ 2
$x++ means value of x is post incremented first and then the next value is stored in memory and on next iteration it prints correct value of it.
12th Oct 2016, 5:33 PM
Tanmay Sonna
Tanmay Sonna - avatar
+ 2
postfix increment
30th Jun 2017, 5:02 AM
Abhishek Regmi
Abhishek Regmi - avatar
+ 2
increment operator i=1 i++ then i=2
21st Jul 2020, 2:13 PM
Md Yousuf Gani
Md Yousuf Gani - avatar
+ 1
++ is an increment operator.. the value of the specified function is increased by 1
29th Aug 2016, 6:34 PM
Gitartha
Gitartha - avatar
+ 1
$x=2; if u write $x++; it means $x=$x+1; it means $x=2+1; the second + is 1 by default
31st Aug 2016, 4:59 AM
Vijay Kumar
Vijay Kumar - avatar
+ 1
it is used to increment a variable $i++; means value of variable i is increased by one
28th Sep 2016, 12:54 PM
ANAND S
ANAND S - avatar
+ 1
increment operator $s++; is same to $s=$s+1;
1st Oct 2016, 1:17 AM
Alpha Oumar Pathé BAH
Alpha Oumar Pathé BAH - avatar
+ 1
it is the increment operator
27th Oct 2016, 4:54 AM
Chandan Bhole
Chandan Bhole - avatar
+ 1
Think of the ++ as a cheat code for extra lives in an old nes game. It will add +1 to a variable (your life stock) until it meets the conditions (you forget to turn on gameshark)
28th Oct 2016, 7:03 AM
Yokohama
Yokohama - avatar
0
when $x=10; $y=50; $z=30; echo $z //what is output come and how
3rd Sep 2016, 7:15 AM
Ashish kumar
Ashish kumar - avatar