Date post: | 16-Jan-2017 |
Category: |
Engineering |
Upload: | michelangelo-van-dam |
View: | 1,128 times |
Download: | 2 times |
GETTINGHANDSDIRTY
MICHELANGELOVANDAMPHPCONSULTANT&COMMUNITYLEADER
Credits:phpbgonflickr.com
AGENDAWHATHASCHANGEDSINCEPHP5?
WHAT’SNEWINPHP7?
OTHERTHINGSYOUNEEDTOKNOW
MIGRATINGPHP5APPSTOPHP7
CLOSINGREMARKS&QUESTIONS
AGENDAWHATHASCHANGEDSINCEPHP5?
WHAT’SNEWINPHP7?
OTHERTHINGSYOUNEEDTOKNOW
MIGRATINGPHP5APPSTOPHP7
CLOSINGREMARKS&QUESTIONS
BCBREAKCHANGEDBEHAVIORINPHP7
Source:HernánPiñeraonflickr.com
FATALERRORS๏ Fatalandrecoverablefatalerrorsarenow“Throwable”
๏ Theseerrorsinheritfrom“Error”class
๏ The“Errors”classisonthesamelevelasExcepFonclass
๏ Both“Errors”and“ExcepFons”implement“Throwable”interface
๏ Hasaneffecton:
๏ “set_excepFon_handler”:canreceiveErrorsandExcepFons
๏ allinternalclassesnowthrowExcepFononconstructfailure
๏ Parseerrorsnowthrow“ParseError”
EXAMPLEERRORPHP5VS7<?php
$example = new Example(); // PHP 5 error outputs: // PHP Fatal error: Class 'Example' not found in php7-workshop/errors.php on line 4 // PHP Stack trace: // PHP 1. {main}() php7-workshop/errors.php:0
// PHP 7 error outputs: // PHP Fatal error: Uncaught Error: Class 'Example' not found in php7-workshop/errors.php:4 // Stack trace: // #0 {main} // thrown in php7-workshop/errors.php on line 4 // // Fatal error: Uncaught Error: Class 'Example' not found in php7-workshop/errors.php on line 4 // // Error: Class 'Example' not found in php7-workshop/errors.php on line 4 // // Call Stack: // 0.0003 351648 1. {main}() php7-workshop/errors.php:0
EXCEPTIONHANDLING<?php
function exceptionHandler(Exception $e) { echo 'PHP ' . phpversion() . PHP_EOL; echo $e->getMessage() . PHP_EOL; echo $e->getTraceAsString() . PHP_EOL; } set_exception_handler('exceptionHandler');
class Foo { public function bar() { throw new Exception('foo-bar'); } }
$foo = new Foo(); $foo->bar();
// PHP 5.6.4 // foo-bar // #0 php7-workshop/Errors/errorhandler.php(24): Foo->bar() // #1 {main}
// PHP 7.0.2 // foo-bar // #0 php7-workshop/Errors/errorhandler.php(24): Foo->bar() // #1 {main}
THROWABLEEXAMPLE<?php
echo 'PHP ' . phpversion() . PHP_EOL; try { $foo = new foo(); } catch (Exception $e) { echo 'I am an exception: ' . $e->getMessage() . PHP_EOL; } catch (Error $e) { echo 'I am an error: ' . $e->getMessage() . PHP_EOL; } catch (Throwable $t) { echo 'I am throwable: ' . $t->getMessage() . PHP_EOL; }
// PHP 5.6.4 // Fatal error: Class 'foo' not found in // php7-workshop/Errors/throwable.php on line 5
// PHP 7.0.2 // I am an error: Class 'foo' not found
VARIABLEVARIABLES<?php
echo 'PHP ' . phpversion() . PHP_EOL; $foo = [ 'bar' => [ 'baz' => 'foo-bar-baz', 'bay' => 'foo-bar-bay', ], ]; echo $foo['bar']['baz'] . PHP_EOL;
$foo = new \stdClass(); $foo->bar = ['baz' => 'foo-bar-baz']; $bar = 'bar'; echo $foo->$bar['baz'] . PHP_EOL;
// PHP 5.6.4 // foo-bar-baz // // Warning: Illegal string offset 'baz' in php7-workshop/Variable/vars.php on line 15
// PHP 7.0.2 // foo-bar-baz // foo-bar-baz
GLOBALS<?php
echo 'PHP ' . phpversion() . PHP_EOL;
$a = 'Hello'; $$a = 'World!';
function foo() { global $a, $$a; return $a . ' ' . $$a; }
echo foo() . PHP_EOL;
// PHP 5.6.4 // Hello World!
// PHP 7.0.2 // Hello World!
GLOBALS(CONT.)<?php
echo 'PHP ' . phpversion() . PHP_EOL;
$a = 'Hello'; $$a = 'World!';
function foo() { global $a, ${$a}; return $a . ' ' . ${$a}; }
echo foo() . PHP_EOL;
// PHP 5.6.4 // Hello World!
// PHP 7.0.2 // Hello World!
LISTORDER<?php
list ($a[], $a[], $a[]) = [1, 2, 3]; echo 'PHP ' . phpversion() . ': ' . implode(', ', $a) . PHP_EOL;
// PHP 5.6.4: 3, 2, 1 // PHP 7.0.2: 1, 2, 3
list ($b[], $b[], $b[]) = [3, 2, 1]; echo 'PHP ' . phpversion() . ': ' . implode(', ', $b) . PHP_EOL;
// PHP 5.6.4: 1, 2, 3 // PHP 7.0.2: 3, 2, 1
FOREACHINTERNALPOINTER<?php
echo 'PHP ' . phpversion() . PHP_EOL; $a = [0, 1, 2]; foreach ($a as &$val) { var_dump(current($a)); }
// PHP 5.6.4 // int(1) // int(2) // bool(false)
// PHP 7.0.2 // int(0) // int(0) // int(0)
FOREACHITERATIONISSUE<?php
echo 'PHP ' . phpversion() . PHP_EOL; $a = ['a', 'b', 'c'];
foreach ($a as &$item) { echo current($a) . PHP_EOL; // When we reach the end, close with double newline if (false === current($a)) { echo PHP_EOL . PHP_EOL; } }
echo 'Hello World!' . PHP_EOL;
// PHP 5.6.4 // b // c // // // // Hello World!
// PHP 7.0.2 // a // a // a // Hello World!
INVALIDOCTALS<?php
echo 'PHP ' . phpversion() . PHP_EOL; $a = 0128; // faulty octal
var_dump($a);
// PHP 5.6.4 // int(10) -> PHP converted it to 012
// PHP 7.0.2 // // Parse error: Invalid numeric literal in // php7-workshop/Octals/Octals.php on line 4
NEGATIVEBITSHIFTS<?php
echo 'PHP ' . phpversion() . PHP_EOL; var_dump(1 >> -1);
// PHP 5.6.4 // int(0)
// PHP 7.0.2 // PHP Fatal error: Uncaught ArithmeticError: Bit shift by // negative number in php7-workshop/Bitshift/bitshift.php:4 // Stack trace: // #0 {main} // thrown in php7-workshop/Bitshift/bitshift.php on line 4 // // Fatal error: Uncaught ArithmeticError: Bit shift by negative // number in php7-workshop/Bitshift/bitshift.php on line 4 // // ArithmeticError: Bit shift by negative number in // php7-workshop/Bitshift/bitshift.php on line 4 // // Call Stack: // 0.0006 352104 1. {main}() php7-workshop/Bitshift/bitshift.php:0
BITSHIFTOVERFLOW<?php echo 'PHP ' . phpversion() . PHP_EOL; $a = 0b111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111111; echo var_export($a >> 1, true) . PHP_EOL;
// PHP 5.3.29 // Parse error: syntax error, unexpected T_STRING in php7-workshop/Bitshift/outofrangebit.php on line 3
// PHP 5.6.4 // 0
// PHP 7.0.2 // 0
DIVISIONBYZERO<?php
echo 'PHP ' . phpversion() . PHP_EOL;
echo (0 / 0) . PHP_EOL; echo (3 / 0) . PHP_EOL; echo (3 / 0) . PHP_EOL;
// PHP 5.6.4 // // Warning: Division by zero in php7-workshop/Zero/division.php on line 5 // Warning: Division by zero in php7-workshop/Zero/division.php on line 6 // Warning: Division by zero in php7-workshop/Zero/division.php on line 7
// PHP 7.0.2 // Warning: Division by zero in php7-workshop/Zero/division.php on line 5 // NAN // Warning: Division by zero in php7-workshop/Zero/division.php on line 6 // INF// Warning: Division by zero in php7-workshop/Zero/division.php on line 7 // INF
HEXVALUES<?php
echo 'PHP ' . phpversion() . PHP_EOL;
var_dump("0x123" == "291"); var_dump(is_numeric("0x123")); var_dump("0xe" + "0x1"); var_dump(substr("foo", "0x1"));
// PHP 5.6.4 // bool(true) // bool(true) // int(15) // string(2) "oo"
// PHP 7.0.2 // bool(false) // bool(false) // int(0) // // Notice: A non well formed numeric value encountered // in php7-workshop/Hex/hex.php on line 8 // string(3) "foo"
REMOVEDFROMPHP7๏ call_user_*
๏ call_user_method()->call_user_func()
๏ call_user_method_array()->call_user_func_array()
๏ mcrypt_*
๏ mcrypt_generic_end()->mcrypt_generic_deinit()
๏ mcrypt_ecb()->mcrypt_decrypt()
๏ mcrypt_cbc()->mcrypt_decrypt()
๏ mcrypt_cP()->mcrypt_decrypt()
๏ mcrypt_oP()->mcrypt_decrypt()
๏ datefmt_set_Fmezone_id()->datefmt_set_Fmezone()
๏ IntlDateFormaTer::setTimeZoneID()->IntlDateFormaTer::setTimeZone()
๏ set_magic_quotes_runFme()
๏ set_socket_blocking()->stream_set_blocking()
REMOVEDGDFUNCTIONS๏ imagepsbbox()
๏ imagepsencodefont()
๏ imagepsextendfont()
๏ imagepsfreefont()
๏ imagepsloadfont()
๏ imagepsslanWont()
๏ imagepstext()
EXT/MYSQL๏ DeprecatedinPHP5.5
๏ RemovedinPHP7
๏ Allmysql_*funcFons!!!
WILLYOUMISSIT?!?๏ script-tag
<scriptlanguage="php">// PHP code goes here </script>
๏ ASP-tag<%// PHP code goes here %>
<%= 'echoing something here' %>
OTHERREMOVED/CHANGEDITEMS๏ php.ini
๏ always_populate_raw_post_data
๏ asp_tags
๏ xsl.security_prefs
๏ $HTTP_RAW_POST_DATA->php://input
๏ No#inINIfileswithparse_ini_file()orparse_ini_string()->use;
๏ func_get_arg()andfunc_get_args()returnalwayscurrentvalueofarguments(nolongeroriginalvalues)
AGENDAWHATHASCHANGEDSINCEPHP5?
WHAT’SNEWINPHP7?
OTHERTHINGSYOUNEEDTOKNOW
MIGRATINGPHP5APPSTOPHP7
CLOSINGREMARKS&QUESTIONS
PHP7.1-WHAT’SCOMING
NEWFEATURES…
NULLABLETYPE<?php
class Foo { protected $bar;
public function __construct(string $bar = null) { if (null !== $bar) { $this->bar = $bar; } }
public function getBar(): string { return $this->bar; } }
$foo = new Foo(); $bar = $foo->getBar(); var_dump($bar);
NULLABLETYPE<?php
class Foo { protected $bar;
public function __construct(?string $bar = null) { if (null !== $bar) { $this->bar = $bar; } }
public function getBar(): ?string { return $this->bar; } }
$foo = new Foo(); $bar = $foo->getBar(); var_dump($bar);
VOIDFUNCTIONS<?php
class Foo { public function sayHello(string $message): void { echo 'Hello ' . $message . '!' . PHP_EOL; } }
$foo = new Foo(); $foo->sayHello('World');
SYMMETRICARRAYDESTRUCTURING<?php
$talks = [ [1, 'Getting hands dirty with PHP7'], [2, 'Decouple your framework'], [3, 'PHPunit speedup with Docker'], [4, 'Open source your business for success'], ];
// short-hand list notation [$id, $title] = $talks[0]; echo sprintf('%s (%d)', $title, $id) . PHP_EOL; echo PHP_EOL;
// shorthand foreach list notation foreach ($talks as [$id, $title]) { echo sprintf('%s (%d)', $title, $id) . PHP_EOL; }
SUPPORTFORKEYSINLIST()<?php
$talks = [ [1, 'Getting hands dirty with PHP7'], [2, 'Decouple your framework'], [3, 'PHPunit speedup with Docker'], [4, 'Open source your business for success'], ];
// short-hand list notation ['id' => $id, 'title' => $title] = $talks[0]; echo sprintf('%s (%d)', $title, $id) . PHP_EOL; echo PHP_EOL;
// shorthand foreach list notation foreach ($talks as ['id' => $id, 'title' => $title]) { echo sprintf('%s (%d)', $title, $id) . PHP_EOL; }
CLASSCONSTANTVISIBILITY<?php
class ConstDemo { const PUBLIC_CONST_A = 1; public const PUBLIC_CONST_B = 2; protected const PROTECTED_CONST = 3; private const PRIVATE_CONST = 4; }
ITERABLEPSEUDO-TYPE<?php function iterator(iterable $iterable) { foreach ($iterable as $value) { // } }
MULTICATCHEXCEPTIONHANDLING<?php try { // some code } catch (FirstException | SecondException $e) { // handle first and second exceptions }
SUPPORTFORNEGATIVESTRINGOFFSETS<?php
$string = 'ThisIsALongString.php'; echo substr($string, 0, strlen($string) - 4) . PHP_EOL; // Outputs: ThisIsALongString
echo substr($string, 0, -4) . PHP_EOL; // Outputs: ThisIsALongString
CONVERTCALLABLESTOCLOSURESWITHCLOSURE::FROMCALLABLE()<?php class Test { public function exposeFunction() { return Closure::fromCallable([$this, 'privateFunction']); }
private function privateFunction($param) { var_dump($param); } }
$privFunc = (new Test)->exposeFunction(); $privFunc('some value');
ASYNCHRONOUSSIGNALHANDLING<?php pcntl_async_signals(true); // turn on async signals
pcntl_signal(SIGHUP, function($sig) { echo "SIGHUP\n"; });
posix_kill(posix_getpid(), SIGHUP);
HTTP/2SERVERPUSHSUPPORTINEXT/CURL๏ CURLMOPT_PUSHFUNCTION
๏ CURL_PUSH_OK
๏ CURL_PUSH_DENY
PHP7.1:THENEWSTUFF
NEWFUNCTIONS๏ Closure
๏ Closure::fromCallable()
๏ CURL
๏ curl_mulF_errno()
๏ curl_share_errno()
๏ curl_share_strerror()
๏ SPL
๏ is_iterable()
๏ PCNTL
๏ pcntl_async_signals()
NEWGLOBALCONSTANTS๏ CorePredefinedConstants
๏ PHP_FD_SETSIZE
๏ CURL
๏ CURLMOPT_PUSHFUNCTION
๏ CURL_PUST_OK
๏ CURL_PUSH_DENY
๏ DataFiltering
๏ FILTER_FLAG_EMAIL_UNICODE
๏ JSON
๏ JSON_UNESCAPED_LINE_TERMINATORS
NEWGLOBALCONSTANTS(2)๏ PostgreSQL
๏ PGSQL_NOTICE_LAST
๏ PGSQL_NOTICE_ALL
๏ PGSQL_NOTICE_CLEAR
๏ SPL
๏ MT_RAND_PHP
NEWGLOBALCONSTANTS(3)๏ LDAP_OPT_X_SASL_NOCANON
๏ LDAP_OPT_X_SASL_USERNAME
๏ LDAP_OPT_X_TLS_CACERTDIR
๏ LDAP_OPT_X_TLS_CACERTFILE
๏ LDAP_OPT_X_TLS_CERTFILE
๏ LDAP_OPT_X_TLS_CIPHER_SUITE
๏ LDAP_OPT_X_TLS_KEYFILE
๏ LDAP_OPT_X_TLS_RANDOM_FILE
๏ LDAP_OPT_X_TLS_CRLCHECK
๏ LDAP_OPT_X_TLS_CRL_NONE
๏ LDAP_OPT_X_TLS_CRL_PEER
๏ LDAP_OPT_X_TLS_CRL_ALL
๏ LDAP_OPT_X_TLS_DHFILE
๏ LDAP_OPT_X_TLS_CRLFILE
๏ LDAP_OPT_X_TLS_PROTOCOL_MIN
๏ LDAP_OPT_X_TLS_PROTOCOL_SSL2
๏ LDAP_OPT_X_TLS_PROTOCOL_SSL3
๏ LDAP_OPT_X_TLS_PROTOCOL_TLS1_0
๏ LDAP_OPT_X_TLS_PROTOCOL_TLS1_1
๏ LDAP_OPT_X_TLS_PROTOCOL_TLS1_2
๏ LDAP_OPT_X_TLS_PACKAGE
๏ LDAP_OPT_X_KEEPALIVE_IDLE
๏ LDAP_OPT_X_KEEPALIVE_PROBES
๏ LDAP_OPT_X_KEEPALIVE_INTERVAL
BREAKINGBC
THESEMIGHTBREAKSTUFF๏ ThrowonpassingtoofewfuncFonarguments
๏ ForbiddynamiccallstoscopeintrospecFonfuncFons
๏ Invalidclass,interface,andtraitnames
๏ void
๏ iterable
๏ NumericalstringconversionsnowrespectscienFficnotaFon
๏ Fixestomt_rand()algorithm
๏ rand()aliasedtomt_rand()andsrand()aliasedtomt_srand()
๏ DisallowtheASCIIdeletecontrolcharacter(0x7F)inidenFfiers
๏ error_logchangeswithsyslogerrorvalues
THESEMIGHTBREAKSTUFF(2)๏ Donotcalldestructorsonincompleteobjects
๏ call_user_func()handlingofreferencearguments
๏ Theemptyindexoperatorisnotsupportedforstringsanymore
๏ $str[]=$xthrowsafatalerror
๏ RemovedinidirecFves
๏ session.entropy_file
๏ session.entropy_length
๏ session.hash_funcFon
๏ session.hash_bits_per_character
DEPRECATEDFEATURES
THESEARENOWDEPRECATED๏ ext/mcrypt
๏ EvalopFonformb_ereg_replace()andmb_eregi_replace()
CHANGEDFUNCTIONS
PHPCORE๏ getopt()hasanopFonalthirdparameterthatexposestheindexofthenextelementintheargumentvectorlisttobeprocessed.Thisisdoneviaaby-refparameter.
๏ getenv()nolongerrequiresitsparameter.IftheparameterisomiTed,thenthecurrentenvironmentvariableswillbereturnedasanassociaFvearray.
๏ get_headers()nowhasanaddiFonalparametertoenableforthepassingofcustomstreamcontexts.
๏ long2ip()nowalsoacceptsanintegerasaparameter.
๏ output_reset_rewrite_vars()nolongerresetssessionURLrewritevariables.
๏ parse_url()isnowmorerestricFveandsupportsRFC3986.
๏ unpack()nowacceptsanopFonalthirdparametertospecifytheoffsettobeginunpackingfrom.
OTHERCHANGEDFUNCTIONS๏ FileSystem
๏ tempnam()nowemitsanoFcewhenfallingbacktothesystem'stempdirectory.
๏ JSON
๏ json_encode()nowacceptsanewopFon,JSON_UNESCAPED_LINE_TERMINATORS,todisabletheescapingofU+2028andU+2029characterswhenJSON_UNESCAPED_UNICODEissupplied.
๏ MulTbyteString
๏ mb_ereg()nowrejectsillegalbytesequences.
๏ mb_ereg_replace()nowrejectsillegalbytesequences.
๏ PDO
๏ PDO::lastInsertId()forPostgreSQLwillnowtriggeranerrorwhennextvalhasnotbeencalledforthecurrentsession(thepostgresconnecFon).
POSTGRESQL๏ pg_last_noFce()nowacceptsanopFonalparametertospecifyanoperaFon.Thiscanbedonewithoneofthefollowingnewconstants:PGSQL_NOTICE_LAST,PGSQL_NOTICE_ALL,orPGSQL_NOTICE_CLEAR.
๏ pg_fetch_all()nowacceptsanopFonalsecondparametertospecifytheresulttype(similartothethirdparameterofpg_fetch_array()).
๏ pg_select()nowacceptsanopFonalfourthparametertospecifytheresulttype(similartothethirdparameterofpg_fetch_array()).
OTHERCHANGES
OTHERCHANGES๏ NoFcesandwarningsonarithmeFcwithinvalidstrings
๏ NewE_WARNINGandE_NOTICEerrorshavebeenintroducedwheninvalidstringsarecoercedusingoperatorsexpecFngnumbers
๏ E_NOTICEisemiTedwhenthestringbeginswithanumericvaluebutcontainstrailingnon-numericcharacters
๏ E_WARNINGisemiTedwhenthestringdoesnotcontainanumericvalue
๏ Warnonoctalescapesequenceoverflow
๏ Inconsistencyfixesto$this
๏ SessionIDgeneraFonwithouthashing
AGENDAWHATHASCHANGEDSINCEPHP5?
WHAT’SNEWINPHP7?
OTHERTHINGSYOUNEEDTOKNOW
MIGRATINGPHP5APPSTOPHP7
CLOSINGREMARKS&QUESTIONS
OTHERTHINGSTHATCHANGED๏ FuncFon“set_excepFon_handler()”isnolongerguaranteedtoreceiveExcepTonobjectsbutThrowableobjects
๏ ErrorreporFngE_STRICTnoFcesseveritychangesassomehavebeenchangedandwillnottriggeranerror
๏ Thedeprecated“set_socket_blocking()”aliashasbeenremovedinfavourof“stream_set_blocking()”
๏ SwitchstatementscannothavemulFpledefaultblocks
๏ FuncFonscannothavemulFpleparameterswiththesamename
๏ PHPfuncFons“func_get_arg()”and“func_get_args()”nowreturncurrentargumentvalues
PHP7PERFORMANCE
PERFORMANCECOMPARISONTOOTHERLANGUAGES
Source:ZendPHP7Infograph
PERFORMANCEYIIFRAMEWORK
Source:caleblloyd.com
AGENDAWHATHASCHANGEDSINCEPHP5?
WHAT’SNEWINPHP7?
OTHERTHINGSYOUNEEDTOKNOW
MIGRATINGPHP5APPSTOPHP7
CLOSINGREMARKS&QUESTIONS
DOMAINMODELS
DOMAINMODELS<?php namespace DragonBe\php7workshop;
class User { /** @var string $name The Name of the User */ protected $name; /** @var int $age The age of the User */ protected $age;
/** * User constructor. * * @param string $name The name of the User * @param int $age The age of the User */ public function __construct($name = '', $age = 0) { $this->setName($name) ->setAge($age); }
/** * Sets the name of the User * * @param string $name The name of the User * @return User */ public function setName($name) { $this->name = (string) $name; return $this; }
/** * Retrieve the name of the User * * @return string */ public function getName() { return $this->name; }
/** * Sets the age of the User * * @param int $age * @return User */ public function setAge($age) { $this->age = (int) $age; return $this; }
/** * Retrieve the age of the User * @return int */ public function getAge() { return $this->age; } }
DOMAINMODELS(CONT.)<?php namespace DragonBe\php7workshop;
class User { /** @var string $name The Name of the User */ protected $name; /** @var int $age The age of the User */ protected $age;
/** * User constructor. * * @param string $name The name of the User * @param int $age The age of the User * @throws \TypeError */ public function __construct(string $name = '', int $age = 0) { $this->setName($name) ->setAge($age); } }
DOMAINMODELS(CONT.) /** * Sets the name of the User * * @param string $name The name of the User * @return User */ public function setName(string $name): User { $this->name = $name; return $this; }
/** * Retrieve the name of the User * * @return string */ public function getName(): string { return $this->name; }
/** * Sets the age of the User * * @param int $age * @return User */ public function setAge(int $age): User { $this->age = $age; return $this; }
/** * Retrieve the age of the User * @return int */ public function getAge(): int { return $this->age; }
DOMAINMODELS(CONT.)<?php declare(strict_types=1);
require_once __DIR__ . '/User.php';
use \DragonBe\php7workshop\User;
$user = new User('michelangelo', '39'); var_dump($user);
MYSQLEXTENSION
S/MYSQL_/MYSQLI_๏ Onbashyoucouldgrep -r mysql_ *inyourproject’srootdirectorytodiscoverfilessFllusingoldmysqlelements
๏ UseyourIDEandsearchfor“mysql_”
๏ MostoftheFmeyoucanjustreplace“mysql_”with“mysqli_”
INCOMPATIBLEMYSQL_FUNC.๏ mysql_client_encoding()
๏ mysql_list_dbs()(useSHOWDATABASESquery)
๏ mysql_db_name()
๏ mysql_list_fields()
๏ mysql_db_query()
๏ mysql_list_processes()(useSHOWPROCESSLISTquery)
๏ mysql_dbname()
๏ mysql_list_tables()(useSHOWTABLESquery)
๏ mysql_field_flags()
๏ mysql_listdbs()(useSHOWDATABASESquery)
๏ mysql_field_len()
๏ mysql_lisWields()
๏ mysql_field_name()
๏ mysql_lisTables()(useSHOWTABLESquery)
๏ mysql_field_table()
๏ mysql_numfields()
๏ mysql_field_type()
๏ mysql_numrows()(usemysqli_num_rows()instead)
๏ mysql_fieldflags()
๏ mysql_pconnect()(appendp:tothehostnamepassedtomysqli_connect())
๏ mysql_fieldlen()
๏ mysql_result()๏ mysql_fieldname()
๏ mysql_selectdb()(usemysqli_select_db()instead)
๏ mysql_fieldtable()
๏ mysql_table_name()
๏ mysql_fieldtype()
๏ mysql_tablename()
๏ mysql_freeresult()(usemysqli_free_result()instead)
๏ mysql_unbuffered_query()
AGENDAWHATHASCHANGEDSINCEPHP5?
WHAT’SNEWINPHP7?
OTHERTHINGSYOUNEEDTOKNOW
MIGRATINGPHP5APPSTOPHP7
CLOSINGREMARKS&QUESTIONS
NOWREADYFORPHP7ANDMORECOMING…
YOURPROJECTS…TIMETOUPGRADE
in it2PROFESSIONAL PHP SERVICES
Thank you!Slides at in2.se/hd-php7
[email protected] - www.in2it.be - T in2itvof - F in2itvof
PHPUnit
Getting StartedAdvanced Testing
Zend Framework 2
FundamentalsAdvanced
Azure PHP
Quick time to marketScale up and out
jQuery
Professional jQuery
PHP
PHP for beginnersProfessional PHP
HTML & CSS
The Basics
Our training courses
29c51
If you enjoyed this talk, thanks. If not, tell me how to make it better
Leave feedback and grab the slides