LifeMichael

LifeMichael

Haim Michael Blog

LifeMichael RSS Feed
 
 
 
 

Posts tagged PHP 5.4

Arrays Short Syntax in PHP 5.4 PRO

As of PHP 5.4 we can create new arrays in a simple way. Simpler than ever. The following code sample shows that. <?php $vec_a = [4,6,2,7]; $vec_b = ['a'=>'australia','b'=>'belgium','c'=>'canada']; foreach($vec_a as $k=>$v) { echo ” “.$k.”=>”.$v; } foreach($vec_b as $k=>$v) { echo ” “.$k.”=>”.$v; } ?> The following video clip shows the execution of this [...]

Array Dereference in PHP 5.4 PRO

As of PHP 5.4 we can develop a function that returns an array and treat the call to that function as an array we want to access its elements. <?php function doSomething() { $vec = [23,53,75,64]; return $vec; } echo doSomething()[0]; ?> The following video clip shows the execution of this code sample and explains [...]

PHP 5.4 Access Members on Instantiation PRO

PHP 5.4 allows us to access class members on the instantiation. We will use this special capability in those rare cases in which the only reason for creating the object is in order to allow us to access one of the class members. <? class Utils { function calc($numA,$numB) { return $numA+$numB; } } $temp [...]

PHP 5.4 Support for Binary Format PRO

As of PHP 5.4 we can include in our code numbers written in a binary format. We just need to precede these numbers with ’0b’. <? $a = 0b1110; //14 $b = 0b1011; //11 $c = $a & $b; //0b1010 echo $c; ?> The following video clip shows how this code executes and provides more [...]

Facebook Page

Life Youtube

Categories

Communities


Certifications




Tags

Speaker Wiki

My Facebook

Technorati

Add to Technorati Favorites

Recommend

Archives

Countries I Visited


visited 17 states (7.55%)
Create Your Own Map!

ClustrMaps

Recent Searches

FeedJIT

Google Page Rank

Alexa Stats

Courses I Teach


 

My Free Lectures


 

 

 

My Free eBooks


 

 

 

 

 

 

 

 

 

 

 

 

 

 

Courses 1996

Courses 1997

Courses 1998

Courses 1999

Courses 2000

Courses 2001

Courses 2002

Courses 2003

Courses 2004

Courses 2005

Courses 2006

Courses 2007

Courses 2008

Courses 2009

Courses 2010

Courses 2011

Courses 2012

Courses 2013