SlideShare une entreprise Scribd logo
1  sur  31
Trucs & astuces PHP
.:PHP:.







web interpreted language
Auto. memory management
Weakly typed
Highly dynamic
Light and efficient
Cross-plateform
PHP gotcha !
 Highly dynamic language
 Borrows some concepts from perl / C

 Lots of weird behaviors
 To be known

 Certification exam can fool you with such behaviors
PHP gotcha

if (DONT_EXIST) {
echo "true";
} else {
echo "false";
}
PHP gotcha revealed
if (DONT_EXIST) {
echo "true";
} else {
echo "false";
}

if ("DONT_EXIST")

if (true)
PHP gotcha

$text = "foo and bar";
if (strpos($text, "foo") {
echo "foo is here";
} else {
echo "foo is not here";
}
PHP gotcha

echo (true?'true':false?'t':'f');
PHP gotcha revealed

echo (true?'true':false?'t':'f');

echo ( (true?'true':false) ?'t':'f' );
PHP gotcha

$a = 'foobar';
$a[10] = 'foo';
var_dump($a);
PHP gotcha revealed

$a = 'foobar';
$a[10] = 'foo';
var_dump($a);

string(11) "foobar

f"
PHP gotcha

$a = 11;
$a = $a++ + ++$a;
echo $a++;
PHP gotcha revealed
$a = 11;
$a = $a++ + ++$a;
echo $a++;

$a = 11;
$a = 11 + 13; //24
echo 24;
PHP gotcha
$array = array(1 => "Julien", "1" => "Seb", "Mag", 2 => "Leo");
echo count($array);
PHP gotcha revealed
$array = array(1 => "Julien", "1" => "Seb", "Mag", 2 => "Leo");
echo count($array);

$array = array( "1" => "Seb", 2 => "Leo");
2
PHP gotcha
$a = 'foo';
$b = 'bar';
echo $a . print('baz') . $b;
PHP gotcha revealed
$a = 'foo';
$b = 'bar';
echo $a . print('baz') . $b;

echo $a . print("baz" . $b);
"bazbarfoo1"
PHP gotcha

echo 0123 + 123 + 0;
PHP gotcha revealed

echo 0123 + 123 + 0;

echo 83 + 123 + 0;
PHP gotcha

$a = 'baz';
$a++;
echo $a;
PHP gotcha revealed

$a = 'baz';
$a++;
echo $a;

"bba"
PHP Tips
 PHP is full of functions and extensions
 Let's oversee some useful features
PHP Tip
 Array Flattening
$input = array('a', 'b', array('c', 'd'), 'e', array('f'), 'g');
$output = iterator_to_array(new RecursiveIteratorIterator(
new RecursiveArrayIterator($input)), FALSE);
var_dump($output);

array('a', 'b', 'c', 'd', 'e', 'f', 'g');
PHP Tip
 Automatic HTML cleaning
ob_start('ob_tidyhandler');
echo '<p>test</i>';

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN">
<html>
<head>
<title></title>
</head>
<body>
<p>test</p>
</body>
</html>
PHP Tip
 Get usefull info from MySQL
mysqli_report(MYSQLI_REPORT_INDEX);
$db = mysqli_connect('srv1', 'john', 'secret', 'my_db');
mysqli_query($db, "SELECT photo FROM Users WHERE source !='' LIMIT 1000");

PHP Warning: mysqli_query(): (00000/0): No index used in query/prepared
statement SELECT photo FROM Users WHERE source !='' LIMIT 1000
PHP Tip
 Apply a callback to every fetch from MySQL

$sql = "SELECT nom, prenom FROM auteurs";
$stmt = $pdo->query($sql);
$func = function ($nom, $prenom){printf('%s-%s',$nom,$prenom);};
$result = $stmt->fetchAll(PDO::FETCH_FUNC, $func);
PHP Tip
 List a type of weekday coming in calendar
$begin = new DateTime('2009-11-01');
$end = new DateTime; // now
$interval = DateInterval::createFromDateString('next sunday');
$period = new DatePeriod($begin, $interval, $end);
foreach ( $period as $dt ) {
echo $dt->format( "l Y-m-d H:i:sn" );
}

Sunday 2009-11-01 00:00:00
Sunday 2009-11-08 00:00:00
Sunday 2009-11-15 00:00:00
...
PHP Certification
 70 Questions – 90min
 PHP 5.5
 Functions – OOP – arrays – streams – Xml – Databases –
Json – strings – securité – Ios – HTTP ...
 Nothing known about how to pass the exam
 Better know maximum of subjects
PHP certif quick overview
What's the output of this script ?
<?php
function oranges(&$oranges = 17) {
$oranges .= 1;
}
$apples = 5;
oranges($apples);
echo $apples++;
A)16
B)51
C)15
D)6
E)52
PHP certif quick overview
What's design pattern can you recognize ?
<?php
class MyClassBuilder {
public function build() {
return new MyClass();
}
}
A)builder
B)factory
C)singleton
D)observer
E)other pattern
PHP certif quick overview
In SimpleXML, you can use ______ method on SimpleXmlElement
to get all its children
PHP certif quick overview
What's the output of this script ?
<?php
class Foo {
const BAR = 4+1;
}
echo Foo::BAR;
A)4
B)5
C)1
D)an error

Contenu connexe

Tendances

Yapcasia2011 - Hello Embed Perl
Yapcasia2011 - Hello Embed PerlYapcasia2011 - Hello Embed Perl
Yapcasia2011 - Hello Embed Perl
Hideaki Ohno
 
Phpをいじり倒す10の方法
Phpをいじり倒す10の方法Phpをいじり倒す10の方法
Phpをいじり倒す10の方法
Moriyoshi Koizumi
 
The Php Life Cycle
The Php Life CycleThe Php Life Cycle
The Php Life Cycle
Xinchen Hui
 

Tendances (20)

Php and threads ZTS
Php and threads ZTSPhp and threads ZTS
Php and threads ZTS
 
Create your own PHP extension, step by step - phpDay 2012 Verona
Create your own PHP extension, step by step - phpDay 2012 VeronaCreate your own PHP extension, step by step - phpDay 2012 Verona
Create your own PHP extension, step by step - phpDay 2012 Verona
 
Php7 extensions workshop
Php7 extensions workshopPhp7 extensions workshop
Php7 extensions workshop
 
PHP Internals and Virtual Machine
PHP Internals and Virtual MachinePHP Internals and Virtual Machine
PHP Internals and Virtual Machine
 
Php engine
Php enginePhp engine
Php engine
 
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHPIPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
IPC2010SE Doctrine2 Enterprise Persistence Layer for PHP
 
PHP7 - Scalar Type Hints & Return Types
PHP7 - Scalar Type Hints & Return TypesPHP7 - Scalar Type Hints & Return Types
PHP7 - Scalar Type Hints & Return Types
 
Yapcasia2011 - Hello Embed Perl
Yapcasia2011 - Hello Embed PerlYapcasia2011 - Hello Embed Perl
Yapcasia2011 - Hello Embed Perl
 
Key features PHP 5.3 - 5.6
Key features PHP 5.3 - 5.6Key features PHP 5.3 - 5.6
Key features PHP 5.3 - 5.6
 
PHP 7 OPCache extension review
PHP 7 OPCache extension reviewPHP 7 OPCache extension review
PHP 7 OPCache extension review
 
Just-In-Time Compiler in PHP 8
Just-In-Time Compiler in PHP 8Just-In-Time Compiler in PHP 8
Just-In-Time Compiler in PHP 8
 
Phpをいじり倒す10の方法
Phpをいじり倒す10の方法Phpをいじり倒す10の方法
Phpをいじり倒す10の方法
 
The Php Life Cycle
The Php Life CycleThe Php Life Cycle
The Php Life Cycle
 
Php string function
Php string function Php string function
Php string function
 
Mysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extensionMysqlnd, an unknown powerful PHP extension
Mysqlnd, an unknown powerful PHP extension
 
SymfonyCon 2017 php7 performances
SymfonyCon 2017 php7 performancesSymfonyCon 2017 php7 performances
SymfonyCon 2017 php7 performances
 
Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPIntroduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHP
 
Php 7 hhvm and co
Php 7 hhvm and coPhp 7 hhvm and co
Php 7 hhvm and co
 
Modern PHP
Modern PHPModern PHP
Modern PHP
 
Symfony live 2017_php7_performances
Symfony live 2017_php7_performancesSymfony live 2017_php7_performances
Symfony live 2017_php7_performances
 

Similaire à PHP Tips for certification - OdW13

GettingStartedWithPHP
GettingStartedWithPHPGettingStartedWithPHP
GettingStartedWithPHP
Nat Weerawan
 
OSDC.TW - Gutscript for PHP haters
OSDC.TW - Gutscript for PHP hatersOSDC.TW - Gutscript for PHP haters
OSDC.TW - Gutscript for PHP haters
Lin Yo-An
 
2014 database - course 2 - php
2014 database - course 2 - php2014 database - course 2 - php
2014 database - course 2 - php
Hung-yu Lin
 

Similaire à PHP Tips for certification - OdW13 (20)

[PL] Jak nie zostać "programistą" PHP?
[PL] Jak nie zostać "programistą" PHP?[PL] Jak nie zostać "programistą" PHP?
[PL] Jak nie zostać "programistą" PHP?
 
Introduction to PHP
Introduction to PHPIntroduction to PHP
Introduction to PHP
 
Php Lecture Notes
Php Lecture NotesPhp Lecture Notes
Php Lecture Notes
 
PHP Basics
PHP BasicsPHP Basics
PHP Basics
 
GettingStartedWithPHP
GettingStartedWithPHPGettingStartedWithPHP
GettingStartedWithPHP
 
Introduction to PHP Lecture 1
Introduction to PHP Lecture 1Introduction to PHP Lecture 1
Introduction to PHP Lecture 1
 
PHP: The easiest language to learn.
PHP: The easiest language to learn.PHP: The easiest language to learn.
PHP: The easiest language to learn.
 
Php hacku
Php hackuPhp hacku
Php hacku
 
Clear php reference
Clear php referenceClear php reference
Clear php reference
 
OSDC.TW - Gutscript for PHP haters
OSDC.TW - Gutscript for PHP hatersOSDC.TW - Gutscript for PHP haters
OSDC.TW - Gutscript for PHP haters
 
2014 database - course 2 - php
2014 database - course 2 - php2014 database - course 2 - php
2014 database - course 2 - php
 
Web Technology_10.ppt
Web Technology_10.pptWeb Technology_10.ppt
Web Technology_10.ppt
 
Automated code audits
Automated code auditsAutomated code audits
Automated code audits
 
Php.ppt
Php.pptPhp.ppt
Php.ppt
 
Web 8 | Introduction to PHP
Web 8 | Introduction to PHPWeb 8 | Introduction to PHP
Web 8 | Introduction to PHP
 
Top 10 php classic traps DPC 2020
Top 10 php classic traps DPC 2020Top 10 php classic traps DPC 2020
Top 10 php classic traps DPC 2020
 
PHP for hacks
PHP for hacksPHP for hacks
PHP for hacks
 
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
The new features of PHP 7 - Enrico Zimuel - Codemotion Milan 2016
 
The new features of PHP 7
The new features of PHP 7The new features of PHP 7
The new features of PHP 7
 
PHP Basics and Demo HackU
PHP Basics and Demo HackUPHP Basics and Demo HackU
PHP Basics and Demo HackU
 

Plus de julien pauli

Php extensions workshop
Php extensions workshopPhp extensions workshop
Php extensions workshop
julien pauli
 
Understanding PHP memory
Understanding PHP memoryUnderstanding PHP memory
Understanding PHP memory
julien pauli
 
Communications Réseaux et HTTP avec PHP
Communications Réseaux et HTTP avec PHPCommunications Réseaux et HTTP avec PHP
Communications Réseaux et HTTP avec PHP
julien pauli
 
PHPTour-2011-PHP_Extensions
PHPTour-2011-PHP_ExtensionsPHPTour-2011-PHP_Extensions
PHPTour-2011-PHP_Extensions
julien pauli
 
PHPTour 2011 - PHP5.4
PHPTour 2011 - PHP5.4PHPTour 2011 - PHP5.4
PHPTour 2011 - PHP5.4
julien pauli
 
Patterns and OOP in PHP
Patterns and OOP in PHPPatterns and OOP in PHP
Patterns and OOP in PHP
julien pauli
 

Plus de julien pauli (16)

Doctrine with Symfony - SymfonyCon 2019
Doctrine with Symfony - SymfonyCon 2019Doctrine with Symfony - SymfonyCon 2019
Doctrine with Symfony - SymfonyCon 2019
 
Dns
DnsDns
Dns
 
Basics of Cryptography - Stream ciphers and PRNG
Basics of Cryptography - Stream ciphers and PRNGBasics of Cryptography - Stream ciphers and PRNG
Basics of Cryptography - Stream ciphers and PRNG
 
Mastering your home network - Do It Yourself
Mastering your home network - Do It YourselfMastering your home network - Do It Yourself
Mastering your home network - Do It Yourself
 
Tcpip
TcpipTcpip
Tcpip
 
PHP 7 new engine
PHP 7 new enginePHP 7 new engine
PHP 7 new engine
 
PHP 7 performances from PHP 5
PHP 7 performances from PHP 5PHP 7 performances from PHP 5
PHP 7 performances from PHP 5
 
Php extensions workshop
Php extensions workshopPhp extensions workshop
Php extensions workshop
 
Understanding PHP memory
Understanding PHP memoryUnderstanding PHP memory
Understanding PHP memory
 
Communications Réseaux et HTTP avec PHP
Communications Réseaux et HTTP avec PHPCommunications Réseaux et HTTP avec PHP
Communications Réseaux et HTTP avec PHP
 
PHPTour-2011-PHP_Extensions
PHPTour-2011-PHP_ExtensionsPHPTour-2011-PHP_Extensions
PHPTour-2011-PHP_Extensions
 
PHPTour 2011 - PHP5.4
PHPTour 2011 - PHP5.4PHPTour 2011 - PHP5.4
PHPTour 2011 - PHP5.4
 
Patterns and OOP in PHP
Patterns and OOP in PHPPatterns and OOP in PHP
Patterns and OOP in PHP
 
ZendFramework2 - Présentation
ZendFramework2 - PrésentationZendFramework2 - Présentation
ZendFramework2 - Présentation
 
AlterWay SolutionsLinux Outils Industrialisation PHP
AlterWay SolutionsLinux Outils Industrialisation PHPAlterWay SolutionsLinux Outils Industrialisation PHP
AlterWay SolutionsLinux Outils Industrialisation PHP
 
Apache for développeurs PHP
Apache for développeurs PHPApache for développeurs PHP
Apache for développeurs PHP
 

Dernier

Dernier (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
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)
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
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
 
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...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
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...
 

PHP Tips for certification - OdW13

  • 2. .:PHP:.       web interpreted language Auto. memory management Weakly typed Highly dynamic Light and efficient Cross-plateform
  • 3. PHP gotcha !  Highly dynamic language  Borrows some concepts from perl / C  Lots of weird behaviors  To be known  Certification exam can fool you with such behaviors
  • 4. PHP gotcha if (DONT_EXIST) { echo "true"; } else { echo "false"; }
  • 5. PHP gotcha revealed if (DONT_EXIST) { echo "true"; } else { echo "false"; } if ("DONT_EXIST") if (true)
  • 6. PHP gotcha $text = "foo and bar"; if (strpos($text, "foo") { echo "foo is here"; } else { echo "foo is not here"; }
  • 8. PHP gotcha revealed echo (true?'true':false?'t':'f'); echo ( (true?'true':false) ?'t':'f' );
  • 9. PHP gotcha $a = 'foobar'; $a[10] = 'foo'; var_dump($a);
  • 10. PHP gotcha revealed $a = 'foobar'; $a[10] = 'foo'; var_dump($a); string(11) "foobar f"
  • 11. PHP gotcha $a = 11; $a = $a++ + ++$a; echo $a++;
  • 12. PHP gotcha revealed $a = 11; $a = $a++ + ++$a; echo $a++; $a = 11; $a = 11 + 13; //24 echo 24;
  • 13. PHP gotcha $array = array(1 => "Julien", "1" => "Seb", "Mag", 2 => "Leo"); echo count($array);
  • 14. PHP gotcha revealed $array = array(1 => "Julien", "1" => "Seb", "Mag", 2 => "Leo"); echo count($array); $array = array( "1" => "Seb", 2 => "Leo"); 2
  • 15. PHP gotcha $a = 'foo'; $b = 'bar'; echo $a . print('baz') . $b;
  • 16. PHP gotcha revealed $a = 'foo'; $b = 'bar'; echo $a . print('baz') . $b; echo $a . print("baz" . $b); "bazbarfoo1"
  • 17. PHP gotcha echo 0123 + 123 + 0;
  • 18. PHP gotcha revealed echo 0123 + 123 + 0; echo 83 + 123 + 0;
  • 19. PHP gotcha $a = 'baz'; $a++; echo $a;
  • 20. PHP gotcha revealed $a = 'baz'; $a++; echo $a; "bba"
  • 21. PHP Tips  PHP is full of functions and extensions  Let's oversee some useful features
  • 22. PHP Tip  Array Flattening $input = array('a', 'b', array('c', 'd'), 'e', array('f'), 'g'); $output = iterator_to_array(new RecursiveIteratorIterator( new RecursiveArrayIterator($input)), FALSE); var_dump($output); array('a', 'b', 'c', 'd', 'e', 'f', 'g');
  • 23. PHP Tip  Automatic HTML cleaning ob_start('ob_tidyhandler'); echo '<p>test</i>'; <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 3.2//EN"> <html> <head> <title></title> </head> <body> <p>test</p> </body> </html>
  • 24. PHP Tip  Get usefull info from MySQL mysqli_report(MYSQLI_REPORT_INDEX); $db = mysqli_connect('srv1', 'john', 'secret', 'my_db'); mysqli_query($db, "SELECT photo FROM Users WHERE source !='' LIMIT 1000"); PHP Warning: mysqli_query(): (00000/0): No index used in query/prepared statement SELECT photo FROM Users WHERE source !='' LIMIT 1000
  • 25. PHP Tip  Apply a callback to every fetch from MySQL $sql = "SELECT nom, prenom FROM auteurs"; $stmt = $pdo->query($sql); $func = function ($nom, $prenom){printf('%s-%s',$nom,$prenom);}; $result = $stmt->fetchAll(PDO::FETCH_FUNC, $func);
  • 26. PHP Tip  List a type of weekday coming in calendar $begin = new DateTime('2009-11-01'); $end = new DateTime; // now $interval = DateInterval::createFromDateString('next sunday'); $period = new DatePeriod($begin, $interval, $end); foreach ( $period as $dt ) { echo $dt->format( "l Y-m-d H:i:sn" ); } Sunday 2009-11-01 00:00:00 Sunday 2009-11-08 00:00:00 Sunday 2009-11-15 00:00:00 ...
  • 27. PHP Certification  70 Questions – 90min  PHP 5.5  Functions – OOP – arrays – streams – Xml – Databases – Json – strings – securité – Ios – HTTP ...  Nothing known about how to pass the exam  Better know maximum of subjects
  • 28. PHP certif quick overview What's the output of this script ? <?php function oranges(&$oranges = 17) { $oranges .= 1; } $apples = 5; oranges($apples); echo $apples++; A)16 B)51 C)15 D)6 E)52
  • 29. PHP certif quick overview What's design pattern can you recognize ? <?php class MyClassBuilder { public function build() { return new MyClass(); } } A)builder B)factory C)singleton D)observer E)other pattern
  • 30. PHP certif quick overview In SimpleXML, you can use ______ method on SimpleXmlElement to get all its children
  • 31. PHP certif quick overview What's the output of this script ? <?php class Foo { const BAR = 4+1; } echo Foo::BAR; A)4 B)5 C)1 D)an error