Copyright © 2007, Zend Technologies Inc. What’s coming in PHP 5.3 By Stas Malyshev.

Slides:



Advertisements
Similar presentations
Chapter 16 Java Virtual Machine. To compile a java program in Simple.java, enter javac Simple.java javac outputs Simple.class, a file that contains bytecode.
Advertisements

A Program Transformation For Faster Goal-Directed Search Akash Lal, Shaz Qadeer Microsoft Research.
Introduction to PHP Dr. Charles Severance
Java Review Interface, Casting, Generics, Iterator.
Web Application Development Slides Credit Umair Javed LUMS.
W3C XML Schema: what you might not know (and might or might not like!) Noah Mendelsohn Distinguished Engineer IBM Corp. October 10, 2002.
Что нового в PHP 5.3 Дмитрий Стогов. Немного о себе сотрудник Zend Technologies отдел Advanced Technologies активный разработчик PHP и ZE автор и мантейнер.
Reviews for Exam 1 Chapter 1-4 CSc 212 Data Structures, Sec FG CCNY, Fall 2010.
George Blank University Lecturer. CS 602 Java and the Web Object Oriented Software Development Using Java Chapter 4.
1. 2 FUNCTION INLINE FUNCTION DIFFERENCE BETWEEN FUNCTION AND INLINE FUNCTION CONCLUSION 3.
Stéphane Ducasse5.1 Smalltalk in a Nutshell OO Model in a Nutshell Syntax in a Nutshell.
IT PUTS THE ++ IN C++ Object Oriented Programming.
Copyright © 2007 Ramez Elmasri and Shamkant B. Navathe Slide
Differences between C# and C++ Dr. Catherine Stringfellow Dr. Stewart Carpenter.
Review for Midterm Chapter 1-9 CSc 212 Data Structures.
Java and C++, The Difference An introduction Unit - 00.
AGI + PHP “Making phones jump through fiery hoops of death.” Rob Peck dealnews.com PHP Appalachia 2008.
Presented by: Mojtaba Khezrian. Agenda Object Creation Object Storage More on Arrays Parameter Passing For Each VarArgs Spring 2014Sharif University of.
Design patterns. What is a design pattern? Christopher Alexander: «The pattern describes a problem which again and again occurs in the work, as well as.
File I/O Applied Component-Based Software Engineering File I/O CSE 668 / ECE 668 Prof. Roger Crawfis.
Functional Programming Universitatea Politehnica Bucuresti Adina Magda Florea
Martin Kruliš This is an Object Oriented system. If we change something, the users object by Martin Kruliš (v1.0)1.
Algorithm Programming Bar-Ilan University תשס"ח by Moshe Fresko.
The MySQL General Purpose Routine library Giuseppe Maxia.
Creating Dynamic Web Pages Using PHP and MySQL CS 320.
Object Oriented Programming in PHP. Topics Quick OOP Review Classes Magic Methods Static Methods Inheritance Exceptions Interfaces Operators Type Hinting.
The HipHop Compiler from Facebook By Megha Gupta & Nikhil Kapoor.
Netprog: Java Intro1 Crash Course in Java. Netprog: Java Intro2 Why Java? Network Programming in Java is very different than in C/C++ –much more language.
PHP+MySQL Integration. Connecting to databases One of the most common tasks when working with dynamic webpages is connecting to a database which holds.
PHP2. PHP Form Handling The PHP $_GET and $_POST variables are used to retrieve information from forms, like user input. Name: Age:
1 SystemVerilog Enhancement Requests Daniel Schostak Principal Engineer February 26 th 2010.
Java Objects and Classes. Overview n Creating objects that belong to the classes in the standard Java library n Creating your own classes.
PHP(hyper test pre-procsesor)
PHP PHP: Hypertext Preprocesor Personal Home Page Tools.
What Does PHP 5.3 Mean for Drupal? C.M. Lubinski Drupal Camp Chicago
Just a Little PHP Programming PHP on the Server. Common Programming Language Features Comments Data Types Variable Declarations Expressions Flow of Control.
Peyman Dodangeh Sharif University of Technology Fall 2013.
C++ Memory Overview 4 major memory segments Key differences from Java
CS 2130 Lecture 5 Storage Classes Scope. C Programming C is not just another programming language C was designed for systems programming like writing.
Comments in PHP In PHP, we use // to make a singleline comment or /* and */ to make a large comment block. Comment is a part of your PHP code that will.
Hank Childs, University of Oregon May 19 th & 21st, 2015 CIS 330: _ _ _ _ ______ _ _____ / / / /___ (_) __ ____ _____ ____/ / / ____/ _/_/ ____/__ __ /
COS 461 Recitation 7 Remote Procedure Calls. Let’s Look at Layers Again.
Java Basics Opening Discussion zWhat did we talk about last class? zWhat are the basic constructs in the programming languages you are familiar.
Semantics CSE 340 – Principles of Programming Languages Fall 2015 Adam Doupé Arizona State University
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
הרצאה 4. עיבוד של דף אינטרנט דינמי מתוך Murach’s PHP and MySQL by Joel Murach and Ray Harris.  דף אינטרנט דינמי משתנה עפ " י הרצת קוד על השרת, יכול להשתנות.
Martin Kruliš by Martin Kruliš (v1.1)1.
Programming Languages and Paradigms Activation Records in Java.
Programming Fundamentals. Topics to be covered Today Recursion Inline Functions Scope and Storage Class A simple class Constructor Destructor.
Advanced Object-oriented Design Patterns Creational Design Patterns.
Peyman Dodangeh Sharif University of Technology Spring 2014.
Threads. Readings r Silberschatz et al : Chapter 4.
Written by: Dr. JJ Shepherd
CGS 3066: Web Programming and Design Spring 2016 PHP.
RealTimeSystems Lab Jong-Koo, Lim
Objects and Memory Mehdi Einali Advanced Programming in Java 1.
Advanced Programming in C
Ruby: An Introduction Created by Yukihiro Matsumoto in 1993 (named after his birthstone) Pure OO language (even the number 1 is an instance of a class)
Overview 4 major memory segments Key differences from Java stack
Advance OOP in PHP.
Chapter 1-4 CSc 212 Data Structures, Sec AB CCNY, Spring 2012
Server-Side Application and Data Management IT IS 3105 (Spring 2010)
Laruence 14-May-2011 PHP Performance laruence 14-May-2011.
Overview 4 major memory segments Key differences from Java stack
Overview of Memory Layout in C++
More Object-Oriented Programming
.Net Framework Details Imran Rashid CTO at ManiWeber Technologies.
Program Execution in Linux
Classes and Objects Imran Rashid CTO at ManiWeber Technologies.
Hans Zaunere, Managing Member
Presentation transcript:

Copyright © 2007, Zend Technologies Inc. What’s coming in PHP 5.3 By Stas Malyshev

| 3-Jun-15 What's new in PHP 5.3 | vs 5.3 vs is a major version, should be 5½.0 6 taking long time, features drift back No sudden moves in 5.x

| 3-Jun-15 What's new in PHP 5.3 | 3 Syntax Namespaces! Late static binding (static::foo vs self::foo) $classname::method() __callstatic() Goto ?: $NOWDOC = <<‘END’ __DIR__

| 3-Jun-15 What's new in PHP 5.3 | 4 Functions Phar – PHP Archive Pect/intl – ICU support MySQLnd INI magic – per dir, per user,.htaccess-style OpenSSL for OpenID SPL class library Date/time improvements Getopt() support E_DEPRECATED

| 3-Jun-15 What's new in PHP 5.3 | 5 Engine Garbage collection! Stack usage improvements Opcode optimizations System call reduction

| 3-Jun-15 What's new in PHP 5.3 | 6 Namespaces define(“MY_HTTP_GET”, 1); define(“MY_HTTP_POST”, 2); class My_Http_Request { function __construct( $method = ZEND_HTTP_GET) { } function my_http_send_request( My_Http_Request $request) { } namespace My::Http; const GET = 1; const PUT = 2; class Request { function __construct( $method = GET) { } function send_request( Request $request) { }

| 3-Jun-15 What's new in PHP 5.3 | 7 Namespaces Organize OO code into self-contained units Reduce conflicts Shorten names  class Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum_CaseInsensiti ve extends Zend_Search_Lucene_Analysis_Analyzer_Common_TextNum Compile-time definition Mostly compile-time resolution Many NS per file, many files per NS Real names have ::

| 3-Jun-15 What's new in PHP 5.3 | 8 Namespaces – new syntax namespace foo::bar; use foo::bar as baz, boo::hoo::foo; __NAMESPACE__ namespace::foo ::foo() - means global one

| 3-Jun-15 What's new in PHP 5.3 | 9 Late Static Binding Gateway to ActiveRecord class Singleton { const ID = 0; static $instance = array(); static function getInstance() { $id = static::ID; if (empty(self::$instance[$id])) { self::$instance[$id] = new static; } return self::$instance[$id]; } class Foo extends Singleton { const ID = 1; } $x = Foo::getInstance();

| 3-Jun-15 What's new in PHP 5.3 | 10 Dynamic class name Everything can be variable, class name too class DbDriver { const NAME = “MySQLDriver”; static function execute($sql) { } $db = “DbDriver”; echo $db::NAME; $db::execute(“SELCT * FROM foo;”);

| 3-Jun-15 What's new in PHP 5.3 | 11 __callStatic __call’s static cousin class DummyDriver { const NAME = ‘Dummy’; static function __callstatic($name, $args) { echo static::NAME.“::$name is not implemented”; } class MySqlDriver extends DummyDriver { const NAME = ‘MySQL’; } $db = ‘MySqlDriver’; $db::execute(‘SELCT * FROM foo;’);

| 3-Jun-15 What's new in PHP 5.3 | 12 ?: Shortcut for $a?$a:$b $name = $_GET[‘name’] ?: ‘anonymous’;

| 3-Jun-15 What's new in PHP 5.3 | 13 goto Guess what it does ;) RETRY: try { … } catch (Exception $e) { recovery($e); goto RETRY; } Don’t try it at home – unless you know what you do Can’t jump into blocks

| 3-Jun-15 What's new in PHP 5.3 | 14 NOWDOC Repeat after me, exactly as I say it: $a = 3; $b = 5; echo <<<EOF $a+$b EOF;// prints 3+5 echo <<<‘EOF’ $a+$b EOF;// prints $a+$b echo <<<“EOF” $a+$b EOF;// printd 3+5 Note HEREDOC has two syntaxes now

| 3-Jun-15 What's new in PHP 5.3 | 15 __DIR__ __FILE__’s brother – constant dirname(__FILE__) class Foo { const BAR = dirname(__FILE__); // can’t! const BAR = __DIR__; public $bar = dirname(__FILE__); // can’t! public $bar = __DIR__; }

| 3-Jun-15 What's new in PHP 5.3 | 16 Phar Packs multiple PHP files into one.phar Supports streams & includes into phar Supports running CLI and Web apps from phar include ‘phar://mylib.phar/My/Http.php’; $img = ‘phar://mylib.phar/My/img/logo.jpg’; header(‘Content-type: image/jpeg’); echo file_get_contents($img);

| 3-Jun-15 What's new in PHP 5.3 | 17 ICU extension Supports internationalization functions from IBM ICU Collation (plain English: sorting) Number/Date/Message formatting Locale representation Normalization Graphemes

| 3-Jun-15 What's new in PHP 5.3 | 18 INI improvements Localized sections:  [PATH=/var/www/html/mysite]  [HOST= user files  user_ini.filename = “.user.ini”  user_ini.cache_ttl = 300

| 3-Jun-15 What's new in PHP 5.3 | 19 MySQLnd PHP-specific MySQL client library Uses Zend MM Reduces copying of data Uses PHP streams --with-mysql=mysqlnd

| 3-Jun-15 What's new in PHP 5.3 | 20 E_DEPRECATED Functionality that will be removed in next versions

| 3-Jun-15 What's new in PHP 5.3 | 21 Other function improvements OpenSSL support for OpenID  openssl_digest(), openssl_encrypt(), openssl_decrypt(), DH key exchange Getopt() on all OSes with –support-long-options Faster md5() OCI8 connection pooling SPL class library additions:  DoublyLinkedList, Stack, Queue, PriorityQueue, Heap  FilesystemIterator, GlobIterator Date/time improvements  date_create_from_format(), date_get_last_errors()

| 3-Jun-15 What's new in PHP 5.3 | 22 Garbage collector Collects memory lost in loops Invisible to the untrained eye gc_collect_lops, gc_enable, gc_disable $a = array(); $a[0] =& $a;

| 3-Jun-15 What's new in PHP 5.3 | 23 Performance Bench.php

| 3-Jun-15 What's new in PHP 5.3 | 24 Thank you! Questions?