PHP - Type Handling
Which of the following PHP expressions correctly adds a boolean true to an integer 2 and returns 3?
(int)'true' + 2: (int)'true' is 0 + 2 = 2 (wrong). 'true' + 2: 'true' converts to 0 + 2 = 2 (wrong). true . 2: concatenation '12' (wrong). true + 2: 1 + 2 = 3 (correct).15+ quiz questions · All difficulty levels · Free
Free Signup - Practice All Questions