cvs: presentations /slides/intro php53.xml yql2.xml

From: Date: Wed, 17 Jun 2009 00:50:37 +0000
Subject: cvs: presentations /slides/intro php53.xml yql2.xml
Groups: php.pres 
Request: Send a blank email to pres+get-1576@lists.php.net to get a copy of this message
rasmus Wed Jun 17 00:50:37 2009 UTC Modified files: /presentations/slides/intro php53.xml yql2.xml Log: Tweaks http://cvs.php.net/viewvc.cgi/presentations/slides/intro/php53.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/intro/php53.xml diff -u presentations/slides/intro/php53.xml:1.2 presentations/slides/intro/php53.xml:1.3 --- presentations/slides/intro/php53.xml:1.2 Fri May 15 12:00:48 2009 +++ presentations/slides/intro/php53.xml Wed Jun 17 00:50:37 2009 @@ -2,7 +2,9 @@ <break lines="1" /> -<example fontsize="1.4em" result='1' title="Closures"><![CDATA[<?php +<blurb fontsize="4em">Closures - http://php.net/functions.anonymous</blurb> + +<example fontsize="1.4em" result='1' title=""><![CDATA[<?php $getClosure = function($v) { return function() use($v) { echo "Hello World: $v!\n"; @@ -13,7 +15,10 @@ $closure(); ?>]]></example> -<example fontsize="1.4em" result='0' title="Namespaces"><![CDATA[<?php +<break lines="1" /> +<blurb fontsize="4em">Namespaces - http://php.net/namespaces</blurb> + +<example fontsize="1.4em" result='0' title=""><![CDATA[<?php // foo.php namespace foo; @@ -32,21 +37,29 @@ <example fontsize="1.4em" hide="1" result='1' title="Output"><![CDATA[foo\bar]]></example> -<example fontsize="1.4em" result='1' title="Late Static Binding"><![CDATA[<?php -class TestClass { - public static function createInstance() { - return new static(); +<break lines="1" /> +<blurb fontsize="4em">Late Static Binding - http://php.net/lsb</blurb> + +<example fontsize="1.4em" result='1' title=""><![CDATA[<?php +class A { + public static function who() { + echo __CLASS__; + } + public static function test() { + self::who(); // Normal class resolution + static::who(); // LSB } } -class ChildClass extends TestClass {} - -$testClass = TestClass::createInstance(); -$childClass = ChildClass::createInstance(); +class B extends A { + public static function who() { + echo __CLASS__; + } +} -echo get_class($testClass) . "<br>\n"; -echo get_class($childClass) . "<br>\n"; -?>]]></example> +B::test(); +?> +]]></example> <example fontsize="1.4em" result="1" title="get_called_class"><![CDATA[<?php abstract class Singleton { @@ -74,19 +87,28 @@ echo '</pre>'; ?>]]></example> -<example fontsize="1.4em" result='1' title="NOWDOC"><![CDATA[<?php +<break lines="1" /> +<blurb fontsize="4em">NOWDOC - http://php.net/nowdoc</blurb> + +<example fontsize="1.4em" result='1' title=""><![CDATA[<?php echo <<< 'EOB' NOWDOC is to HEREDOC as single quoted $trings are\n to double quoted $trings in PHP. EOB; ?>]]></example> -<example fontsize="1.4em" result='1' title="?:"><![CDATA[<?php +<break lines="1" /> +<blurb fontsize="4em">Ternary Shortcut</blurb> + +<example fontsize="1.4em" result='1' title=""><![CDATA[<?php echo true ?: 'Hello'; echo false ?: 'World'; ?>]]></example> -<example fontsize="1.4em" result='0' title="goto"><![CDATA[<?php +<break lines="1" /> +<blurb fontsize="4em">goto - http://php.net/goto</blurb> + +<example fontsize="1.4em" result='0' title=""><![CDATA[<?php function foo() { for($i=0, $j=1; $i<10; $i++) { while($j++) { @@ -100,13 +122,16 @@ } ?>]]></example> -<example fontsize="1.4em" result="1" title="DateInterval/DatePeriod"><![CDATA[<?php -$db = new DateTime( '2008-12-31' ); -$de = new DateTime( '2009-12-31' ); +<break lines="1" /> +<blurb fontsize="4em">DateInterval/DatePeriod</blurb> + +<example fontsize="1.4em" result="1" title=""><![CDATA[<?php +$db = new DateTime('2008-12-31'); +$de = new DateTime('2009-12-31'); $di = DateInterval::createFromDateString('third tuesday of next month'); $dp = new DatePeriod($db, $di, $de, DatePeriod::EXCLUDE_START_DATE); foreach($dp as $dt) { - echo $dt->format( "F jS\n" ) . "<br>\n"; + echo $dt->format("F jS\n") . "<br>\n"; } ?>]]></example> http://cvs.php.net/viewvc.cgi/presentations/slides/intro/yql2.xml?r1=1.2&r2=1.3&diff_format=u Index: presentations/slides/intro/yql2.xml diff -u presentations/slides/intro/yql2.xml:1.2 presentations/slides/intro/yql2.xml:1.3 --- presentations/slides/intro/yql2.xml:1.2 Tue Feb 17 22:41:45 2009 +++ presentations/slides/intro/yql2.xml Wed Jun 17 00:50:37 2009 @@ -12,7 +12,7 @@ select * from html where xpath= '//tr//a[@href="/wiki/Capital_(political)"]/../../../td[2]/a/text()' and url in (select url from search.web where url like '%wikipedia%' - and query='Denmark' limit 1) + and query='South Africa' limit 1) EOB; $o->fetch("$url?q=".rawurlencode($q)."&format=json"); /* Uncomment for debugging

« previous php.pres (#1576) next »