+ 3

I wonder. Since we don't need to declare a variable, does this mean that a variable which first I assign a numeric value can be assigned later with, for example, string value?

2nd Mar 2016, 4:41 AM
Ade Kurniawan
Ade Kurniawan - avatar
8 Answers
+ 1
yes
28th Mar 2016, 5:51 PM
Redet Getachew
Redet Getachew - avatar
+ 1
Dending on how you use it PHP will rec!at the variable automatically. So a string of "3" might end up becoming a number if used in an assignment.
1st Jan 2017, 6:52 PM
Adrian
Adrian - avatar
+ 1
Yess Exactly True
2nd Jan 2017, 7:24 AM
Anshul Shivhare
Anshul Shivhare - avatar
0
yes
26th Mar 2016, 10:49 AM
Asa Tavor
Asa Tavor - avatar
0
Yes!!
9th Apr 2016, 10:36 PM
Adesina Oluwaseun
Adesina Oluwaseun - avatar
0
yes, you can assign the variable later in your program.
14th Apr 2016, 9:02 AM
Naveen Kumar K
Naveen Kumar K - avatar
0
ye
22nd Dec 2016, 4:28 AM
Abdul wahab Laghari
Abdul wahab Laghari - avatar
0
Probably not recommended though. Imag8ne how confusing a large project would get with variable types changing all the time.
8th Jan 2017, 7:03 PM
Adrian
Adrian - avatar