SlideShare une entreprise Scribd logo
1  sur  6
Télécharger pour lire hors ligne
This copy is registered to Núria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain




                                          Practice Exam Questions


                 1. Which of the following strings are not valid modes for the       fopen()   function?
                     A. a+b
                     B. b+a
                       C.    at
                        D.   w
                        E.   x+

                 2. Consider the following piece of code:
                        <?php
                        $arr = array(3 => “First”, 2=>“Second“, 1=>“Third“);
                        list (, $result) = $arr;
                        ?>

                     After running it, the value of $result would be
                       A. First
                       B. Second
                       C. Third
                       D. This piece of code will not run, but fail with a parse error.

                 3. In standard SQL-92, which of these situations do not require or cannot be handled
                    through the use of an aggregate SQL function? (Choose 2)
                      A. Calculating the sum of all the values in a column.
                      B. Determining the minimum value in a result set.
                      C. Grouping the results of a query by one or more fields.
                      D. Calculating the sum of all values in a column and retrieving all the values of
                          another column that is not part of an aggregate function or GROUP BY clause.
                      E. Determining the mean average of a column in a group of rows.

                 4. Multidimensional arrays can be sorted using the ______ function.
This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain


    210       Practice Exam Questions


                 5. When using the default session handler files for using sessions, PHP stores
                    session information on the harddrive of the webserver.When are those session
                    files cleaned up?
                       A. PHP will delete the associated session file when session_destroy() is
                            called from within a script.
                       B. When the function session_cleanup() is called, PHP will iterate over all
                            session files, and delete them if they exceeded the session timeout limit.
                       C. When the function session_start() is called, PHP will iterate over all
                            session files, and delete them if they exceeded the session timeout limit.
                       D. When the function session_start() is called, PHP will sometimes iterate
                            over all session files, and delete them if they exceeded the session timeout
                            limit.
                       E. Session files are never removed from the filesystem, you need to use an auto-
                            mated script (such as a cronjob) to do this.

                 6. What is the order of parameters in the mail() function?
                     A. subject, to address, extra headers, body
                     B. to address, subject, extra headers, body
                     C. to address, subject, body, extra headers
                     D. subject, to address, body, extra headers

                 7. Which of the following statements are correct? (Choose 3)
                     A. sprintf() does not output the generated string.
                     B. printf(“%2s%1s“, “ab“, “c“) outputs the string abc.
                       C. vprintf() takes at least one parameter; the first parameter is the formatting
                          string and the following parameters are the arguments for the ‘%’
                          placeholders.
                       D. printf(“%c“, “64“) will output @ and not 6.
                       E. sprintf(“%3.4f“, $x) outputs more than 7 characters.
                       F. number_format() inserts thousands of separators and decimal points differ-
                          ent from (,) and (.) respectively, while printf() like functions always use
                          (.) as decimal point.
This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain


                                                                                      Practice Exam Questions     211


                 8. The requirement is to return true for the case in which a string $str contains
                    another string $substr after the first character of $str? Which of the following
                    will return true when string $str contains string $substr, but only after the first
                    character of $str?
                    I.
                           <?php
                                     function test($str, $substr) {
                                             return strpos(substr($str,1), $substr) >= 0;
                                     }
                           ?>

                     II.
                           <?php
                                     function test($str, $substr) {
                                             return strrchr($str, $substr) !== false;
                                     }
                           ?>

                     III.
                           <?php
                                     function test($str, $substr) {
                                             return strpos($str, $substr) > 0;
                                     }
                           ?>

                       A.       I only
                       B.       II only
                       C.       III only
                       D.       I and II
                       E.       I and III
                       F.       II and III

                 9. Which of the features listed below do not exist in PHP4? (Choose 2)
                     A. Exceptions
                     B. Preprocessor instructions
                     C. Control structures
                        D. Classes and objects
                        E. Constants
This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain


    212       Practice Exam Questions


               10. What is the output of the following code snippet?
                            <?php
                               class Vehicle {
                               }

                                 class Car extends Vehicle {
                                 }

                                 class Ferrari extends Car {
                                 }

                                 var_dump(get_parent_class(“Ferrari”));
                            ?>

                       A.   string(7) “Vehicle“
                       B.   string(3) “Car“
                       C.   array(2) {
                                             [0]=>
                                             string(7) “vehicle“
                                             [1]=>
                                             string(3) “car“
                                        }

               11. The following PHP script is designed to subtract two indexed arrays of numbers.
                   Which statement is correct?
                            <?php

                                 $a = array(5, 2, 2, 3);
                                 $b = array(5, 8, 1, 5);

                                 var_dump(subArrays($a, $b));

                                 function
                                 subArrays($arr1,
                                          $arr2)
                                 {
                                          $c = count($arr1);
                                          if
                                          ($c != count($arr2))
                                          return
                                 null;
This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain


                                                                                      Practice Exam Questions     213


                                 for($i = 0;
                                         $i < $c;
                                         $i++)

                                         $res[$i]
                                         $arr1[$i] - $arr2[$i];

                                 return $res;

                                 }
                            ?>

                       A.   The script is valid.
                       B.   Assignments must be made on a single line.
                       C.   It has too many linefeed characters between statements.
                       D.   No, the script is missing curly braces.
                       E.   Yes it is valid, but the script will not work as expected.

                12. What is the purpose of the escapeshellarg() function?
                     A. Removing malicious characters.
                     B. Escaping malicious characters.
                     C. Creating an array of arguments for a shell command.
                     D. Preparing data to be used as a single argument in a shell command.
                     E. None of the above.

                13. The _________ function can be used to determine if the contents of a string can
                    be interpreted as a number.
                14. Assume $comment contains a string.Which PHP statement prints out the first 20
                    characters of $comment followed by three dots (.)?
                      A. print substr($comment, 20) . ‘...‘;
                      B. print substr_replace($comment, ‘...‘, 20);
                      C. print substr($comment, 20, strlen($comment)) . ‘...‘;
                      D. print substr_replace($comment, 20, ‘...‘);

                15. What is the name of the function that you should use to put uploaded files into a
                    permanent location on your server?
                16. If you have a file handle for an opened file, use the __________ function to send
                    all data remaining to be read from that file handle to the output buffer.
This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain


    214       Practice Exam Questions


               17. Which of the following sentences are not true? (Choose 2)
                    A. strpos() allows searching for a substring in another string.
                    B. strrpos() allows searching for a substring in another string.
                    C. strpos() and strrchr() return -1 if the second parameter is not a sub-
                       string of the first parameter.
                         D. strpos() and strrpos() can return a value that is different from an integer.
                         E. The second parameter to substr() is the length of the substring to extract.
                         F. strstr() returns false if the substring specified by its second parameter is
                            not found in the first parameter.

               18. Which of the following sentences are correct? (Choose 2)
                    A. time() + 60*60*100 returns the current date and time plus one hour.
                    B. time() + 24*60*60 returns the current date and time plus one day.
                    C. time() + 24*60*60*100 returns the current date and time plus one day


              Answers
                1.   B
                2.   C
                3.   C and D
                4.   array_multisort      or   array_multisort()
                5.   D
                6.   C
                7.   A, D, and F
                8.   C
                9.   A and B
               10.   A
               11.   B
               12.   D
               13.   is_numeric    or   is_numeric()
               14.   B
               15. move_uploaded_file or move_uploaded_file()
               16. fpassthru or fpassthru()
               17. C and E
               18. B

Contenu connexe

Tendances (20)

jQuery
jQueryjQuery
jQuery
 
Php with MYSQL Database
Php with MYSQL DatabasePhp with MYSQL Database
Php with MYSQL Database
 
java Servlet technology
java Servlet technologyjava Servlet technology
java Servlet technology
 
PHP Cookies and Sessions
PHP Cookies and SessionsPHP Cookies and Sessions
PHP Cookies and Sessions
 
Java Server Pages
Java Server PagesJava Server Pages
Java Server Pages
 
Cookie and session
Cookie and sessionCookie and session
Cookie and session
 
PHP
PHPPHP
PHP
 
php
phpphp
php
 
JavaScript - Chapter 12 - Document Object Model
  JavaScript - Chapter 12 - Document Object Model  JavaScript - Chapter 12 - Document Object Model
JavaScript - Chapter 12 - Document Object Model
 
Php forms
Php formsPhp forms
Php forms
 
Abstract Class and Interface in PHP
Abstract Class and Interface in PHPAbstract Class and Interface in PHP
Abstract Class and Interface in PHP
 
Jsp ppt
Jsp pptJsp ppt
Jsp ppt
 
Sending emails through PHP
Sending emails through PHPSending emails through PHP
Sending emails through PHP
 
PHP Form Validation Technique
PHP Form Validation TechniquePHP Form Validation Technique
PHP Form Validation Technique
 
Web Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScriptWeb Development with HTML5, CSS3 & JavaScript
Web Development with HTML5, CSS3 & JavaScript
 
The Full Stack Web Development
The Full Stack Web DevelopmentThe Full Stack Web Development
The Full Stack Web Development
 
wamp.ppt
wamp.pptwamp.ppt
wamp.ppt
 
Java Servlets
Java ServletsJava Servlets
Java Servlets
 
Project Report on Employee Management System.docx
Project Report on Employee Management System.docxProject Report on Employee Management System.docx
Project Report on Employee Management System.docx
 
Class 5 - PHP Strings
Class 5 - PHP StringsClass 5 - PHP Strings
Class 5 - PHP Strings
 

En vedette

Top 100 PHP Interview Questions and Answers
Top 100 PHP Interview Questions and AnswersTop 100 PHP Interview Questions and Answers
Top 100 PHP Interview Questions and AnswersVineet Kumar Saini
 
PHP Technical Questions
PHP Technical QuestionsPHP Technical Questions
PHP Technical QuestionsPankaj Jha
 
Zend PHP 5.3 Demo Certification Test
Zend PHP 5.3 Demo Certification TestZend PHP 5.3 Demo Certification Test
Zend PHP 5.3 Demo Certification TestCarlos Buenosvinos
 
25 php interview questions – codementor
25 php interview questions – codementor25 php interview questions – codementor
25 php interview questions – codementorArc & Codementor
 
Zend Php Certification Study Guide
Zend Php Certification Study GuideZend Php Certification Study Guide
Zend Php Certification Study GuideKamalika Guha Roy
 
Questions and answers regarding white card
Questions and answers regarding white cardQuestions and answers regarding white card
Questions and answers regarding white cardrazzor56
 
Top 100 PHP Questions and Answers
Top 100 PHP Questions and AnswersTop 100 PHP Questions and Answers
Top 100 PHP Questions and Answersiimjobs and hirist
 
Useful functions for arrays in php
Useful functions for arrays in phpUseful functions for arrays in php
Useful functions for arrays in phpChetan Patel
 
Zend Certification Preparation Tutorial
Zend Certification Preparation TutorialZend Certification Preparation Tutorial
Zend Certification Preparation TutorialLorna Mitchell
 
Curso HTML5 - Temario
Curso HTML5 - TemarioCurso HTML5 - Temario
Curso HTML5 - Temariopastilla5
 
Top 100 .Net Interview Questions and Answer
Top 100 .Net Interview Questions and AnswerTop 100 .Net Interview Questions and Answer
Top 100 .Net Interview Questions and AnswerVineet Kumar Saini
 
Zend Certification PHP 5 Sample Questions
Zend Certification PHP 5 Sample QuestionsZend Certification PHP 5 Sample Questions
Zend Certification PHP 5 Sample QuestionsJagat Kothari
 
Your first 5 PHP design patterns - ThatConference 2012
Your first 5 PHP design patterns - ThatConference 2012Your first 5 PHP design patterns - ThatConference 2012
Your first 5 PHP design patterns - ThatConference 2012Aaron Saray
 
Introducción a HTML5 y CSS3 AWGR
Introducción a HTML5 y CSS3 AWGRIntroducción a HTML5 y CSS3 AWGR
Introducción a HTML5 y CSS3 AWGRvalgreens
 
Manual css3 DesarrolloWeb
Manual css3 DesarrolloWebManual css3 DesarrolloWeb
Manual css3 DesarrolloWebWalter Carmona
 
HTML5 & CSS3 in Drupal (on the Bayou)
HTML5 & CSS3 in Drupal (on the Bayou)HTML5 & CSS3 in Drupal (on the Bayou)
HTML5 & CSS3 in Drupal (on the Bayou)Mediacurrent
 

En vedette (20)

1000+ php questions
1000+ php questions1000+ php questions
1000+ php questions
 
Top 100 PHP Interview Questions and Answers
Top 100 PHP Interview Questions and AnswersTop 100 PHP Interview Questions and Answers
Top 100 PHP Interview Questions and Answers
 
PHP Technical Questions
PHP Technical QuestionsPHP Technical Questions
PHP Technical Questions
 
Zend PHP 5.3 Demo Certification Test
Zend PHP 5.3 Demo Certification TestZend PHP 5.3 Demo Certification Test
Zend PHP 5.3 Demo Certification Test
 
25 php interview questions – codementor
25 php interview questions – codementor25 php interview questions – codementor
25 php interview questions – codementor
 
Zend Php Certification Study Guide
Zend Php Certification Study GuideZend Php Certification Study Guide
Zend Php Certification Study Guide
 
Questions and answers regarding white card
Questions and answers regarding white cardQuestions and answers regarding white card
Questions and answers regarding white card
 
Top 100 PHP Questions and Answers
Top 100 PHP Questions and AnswersTop 100 PHP Questions and Answers
Top 100 PHP Questions and Answers
 
Useful functions for arrays in php
Useful functions for arrays in phpUseful functions for arrays in php
Useful functions for arrays in php
 
Zend Certification Preparation Tutorial
Zend Certification Preparation TutorialZend Certification Preparation Tutorial
Zend Certification Preparation Tutorial
 
Curso HTML5 - Temario
Curso HTML5 - TemarioCurso HTML5 - Temario
Curso HTML5 - Temario
 
PHP Quiz
PHP QuizPHP Quiz
PHP Quiz
 
Top 100 .Net Interview Questions and Answer
Top 100 .Net Interview Questions and AnswerTop 100 .Net Interview Questions and Answer
Top 100 .Net Interview Questions and Answer
 
Php mysql ppt
Php mysql pptPhp mysql ppt
Php mysql ppt
 
Zend Certification PHP 5 Sample Questions
Zend Certification PHP 5 Sample QuestionsZend Certification PHP 5 Sample Questions
Zend Certification PHP 5 Sample Questions
 
Your first 5 PHP design patterns - ThatConference 2012
Your first 5 PHP design patterns - ThatConference 2012Your first 5 PHP design patterns - ThatConference 2012
Your first 5 PHP design patterns - ThatConference 2012
 
Introducción a HTML5 y CSS3 AWGR
Introducción a HTML5 y CSS3 AWGRIntroducción a HTML5 y CSS3 AWGR
Introducción a HTML5 y CSS3 AWGR
 
Manual css3 DesarrolloWeb
Manual css3 DesarrolloWebManual css3 DesarrolloWeb
Manual css3 DesarrolloWeb
 
HTML5 & CSS3 in Drupal (on the Bayou)
HTML5 & CSS3 in Drupal (on the Bayou)HTML5 & CSS3 in Drupal (on the Bayou)
HTML5 & CSS3 in Drupal (on the Bayou)
 
Browser information in PHP
Browser information in PHPBrowser information in PHP
Browser information in PHP
 

Similaire à Practice exam php

C++ Programming Homework Help
C++ Programming Homework HelpC++ Programming Homework Help
C++ Programming Homework HelpC++ Homework Help
 
Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Guy Lebanon
 
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...Dhivyaa C.R
 
Comp 328 final guide
Comp 328 final guideComp 328 final guide
Comp 328 final guidekrtioplal
 
JavaScript(Es5) Interview Questions & Answers
JavaScript(Es5)  Interview Questions & AnswersJavaScript(Es5)  Interview Questions & Answers
JavaScript(Es5) Interview Questions & AnswersRatnala Charan kumar
 
Advanced Web Technology ass.pdf
Advanced Web Technology ass.pdfAdvanced Web Technology ass.pdf
Advanced Web Technology ass.pdfsimenehanmut
 
Arrays and function basic c programming notes
Arrays and function basic c programming notesArrays and function basic c programming notes
Arrays and function basic c programming notesGOKULKANNANMMECLECTC
 
Programming in C (part 2)
Programming in C (part 2)Programming in C (part 2)
Programming in C (part 2)SURBHI SAROHA
 
Java Questions
Java QuestionsJava Questions
Java Questionsbindur87
 

Similaire à Practice exam php (20)

Mcq ppt Php- array
Mcq ppt Php- array Mcq ppt Php- array
Mcq ppt Php- array
 
lab4_php
lab4_phplab4_php
lab4_php
 
lab4_php
lab4_phplab4_php
lab4_php
 
Java 8 Workshop
Java 8 WorkshopJava 8 Workshop
Java 8 Workshop
 
C++ Programming Homework Help
C++ Programming Homework HelpC++ Programming Homework Help
C++ Programming Homework Help
 
Ds lab handouts
Ds lab handoutsDs lab handouts
Ds lab handouts
 
Data Analysis with R (combined slides)
Data Analysis with R (combined slides)Data Analysis with R (combined slides)
Data Analysis with R (combined slides)
 
Chapter 2 wbp.pptx
Chapter 2 wbp.pptxChapter 2 wbp.pptx
Chapter 2 wbp.pptx
 
What is new in Java 8
What is new in Java 8What is new in Java 8
What is new in Java 8
 
cp05.pptx
cp05.pptxcp05.pptx
cp05.pptx
 
UNIT IV (4).pptx
UNIT IV (4).pptxUNIT IV (4).pptx
UNIT IV (4).pptx
 
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
Regular expressions, Session and Cookies by Dr.C.R.Dhivyaa Kongu Engineering ...
 
Comp 328 final guide
Comp 328 final guideComp 328 final guide
Comp 328 final guide
 
JavaScript(Es5) Interview Questions & Answers
JavaScript(Es5)  Interview Questions & AnswersJavaScript(Es5)  Interview Questions & Answers
JavaScript(Es5) Interview Questions & Answers
 
Advanced Web Technology ass.pdf
Advanced Web Technology ass.pdfAdvanced Web Technology ass.pdf
Advanced Web Technology ass.pdf
 
Java script arrays
Java script arraysJava script arrays
Java script arrays
 
Java script arrays
Java script arraysJava script arrays
Java script arrays
 
Arrays and function basic c programming notes
Arrays and function basic c programming notesArrays and function basic c programming notes
Arrays and function basic c programming notes
 
Programming in C (part 2)
Programming in C (part 2)Programming in C (part 2)
Programming in C (part 2)
 
Java Questions
Java QuestionsJava Questions
Java Questions
 

Dernier

Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterMydbops
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality AssuranceInflectra
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...Wes McKinney
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfNeo4j
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Alkin Tezuysal
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditSkynet Technologies
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfMounikaPolabathina
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsRavi Sanghani
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024BookNet Canada
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxLoriGlavin3
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfIngrid Airi González
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch TuesdayIvanti
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteDianaGray10
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxLoriGlavin3
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024Lonnie McRorey
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Hiroshi SHIBATA
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPathCommunity
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Farhan Tariq
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsNathaniel Shimoni
 

Dernier (20)

Scale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL RouterScale your database traffic with Read & Write split using MySQL Router
Scale your database traffic with Read & Write split using MySQL Router
 
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance[Webinar] SpiraTest - Setting New Standards in Quality Assurance
[Webinar] SpiraTest - Setting New Standards in Quality Assurance
 
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
The Future Roadmap for the Composable Data Stack - Wes McKinney - Data Counci...
 
Connecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdfConnecting the Dots for Information Discovery.pdf
Connecting the Dots for Information Discovery.pdf
 
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
Unleashing Real-time Insights with ClickHouse_ Navigating the Landscape in 20...
 
Manual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance AuditManual 508 Accessibility Compliance Audit
Manual 508 Accessibility Compliance Audit
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
What is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdfWhat is DBT - The Ultimate Data Build Tool.pdf
What is DBT - The Ultimate Data Build Tool.pdf
 
Potential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and InsightsPotential of AI (Generative AI) in Business: Learnings and Insights
Potential of AI (Generative AI) in Business: Learnings and Insights
 
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: Loan Stars - Tech Forum 2024
 
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptxA Deep Dive on Passkeys: FIDO Paris Seminar.pptx
A Deep Dive on Passkeys: FIDO Paris Seminar.pptx
 
Generative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdfGenerative Artificial Intelligence: How generative AI works.pdf
Generative Artificial Intelligence: How generative AI works.pdf
 
2024 April Patch Tuesday
2024 April Patch Tuesday2024 April Patch Tuesday
2024 April Patch Tuesday
 
Take control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test SuiteTake control of your SAP testing with UiPath Test Suite
Take control of your SAP testing with UiPath Test Suite
 
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptxThe Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
The Fit for Passkeys for Employee and Consumer Sign-ins: FIDO Paris Seminar.pptx
 
TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024TeamStation AI System Report LATAM IT Salaries 2024
TeamStation AI System Report LATAM IT Salaries 2024
 
Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024Long journey of Ruby standard library at RubyConf AU 2024
Long journey of Ruby standard library at RubyConf AU 2024
 
UiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to HeroUiPath Community: Communication Mining from Zero to Hero
UiPath Community: Communication Mining from Zero to Hero
 
Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...Genislab builds better products and faster go-to-market with Lean project man...
Genislab builds better products and faster go-to-market with Lean project man...
 
Time Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directionsTime Series Foundation Models - current state and future directions
Time Series Foundation Models - current state and future directions
 

Practice exam php

  • 1. This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain Practice Exam Questions 1. Which of the following strings are not valid modes for the fopen() function? A. a+b B. b+a C. at D. w E. x+ 2. Consider the following piece of code: <?php $arr = array(3 => “First”, 2=>“Second“, 1=>“Third“); list (, $result) = $arr; ?> After running it, the value of $result would be A. First B. Second C. Third D. This piece of code will not run, but fail with a parse error. 3. In standard SQL-92, which of these situations do not require or cannot be handled through the use of an aggregate SQL function? (Choose 2) A. Calculating the sum of all the values in a column. B. Determining the minimum value in a result set. C. Grouping the results of a query by one or more fields. D. Calculating the sum of all values in a column and retrieving all the values of another column that is not part of an aggregate function or GROUP BY clause. E. Determining the mean average of a column in a group of rows. 4. Multidimensional arrays can be sorted using the ______ function.
  • 2. This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain 210 Practice Exam Questions 5. When using the default session handler files for using sessions, PHP stores session information on the harddrive of the webserver.When are those session files cleaned up? A. PHP will delete the associated session file when session_destroy() is called from within a script. B. When the function session_cleanup() is called, PHP will iterate over all session files, and delete them if they exceeded the session timeout limit. C. When the function session_start() is called, PHP will iterate over all session files, and delete them if they exceeded the session timeout limit. D. When the function session_start() is called, PHP will sometimes iterate over all session files, and delete them if they exceeded the session timeout limit. E. Session files are never removed from the filesystem, you need to use an auto- mated script (such as a cronjob) to do this. 6. What is the order of parameters in the mail() function? A. subject, to address, extra headers, body B. to address, subject, extra headers, body C. to address, subject, body, extra headers D. subject, to address, body, extra headers 7. Which of the following statements are correct? (Choose 3) A. sprintf() does not output the generated string. B. printf(“%2s%1s“, “ab“, “c“) outputs the string abc. C. vprintf() takes at least one parameter; the first parameter is the formatting string and the following parameters are the arguments for the ‘%’ placeholders. D. printf(“%c“, “64“) will output @ and not 6. E. sprintf(“%3.4f“, $x) outputs more than 7 characters. F. number_format() inserts thousands of separators and decimal points differ- ent from (,) and (.) respectively, while printf() like functions always use (.) as decimal point.
  • 3. This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain Practice Exam Questions 211 8. The requirement is to return true for the case in which a string $str contains another string $substr after the first character of $str? Which of the following will return true when string $str contains string $substr, but only after the first character of $str? I. <?php function test($str, $substr) { return strpos(substr($str,1), $substr) >= 0; } ?> II. <?php function test($str, $substr) { return strrchr($str, $substr) !== false; } ?> III. <?php function test($str, $substr) { return strpos($str, $substr) > 0; } ?> A. I only B. II only C. III only D. I and II E. I and III F. II and III 9. Which of the features listed below do not exist in PHP4? (Choose 2) A. Exceptions B. Preprocessor instructions C. Control structures D. Classes and objects E. Constants
  • 4. This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain 212 Practice Exam Questions 10. What is the output of the following code snippet? <?php class Vehicle { } class Car extends Vehicle { } class Ferrari extends Car { } var_dump(get_parent_class(“Ferrari”)); ?> A. string(7) “Vehicle“ B. string(3) “Car“ C. array(2) { [0]=> string(7) “vehicle“ [1]=> string(3) “car“ } 11. The following PHP script is designed to subtract two indexed arrays of numbers. Which statement is correct? <?php $a = array(5, 2, 2, 3); $b = array(5, 8, 1, 5); var_dump(subArrays($a, $b)); function subArrays($arr1, $arr2) { $c = count($arr1); if ($c != count($arr2)) return null;
  • 5. This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain Practice Exam Questions 213 for($i = 0; $i < $c; $i++) $res[$i] $arr1[$i] - $arr2[$i]; return $res; } ?> A. The script is valid. B. Assignments must be made on a single line. C. It has too many linefeed characters between statements. D. No, the script is missing curly braces. E. Yes it is valid, but the script will not work as expected. 12. What is the purpose of the escapeshellarg() function? A. Removing malicious characters. B. Escaping malicious characters. C. Creating an array of arguments for a shell command. D. Preparing data to be used as a single argument in a shell command. E. None of the above. 13. The _________ function can be used to determine if the contents of a string can be interpreted as a number. 14. Assume $comment contains a string.Which PHP statement prints out the first 20 characters of $comment followed by three dots (.)? A. print substr($comment, 20) . ‘...‘; B. print substr_replace($comment, ‘...‘, 20); C. print substr($comment, 20, strlen($comment)) . ‘...‘; D. print substr_replace($comment, 20, ‘...‘); 15. What is the name of the function that you should use to put uploaded files into a permanent location on your server? 16. If you have a file handle for an opened file, use the __________ function to send all data remaining to be read from that file handle to the output buffer.
  • 6. This copy is registered to N&uacute;ria Torrescasana (nuria3pyx@iespana.es) - Manresa (Barcelona), 08242, Spain 214 Practice Exam Questions 17. Which of the following sentences are not true? (Choose 2) A. strpos() allows searching for a substring in another string. B. strrpos() allows searching for a substring in another string. C. strpos() and strrchr() return -1 if the second parameter is not a sub- string of the first parameter. D. strpos() and strrpos() can return a value that is different from an integer. E. The second parameter to substr() is the length of the substring to extract. F. strstr() returns false if the substring specified by its second parameter is not found in the first parameter. 18. Which of the following sentences are correct? (Choose 2) A. time() + 60*60*100 returns the current date and time plus one hour. B. time() + 24*60*60 returns the current date and time plus one day. C. time() + 24*60*60*100 returns the current date and time plus one day Answers 1. B 2. C 3. C and D 4. array_multisort or array_multisort() 5. D 6. C 7. A, D, and F 8. C 9. A and B 10. A 11. B 12. D 13. is_numeric or is_numeric() 14. B 15. move_uploaded_file or move_uploaded_file() 16. fpassthru or fpassthru() 17. C and E 18. B