Interview Questions Answers.ORG
Interviewer And Interviewee Guide
Interviews
Quizzes
Home
Quizzes
Interviews Coding/Programming Interviews:Active Template Library (ATL)ActiveXApplication DeveloperArtificial intelligenceAssemblyAssociate Software EngineerAWKAWTC ProgrammingC++ ProgrammingCGI PerlCGI ProgrammingCMMICobolCritical ReasoningData Structures TreesDCOM COMDelphiDTDE4XExtensible Stylesheet Language (XSL)FortranFull-Stack DeveloperHaskellHTML DOMILUIPhone DeveloperJasper Reports DeveloperJava DeveloperLisp ProgrammingLotus NotesMicrosoft Foundation Class (MFC)Mobile DeveloperMVC DeveloperNode.jsOOPPascalPerl ProgrammingPHPPHP DeveloperProgrammingProgramming AlgorithmsProgramming ConceptsPythonRubyRuby on RailsRuby on Rails DeveloperSenior Front End DeveloperSenior Software DeveloperSignature ProgramSOASocket ProgrammingSoftware Development EngineerSoftware engineeringSr. PHP ProgrammerStack And QueueSTLSwift DeveloperTCL (Tool Command Language)Team Leader Android DeveloperUMLUnity 2D Games DeveloperUnity 3D DeveloperUnity DeveloperVBA (Visual Basic for Applications)Visual Basic (VB)Visual C++Web DevelopmentWin32APIWindows ProgramingWordPress DevelopmentWSDLXFormsXHTMLXLinkXMLXPathXQueryXSL-FOXSLT
Copyright © 2018. All Rights Reserved
Sr. PHP Programmer Interview Question:
What are the rules for determine the "truth" of any value not already of the Boolean type?
Submitted by: AdministratorHere are the rules for determine the "truth" of any value not already of the Boolean type −
☛ If the value is a number, it is false if exactly equal to zero and true otherwise.
☛ If the value is a string, it is false if the string is empty (has zero characters) or is the string "0", and is true otherwise.
☛ Values of type NULL are always false.
☛ If the value is an array, it is false if it contains no other values, and it is true otherwise. For an object, containing a value means having a member variable that has been assigned a value.
☛ Valid resources are true (although some functions that return resources when they are successful will return FALSE when unsuccessful).
☛ Don't use double as Booleans.
Submitted by:
☛ If the value is a number, it is false if exactly equal to zero and true otherwise.
☛ If the value is a string, it is false if the string is empty (has zero characters) or is the string "0", and is true otherwise.
☛ Values of type NULL are always false.
☛ If the value is an array, it is false if it contains no other values, and it is true otherwise. For an object, containing a value means having a member variable that has been assigned a value.
☛ Valid resources are true (although some functions that return resources when they are successful will return FALSE when unsuccessful).
☛ Don't use double as Booleans.
Submitted by:
Copyright 2007-2024 by Interview Questions Answers .ORG All Rights Reserved.
https://InterviewQuestionsAnswers.ORG.
https://InterviewQuestionsAnswers.ORG.