About me
Application Developer
▹ PHP
▹ XSLT/XPath
▹ (some) Javascript
papaya CMS
▹ PHP based Content Management System
▹ uses XSLT for Templates
Thomas Weinert, papaya Software GmbH 2
PHP 5.3
„PHP 5.3 is still young“
Thomas Weinert, papaya Software GmbH 3
PHP 5.3
Thomas Weinert, papaya Software GmbH 4
PHP 6
„PHP 6 is already in development“
Thomas Weinert, papaya Software GmbH 5
PHP 6
… for some years ...
Thomas Weinert, papaya Software GmbH 6
PHP 5.3
What do we get?
Thomas Weinert, papaya Software GmbH 7
Bugfixes
All Closed Open Critical Verified Analyzed
13085 4007(199) 919 (50) 2 11 2
Assigned Suspended Feedback No Wont fix Bogus
Feedback
261 26 45 1651 350 5806
Thomas Weinert, papaya Software GmbH 8
Performance
Performance
about 5 – 15% or more?
Thomas Weinert, papaya Software GmbH 9
Garbage Collection
gc_enable()
▹ Activates the circular reference collector
gc_collect_cycles()
▹ Forces collection of any existing garbage cycles.
gc_disable()
gc_enabled()
Thomas Weinert, papaya Software GmbH 10
PHP.INI
per directory (like .htaccess)
▹ Cached
[PATH=/opt/httpd/www.example.com/]
[HOST=www.example.com]
Ini „variables“
absolute paths for extensions
Thomas Weinert, papaya Software GmbH 11
Extensions Changed
PCRE, Reflection, SPL
▹ can not be disabled any more
MySQL(i)
▹ mysqlnd
SQLite
▹ SQLite 3 Support
GD
▹ removed GD1 and Freetype1 support
Thomas Weinert, papaya Software GmbH 12
Extensions Moved
Moved to PECL
▹ fdf
▹ ncurses
▹ sybase
▹ ming
▹ dbase
▹ fbsql
▹ mime_magic
Thomas Weinert, papaya Software GmbH 13
INTL
ICU
▹ International Components for Unicode
Internationalization
▹ String functions
▹ Collator
▹ Number Formatter
▹ Message Formatter
▹ Normalizer
▹ Locale
Thomas Weinert, papaya Software GmbH 17
PHAR
PHP applications in one package
easy distribution and installation
verify archive integrity
PHP stream wrapper
tar and zip
Phar format with stub
<?php
include
'phar:///path/to/myphar.phar/file.php';
?> Weinert, papaya Software GmbH
Thomas 18
PHAR
Using a stub
Makes a PHAR file a PHP script
<?php
Phar::webPhar();
__HALT_COMPILER();
http://www.domain.tld/app.phar/page.php
Thomas Weinert, papaya Software GmbH 19
SPL
Now always enabled
many iterators and recursive iterators
SPLFixedArray
http://www.php.net/spl
Thomas Weinert, papaya Software GmbH 20
Error Reporting
E_DEPRECATED splitted from E_STRICT
E_DEPRECATED included in E_ALL
is_a() is not in E_DEPRECATED any more
▹ but documentation still says it is
Thomas Weinert, papaya Software GmbH 21
Static
Late Static Binding
__callStatic
static::foo
Thomas Weinert, papaya Software GmbH 23
LSB - Why
<?php
class bar {
public function show() {
var_dump(new self);
}
}
class foo extends bar {
public function test() {
parent::show();
}
}
$foo = new foo;
$foo->test();
?> object(bar)#2 (0) { }
Thomas Weinert, papaya Software GmbH 24
LSB - Why
<?php
class bar {
public function show() {
var_dump(new static);
}
}
class foo extends bar {
public function test() {
parent::show();
}
}
$foo = new foo;
$foo->test();
?> object(foo)#2 (0) { }
Thomas Weinert, papaya Software GmbH 25
Dynamic Static Calls
<?php
class foo {
function bar() {
var_dump('Hello World');
}
}
foo::bar();
$o = new foo();
$o::bar();
$s = 'foo';
$s::bar();
?>
Thomas Weinert, papaya Software GmbH 26
Namespace Separator
Old Current
▹ Double Colon ▹ Backslash?
▹ Paamayim ▹ Discussion started
Nekudotayim
:: \\
Thomas Weinert, papaya Software GmbH 32
Namespaces: Classes
<?php
namespace carica::core::strings;
const CHARSET = 'utf-8';
class escape {
public static function forXML($content) {
return htmlspecialchars(
$content, ENT_QUOTES, CHARSET
);
}
}
?>
Thomas Weinert, papaya Software GmbH 33
Use Namespaces
...
namespace carica::frontend;
use carica::core::strings as strings;
...
public function execute() {
echo strings::escape::forXML(
'Hello World'
);
}
...
Thomas Weinert, papaya Software GmbH 34
Namespaces: Constants
PHP-Wiki:
▹ constants are case-sensitive, but namespaces are
case-insensitive.
▹ defined() is not aware of namespace aliases.
▹ the namespace part of constants defined with
const are lowercased.
Thomas Weinert, papaya Software GmbH 35
0 comments
Post a comment