SlideShare uma empresa Scribd logo
1 de 21
PHP Quiz
Tuesday 13th
of March 2013 @AFUP_Toulouse
thomas@gasc.fr @methylbro
1. What is the output of the following
code?
$a = 1;
++$a;
$a *= $a;
echo $a--;
a. 4
b. 3
c. 5
d. 0
2. Which of the following will
generate an E_NOTICE error
assuming the following code?
<?php
$array = array(
array(
1, 2
),
'a' => array(
'b' => 1,
'c'
)
);
a. $array[] = 1;
b. echo $array[5][2];
c. echo $array[5][2] = 2;
d. isset($array[7][3][1]);
3. Which of the following error types
cannot be caught by setting up a
custom error handler?
a. E_WARNING
b. E_ERROR
c. E_USER_ERROR
d. E_PARSE
e. E_NOTICE
4. When PHP is running on a
command line, what super-global
will contain the command line
arguments specified?
a. $_SERVER
b. $_ENV
c. $GLOBALS
d. $_POST
e. $_ARGV
Function world() is defined in the namespace myapputilshello. Your
code is in the namespace myapp.
5. What is the correct way to import
the hello namespace so you can use
the world() function?
a. use hello
b. use utilshello
c. use myapputilshello
d. use myapputilshelloworld
6. Which interface can be used to
allow an object to be executed in a
foreach loop?
a. ArrayObject
b. Iterator
c. ArrayList
d. Hashtable
7. What is the output of the following
script?
<?php
function fibonacci ($x1, $x2)
{
return $x1 + $x2;
}
$x1 = 0;
$x2 = 1;
for ($i = 0; $i<10; $i++) {
echo fibonacci(
$x1, $x2
).',';
}
a. 1,2,3,4,5,6,7,8,9
b. 1,2,3,4,5,6,7,8,9,10,
c. 1,2,3,5,8,13,21,34,55,89,
d. 1,1,1,1,1,1,1,1,1,1,
8. Which PHP functions may be used
to find out which PHP extensions are
available in the system? (Choose 2)
a. extension_loaded()
b. get_extension_funcs()
c. get_loaded_extensions()
d. phpinfo()
9. What is the name of the error level
constant that is used to designate
PHP code that will not work in future
versions?
E_???????
Your PHP script is repeatedly parsing 50KB of data
returned from a remote web service into browser-
readable HTML.
Users complain that the script takes a long time to run.
10. Wich of the following measures
usually leads to the best results? (Choose 2)
a. Install a bytecode cache
b. Install an SSD drive on the server
c. Cache the data returned by the web service
locally
d. Upgrade to the lastest version of PHP
11. What the following code
produce?
<?php
define('CONSTANT', 1);
define('_CONSTANT', 0);
define('EMPTY', '');
if (!empty(EMPTY)) {
if (!((bool) _CONSTANT)) {
print "One";
}
} elseif (constant('CONSTANT')==1)
{
print "Two":
}
a. One
b. Two
c. Syntax error
12. Which of the following functions
reads the entire contents of a file?
a. fgets()
b. file_get_contents()
c. fread()
d. readfile()
e. file()
Consider the following PHP script, which reads a file, line-by-line, from a text file.
13. Which function call should be inserted in place of
the question marks in order for the script to function
correctly?
<?php
$file = fopen("test", "r");
while(!feof($file)) {
echo ????????????;
}
fclose($file);
a. file_get_contents($file)
b. file($file)
c. read_file($file)
d. fgets($file)
e. fread($file)
14. Which of the following function
calls will cause a file pointer to be
returned to the beginning of the file?
a. reset()
b. fseek(-1)
c. fseek(0, SEEK_END)
d. fseek(0, SEEK_SET)
e. fseek(0, SEEK_CUR)
15. How will the following script be
displayed if called directly from a
browser?
<?php
header ("Content-type:
image/jpeg");
?>
<?php
readfile ("image.jpg");
?>
a. As a JPEG image
b. As a binary file for display within
the browser
c. As a binary file for download
d. As a JPEG file for download
e. As a broken image
16. Which of the following is not a
valid PHP file wrapper resource?
a. serverpathfilename
b. http://www.example.com/index.php
c. myfile.txt
d. compress.zlib://myfile.txt
e. They all are valid
17. Which of the following are valid
PHP stream transports? (Choose 2)
a. http
b. STDIO
c. ftp
d. STDOUT
e. stream
18. What does an opcode cache do?
a. It compiles scripts into binary objects to make them run
faster
b. It replaces the Zend Engine to provide a faster
interpreter
c. It caches a script’s output to improve its performance
d. It improves performance by caching the intermediate
code produced by the parser
e. It caches a script in memory, thus eliminating the need
for reloading it from disk at every iteration
19. Who can spell the name of the
Scope Resolution Operator?
_ _ _ M _ _ _ M _ _ _ _ _ _ _ _ _ _ M
www.afup.org
French Association of PHP Users
Join

Mais conteúdo relacionado

Mais procurados

Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php PresentationAlan Pinstein
 
Databases and MySQL
Databases and MySQLDatabases and MySQL
Databases and MySQLThings Lab
 
Php Env Var
Php Env VarPhp Env Var
Php Env Vararvind34
 
Php vulnerability presentation
Php vulnerability presentationPhp vulnerability presentation
Php vulnerability presentationSqa Enthusiast
 
Writing php extensions in golang
Writing php extensions in golangWriting php extensions in golang
Writing php extensions in golangdo_aki
 
Ruby Projects and Libraries
Ruby Projects and LibrariesRuby Projects and Libraries
Ruby Projects and LibrariesVorleak Chy
 
جلسه پنجم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲- ارائه ۲
جلسه پنجم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲- ارائه ۲جلسه پنجم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲- ارائه ۲
جلسه پنجم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲- ارائه ۲Mohammad Reza Kamalifard
 
Beginners PHP Tutorial
Beginners PHP TutorialBeginners PHP Tutorial
Beginners PHP Tutorialalexjones89
 
Rest API using Flask & SqlAlchemy
Rest API using Flask & SqlAlchemyRest API using Flask & SqlAlchemy
Rest API using Flask & SqlAlchemyAlessandro Cucci
 
A History of PHP
A History of PHPA History of PHP
A History of PHPXinchen Hui
 
PHP in one presentation
PHP in one presentationPHP in one presentation
PHP in one presentationMilad Rahimi
 
PHP 7 Crash Course - php[world] 2015
PHP 7 Crash Course - php[world] 2015PHP 7 Crash Course - php[world] 2015
PHP 7 Crash Course - php[world] 2015Colin O'Dell
 
PHP - History, Introduction, Summary, Extensions and Frameworks
PHP - History, Introduction, Summary, Extensions and FrameworksPHP - History, Introduction, Summary, Extensions and Frameworks
PHP - History, Introduction, Summary, Extensions and FrameworksRoyston Olivera
 

Mais procurados (20)

Lean Php Presentation
Lean Php PresentationLean Php Presentation
Lean Php Presentation
 
Databases and MySQL
Databases and MySQLDatabases and MySQL
Databases and MySQL
 
Avaliação ad1 de php e mysql
Avaliação ad1 de php e mysqlAvaliação ad1 de php e mysql
Avaliação ad1 de php e mysql
 
Php Env Var
Php Env VarPhp Env Var
Php Env Var
 
Php vulnerability presentation
Php vulnerability presentationPhp vulnerability presentation
Php vulnerability presentation
 
MySQL Presentation
MySQL PresentationMySQL Presentation
MySQL Presentation
 
Writing php extensions in golang
Writing php extensions in golangWriting php extensions in golang
Writing php extensions in golang
 
Ruby Projects and Libraries
Ruby Projects and LibrariesRuby Projects and Libraries
Ruby Projects and Libraries
 
جلسه پنجم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲- ارائه ۲
جلسه پنجم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲- ارائه ۲جلسه پنجم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲- ارائه ۲
جلسه پنجم پایتون برای هکر های قانونی دوره مقدماتی پاییز ۹۲- ارائه ۲
 
Beginners PHP Tutorial
Beginners PHP TutorialBeginners PHP Tutorial
Beginners PHP Tutorial
 
PHP Function
PHP Function PHP Function
PHP Function
 
PHP Tutorials
PHP TutorialsPHP Tutorials
PHP Tutorials
 
Rest API using Flask & SqlAlchemy
Rest API using Flask & SqlAlchemyRest API using Flask & SqlAlchemy
Rest API using Flask & SqlAlchemy
 
A History of PHP
A History of PHPA History of PHP
A History of PHP
 
PHP in one presentation
PHP in one presentationPHP in one presentation
PHP in one presentation
 
Flask Basics
Flask BasicsFlask Basics
Flask Basics
 
PHP 7 Crash Course - php[world] 2015
PHP 7 Crash Course - php[world] 2015PHP 7 Crash Course - php[world] 2015
PHP 7 Crash Course - php[world] 2015
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
PHP - History, Introduction, Summary, Extensions and Frameworks
PHP - History, Introduction, Summary, Extensions and FrameworksPHP - History, Introduction, Summary, Extensions and Frameworks
PHP - History, Introduction, Summary, Extensions and Frameworks
 
Отладка в GDB
Отладка в GDBОтладка в GDB
Отладка в GDB
 

Destaque

Php code for online quiz
Php code for online quizPhp code for online quiz
Php code for online quizhnyb1002
 
Online Quiz System Project PPT
Online Quiz System Project PPTOnline Quiz System Project PPT
Online Quiz System Project PPTShanthan Reddy
 
Online quiz by danish & sudhanshu techlites
Online quiz by danish & sudhanshu techlitesOnline quiz by danish & sudhanshu techlites
Online quiz by danish & sudhanshu techlitesDanish Anwar
 
Online examination system
Online examination systemOnline examination system
Online examination systemAj Maurya
 
Online examination documentation
Online examination documentationOnline examination documentation
Online examination documentationWakimul Alam
 
Online examination system project ppt
Online examination system project pptOnline examination system project ppt
Online examination system project pptMohit Gupta
 
Online Examination System Project report
Online Examination System Project report Online Examination System Project report
Online Examination System Project report SARASWATENDRA SINGH
 
PHP Technical Questions
PHP Technical QuestionsPHP Technical Questions
PHP Technical QuestionsPankaj Jha
 
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
 
14.project online eamination system
14.project online eamination system14.project online eamination system
14.project online eamination systemjbpatel7290
 
quiz half ppt
quiz half pptquiz half ppt
quiz half pptmohit91
 
Quiz managment system
Quiz managment systemQuiz managment system
Quiz managment systemtamourk2
 
online examination management system
online examination management systemonline examination management system
online examination management systemPraveen Patel
 
Android Beat the-quiz application
Android Beat the-quiz applicationAndroid Beat the-quiz application
Android Beat the-quiz applicationAyush Singh
 
Examination Hall Allocation
Examination Hall Allocation Examination Hall Allocation
Examination Hall Allocation Martina Thampan
 

Destaque (20)

Php code for online quiz
Php code for online quizPhp code for online quiz
Php code for online quiz
 
Online quiz system
Online quiz systemOnline quiz system
Online quiz system
 
Online Quiz System Project PPT
Online Quiz System Project PPTOnline Quiz System Project PPT
Online Quiz System Project PPT
 
Online quiz by danish & sudhanshu techlites
Online quiz by danish & sudhanshu techlitesOnline quiz by danish & sudhanshu techlites
Online quiz by danish & sudhanshu techlites
 
Online examination system
Online examination systemOnline examination system
Online examination system
 
Online examination documentation
Online examination documentationOnline examination documentation
Online examination documentation
 
Online examination system project ppt
Online examination system project pptOnline examination system project ppt
Online examination system project ppt
 
Online Examination System Project report
Online Examination System Project report Online Examination System Project report
Online Examination System Project report
 
Practice exam php
Practice exam phpPractice exam php
Practice exam php
 
PHP Technical Questions
PHP Technical QuestionsPHP Technical Questions
PHP Technical 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
 
14.project online eamination system
14.project online eamination system14.project online eamination system
14.project online eamination system
 
Online quiz
Online quizOnline quiz
Online quiz
 
quiz half ppt
quiz half pptquiz half ppt
quiz half ppt
 
Online Quiz 2
Online Quiz 2Online Quiz 2
Online Quiz 2
 
Quiz managment system
Quiz managment systemQuiz managment system
Quiz managment system
 
online examination management system
online examination management systemonline examination management system
online examination management system
 
Android Beat the-quiz application
Android Beat the-quiz applicationAndroid Beat the-quiz application
Android Beat the-quiz application
 
Online examination system
Online examination systemOnline examination system
Online examination system
 
Examination Hall Allocation
Examination Hall Allocation Examination Hall Allocation
Examination Hall Allocation
 

Semelhante a PHP Quiz

Php5 certification mock exams
Php5 certification mock examsPhp5 certification mock exams
Php5 certification mock examsecho liu
 
Php interview questions
Php interview questionsPhp interview questions
Php interview questionssubash01
 
The why and how of moving to php 8
The why and how of moving to php 8The why and how of moving to php 8
The why and how of moving to php 8Wim Godden
 
The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6Wim Godden
 
501 - PHP MYSQL.pdf
501 - PHP MYSQL.pdf501 - PHP MYSQL.pdf
501 - PHP MYSQL.pdfAkashGohil10
 
PHP Session - Mcq ppt
PHP Session - Mcq ppt PHP Session - Mcq ppt
PHP Session - Mcq ppt Shaheen Shaikh
 
Web Server and Web Technology Exam paper
Web Server and Web Technology Exam paperWeb Server and Web Technology Exam paper
Web Server and Web Technology Exam paperZairul Nizam
 
Php interview-questions and answers
Php interview-questions and answersPhp interview-questions and answers
Php interview-questions and answerssheibansari
 
What To Expect From PHP7
What To Expect From PHP7What To Expect From PHP7
What To Expect From PHP7Codemotion
 
Php questions and answers
Php questions and answersPhp questions and answers
Php questions and answersDeepika joshi
 
Prepare for PHP Test Fest 2009
Prepare for PHP Test Fest 2009Prepare for PHP Test Fest 2009
Prepare for PHP Test Fest 2009PHPBelgium
 
FNT Software Solutions Pvt Ltd Placement Papers - PHP Technologies
FNT Software Solutions Pvt Ltd Placement Papers - PHP TechnologiesFNT Software Solutions Pvt Ltd Placement Papers - PHP Technologies
FNT Software Solutions Pvt Ltd Placement Papers - PHP Technologiesfntsofttech
 
Is your code ready for PHP 7 ?
Is your code ready for PHP 7 ?Is your code ready for PHP 7 ?
Is your code ready for PHP 7 ?Wim Godden
 
The why and how of moving to php 7
The why and how of moving to php 7The why and how of moving to php 7
The why and how of moving to php 7Wim Godden
 
Starting with PHP and Web devepolment
Starting with PHP and Web devepolmentStarting with PHP and Web devepolment
Starting with PHP and Web devepolmentRajib Ahmed
 
Exakat for PHP : smart code reviewing engine
Exakat for PHP : smart code reviewing engineExakat for PHP : smart code reviewing engine
Exakat for PHP : smart code reviewing engineDamien Seguy
 

Semelhante a PHP Quiz (20)

PHP Technical Question
PHP Technical QuestionPHP Technical Question
PHP Technical Question
 
Php5 certification mock exams
Php5 certification mock examsPhp5 certification mock exams
Php5 certification mock exams
 
Web backdoors attacks, evasion, detection
Web backdoors   attacks, evasion, detectionWeb backdoors   attacks, evasion, detection
Web backdoors attacks, evasion, detection
 
Php interview questions
Php interview questionsPhp interview questions
Php interview questions
 
The why and how of moving to php 8
The why and how of moving to php 8The why and how of moving to php 8
The why and how of moving to php 8
 
The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6The why and how of moving to PHP 5.5/5.6
The why and how of moving to PHP 5.5/5.6
 
501 - PHP MYSQL.pdf
501 - PHP MYSQL.pdf501 - PHP MYSQL.pdf
501 - PHP MYSQL.pdf
 
PHP Session - Mcq ppt
PHP Session - Mcq ppt PHP Session - Mcq ppt
PHP Session - Mcq ppt
 
Web Server and Web Technology Exam paper
Web Server and Web Technology Exam paperWeb Server and Web Technology Exam paper
Web Server and Web Technology Exam paper
 
Php interview-questions and answers
Php interview-questions and answersPhp interview-questions and answers
Php interview-questions and answers
 
What To Expect From PHP7
What To Expect From PHP7What To Expect From PHP7
What To Expect From PHP7
 
Php questions and answers
Php questions and answersPhp questions and answers
Php questions and answers
 
Php Presentation
Php PresentationPhp Presentation
Php Presentation
 
Prepare for PHP Test Fest 2009
Prepare for PHP Test Fest 2009Prepare for PHP Test Fest 2009
Prepare for PHP Test Fest 2009
 
FNT Software Solutions Pvt Ltd Placement Papers - PHP Technologies
FNT Software Solutions Pvt Ltd Placement Papers - PHP TechnologiesFNT Software Solutions Pvt Ltd Placement Papers - PHP Technologies
FNT Software Solutions Pvt Ltd Placement Papers - PHP Technologies
 
Is your code ready for PHP 7 ?
Is your code ready for PHP 7 ?Is your code ready for PHP 7 ?
Is your code ready for PHP 7 ?
 
The why and how of moving to php 7
The why and how of moving to php 7The why and how of moving to php 7
The why and how of moving to php 7
 
Lca05
Lca05Lca05
Lca05
 
Starting with PHP and Web devepolment
Starting with PHP and Web devepolmentStarting with PHP and Web devepolment
Starting with PHP and Web devepolment
 
Exakat for PHP : smart code reviewing engine
Exakat for PHP : smart code reviewing engineExakat for PHP : smart code reviewing engine
Exakat for PHP : smart code reviewing engine
 

Último

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsRoshan Dwivedi
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...apidays
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodJuan lago vázquez
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)wesley chun
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Último (20)

Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live StreamsTop 5 Benefits OF Using Muvi Live Paywall For Live Streams
Top 5 Benefits OF Using Muvi Live Paywall For Live Streams
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

PHP Quiz

  • 1. PHP Quiz Tuesday 13th of March 2013 @AFUP_Toulouse thomas@gasc.fr @methylbro
  • 2. 1. What is the output of the following code? $a = 1; ++$a; $a *= $a; echo $a--; a. 4 b. 3 c. 5 d. 0
  • 3. 2. Which of the following will generate an E_NOTICE error assuming the following code? <?php $array = array( array( 1, 2 ), 'a' => array( 'b' => 1, 'c' ) ); a. $array[] = 1; b. echo $array[5][2]; c. echo $array[5][2] = 2; d. isset($array[7][3][1]);
  • 4. 3. Which of the following error types cannot be caught by setting up a custom error handler? a. E_WARNING b. E_ERROR c. E_USER_ERROR d. E_PARSE e. E_NOTICE
  • 5. 4. When PHP is running on a command line, what super-global will contain the command line arguments specified? a. $_SERVER b. $_ENV c. $GLOBALS d. $_POST e. $_ARGV
  • 6. Function world() is defined in the namespace myapputilshello. Your code is in the namespace myapp. 5. What is the correct way to import the hello namespace so you can use the world() function? a. use hello b. use utilshello c. use myapputilshello d. use myapputilshelloworld
  • 7. 6. Which interface can be used to allow an object to be executed in a foreach loop? a. ArrayObject b. Iterator c. ArrayList d. Hashtable
  • 8. 7. What is the output of the following script? <?php function fibonacci ($x1, $x2) { return $x1 + $x2; } $x1 = 0; $x2 = 1; for ($i = 0; $i<10; $i++) { echo fibonacci( $x1, $x2 ).','; } a. 1,2,3,4,5,6,7,8,9 b. 1,2,3,4,5,6,7,8,9,10, c. 1,2,3,5,8,13,21,34,55,89, d. 1,1,1,1,1,1,1,1,1,1,
  • 9. 8. Which PHP functions may be used to find out which PHP extensions are available in the system? (Choose 2) a. extension_loaded() b. get_extension_funcs() c. get_loaded_extensions() d. phpinfo()
  • 10. 9. What is the name of the error level constant that is used to designate PHP code that will not work in future versions? E_???????
  • 11. Your PHP script is repeatedly parsing 50KB of data returned from a remote web service into browser- readable HTML. Users complain that the script takes a long time to run. 10. Wich of the following measures usually leads to the best results? (Choose 2) a. Install a bytecode cache b. Install an SSD drive on the server c. Cache the data returned by the web service locally d. Upgrade to the lastest version of PHP
  • 12. 11. What the following code produce? <?php define('CONSTANT', 1); define('_CONSTANT', 0); define('EMPTY', ''); if (!empty(EMPTY)) { if (!((bool) _CONSTANT)) { print "One"; } } elseif (constant('CONSTANT')==1) { print "Two": } a. One b. Two c. Syntax error
  • 13. 12. Which of the following functions reads the entire contents of a file? a. fgets() b. file_get_contents() c. fread() d. readfile() e. file()
  • 14. Consider the following PHP script, which reads a file, line-by-line, from a text file. 13. Which function call should be inserted in place of the question marks in order for the script to function correctly? <?php $file = fopen("test", "r"); while(!feof($file)) { echo ????????????; } fclose($file); a. file_get_contents($file) b. file($file) c. read_file($file) d. fgets($file) e. fread($file)
  • 15. 14. Which of the following function calls will cause a file pointer to be returned to the beginning of the file? a. reset() b. fseek(-1) c. fseek(0, SEEK_END) d. fseek(0, SEEK_SET) e. fseek(0, SEEK_CUR)
  • 16. 15. How will the following script be displayed if called directly from a browser? <?php header ("Content-type: image/jpeg"); ?> <?php readfile ("image.jpg"); ?> a. As a JPEG image b. As a binary file for display within the browser c. As a binary file for download d. As a JPEG file for download e. As a broken image
  • 17. 16. Which of the following is not a valid PHP file wrapper resource? a. serverpathfilename b. http://www.example.com/index.php c. myfile.txt d. compress.zlib://myfile.txt e. They all are valid
  • 18. 17. Which of the following are valid PHP stream transports? (Choose 2) a. http b. STDIO c. ftp d. STDOUT e. stream
  • 19. 18. What does an opcode cache do? a. It compiles scripts into binary objects to make them run faster b. It replaces the Zend Engine to provide a faster interpreter c. It caches a script’s output to improve its performance d. It improves performance by caching the intermediate code produced by the parser e. It caches a script in memory, thus eliminating the need for reloading it from disk at every iteration
  • 20. 19. Who can spell the name of the Scope Resolution Operator? _ _ _ M _ _ _ M _ _ _ _ _ _ _ _ _ _ M