Defining php5.4 by rasmus lerdorf


Older PHP

what was he thinking?

  • case insensitive function names naming inconsistencies?
  • whats with the $ signs?
  • registe_globals?
  • magic_quotes?
  • performance: mod_php
  • shared -nothing perfect sandbox model

robustness:

  • sql LIMIT clause
  • promote perfork shared nothing model

security:

  • max_execution_time
  • memory_limit
  • safe mode

 PHP5.4
Performance improvement:

  • Fast CGI request handling
  • better memory hadling
  • startup shutdown
  • repeated run-time function binding
  • string constants
  • access to global constants
  • access to static properties
  • empty hashes
  • @operator
  • unseralize()
  1. Built-in Web Server
  2. traits sks Horizontal code reuse(its similar to inheritance )

short array syntax:

<?php $a=[1,2,3]; $b=["foo"=>"ornage","bar"=>"apple"];

function array dereferencing:

<?php
function fruits(){
return array(“apple”,”orange”,”banana”);
}
echo fruits()[0];//outputs apple

  1. $this from current scope supported in closures
  2. $this is used access private properties in a class
<?php class Foo{
private #prop=”bar”;
public function getPrinter(){
return function(){
echo ucfirst($this->prop);};
}
 
  • <? is always avaible
  • New Session Object Callable
  • Typehint Better support for asian chars in htmlspecialchars/htmlentities
  • multubyte support is now configurable at runtime
  • json improvements jsonserializable:

class Foo implements JsonSerializable{

private $data=”bar”; public function jsonserialize(){

return array(“data”=>$this->data);}}
echo json_encode(new Foo);//out put {“data”:”bar”}

  • mysqlnd used by default everywhere
  • iterator support added to mysqli(mysqli result implements tracersable)

binary notaion:

<?php $mask =0b010101;

  • AES Support added to OpenSSL
  • Tokyo Cabinet and DB5 support added to dba
  • default charset is UTF-8 instead of ISO-8859-I
  • register_globals completely removed
  • magic quotes completely removed
  • removed varible break/continue
  • max_input_var(default 1000)
  • callable,insteadof and trait are now reserved word

extending an abstract constructor most match the signature:

<?php
abstract class Base {
abstract public function __construct();
}
class Foo extends Base{
public function __construct($bar){}
//FATAL Declaration of Foo:__contruct must be compatiable
//with Base::__construct()

  • stream_select() preserves keys of array arg
  • XSLT writes are disbled by default
  • mcrypt_generic_end() removed in favour of mcrypt_generic_deinit()
  • mysql_list_dbs() removed
Advertisements
About

myself pramodh kumar yet another php developer from India and have worked on oops,procedural,yii framework,codeigniter,wordpress,joomla,api and more.

Tagged with: , , , , , , ,
Posted in php

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow php tutorial on WordPress.com
categories
Calendar
April 2014
M T W T F S S
« Mar   May »
 123456
78910111213
14151617181920
21222324252627
282930  
Follow me on Twitter
Blog Stats
  • 74,607 hits
%d bloggers like this: