SlideShare ist ein Scribd-Unternehmen logo
1 von 20

      
       PHP on Java 
      
     
      
       ,[object Object],
      
     
      
       Robin Fernandes   (ibm) 
       [email_address] 
       @rewbs

      
       PHP ? 
      
     
      
       “ PHP isn't so much a language as a   virtual explosion  at the  keyword and function factory .” 
       - Jeff Atwood 
       from “PHP sucks, but it doesn't matter”

      
       PHP ? 
      
     
      
       in_array( $needle ,  $haystack ); 
       strpos( $haystack ,  $needle ); 
      
     
      
       ... 
       IteratorIterator 
       RecursiveIterator 
       RecursiveIteratorIterator 
       ... 
      
     
      
       strip _ tags() 
       strip s lashes() 
       SDO _ Model _ Property::get C ontaining T ype() 
      
     
      
       ReflectionClass::isItera tea ble()

      
       PHP ! 
      
     
      
       
       
      
     
      
       
      
     
      
       
      
     
      
       
      
     
      
       
      
     
      
       
      
     
      
       
      
     
      
       
      
     
      
       tiobe.com

      
       PHP ! 
      
     
      
       
       
      
     
      
       
      
     
      
       Photo from  DragonBe

      
       PHP !

      
       Why  integrate PHP and Java?  
      
     
      
       
       
      
     
      
       ,[object Object],
       
       “ Pay special attention to opportunities to use  PHP in combination with Java  development efforts” 
      
     
      
       ,[object Object],

      
       Why  run PHP  on the  JVM ?  
      
     
      
       
       
      
     
      
       ,[object Object],
       
       PHP + JVM =  ♥

      
       How  PHP  runs on the  JVM 
      
     
      <?php 
      echo  'hello' ; 
      
       
       
       
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      System. out .println( &quot;hello&quot; );

      
       How  PHP  runs on the  JVM 
      
     
      
       ,[object Object],
      
     
      
       ,[object Object],
      
     
      
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      P8 Runtime 
      
     
      SAPI-J 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      Parser 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      Interpreter 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      P8 Engine 
      
     
      Java  
      Extensions 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      C 
      Extensions 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      Stack 
      
     
      Resources 
      
     
      Classes 
      
     
      Objects 
      
     
      Variables 
      
     
      AST 
      
     
      XAPI-J 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      XAPI-C 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      Native  
      code 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      Compiler 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      .class 
      
       
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      opcodes 
      
     
      Cache 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      Persistent 
      class cache 
      
     
      
       
       
        
        
        
        
        
        
        
        
        
        
        
        
       
      
      
       Debug API  (DBGp) 
       
      
     
      
       
       
        
        
        
        
        
        
        
        
        
        
        
        
       
      
      
       Runtime

      
       Some  Code ! 
      
     
      <?php 
      java_import( &quot;java.util.HashMap&quot; ); 
      $map  =  new  HashMap; 
      
      $map ->put( &quot;stuff&quot; ,  array ( 1 , 2 , 3 , 4 , 5 )); 
      var_dump( $map ->get( &quot;stuff&quot; )); 
      // prints: array(5) { ...

      
       Some more  Code ! 
      
     
      <?php 
      java_import( &quot;java.io.File&quot; ); 
      
      class  SubFile  extends  File { 
      function  isThisCool() { 
      return TRUE ;  // Way cool 
      } 
      } 
      
      $file  =  new  SubFile( &quot;/&quot; ); 
      var_dump( $file ->isDirectory()); 
      var_dump( $file ->isThisCool());

      
       Last bit of  Code ! 
      
     
      <?php 
      java_import( &quot;java.util.ArrayList&quot; ); 
      
      $list  =  new  ArrayList(); 
      $list ->add( &quot;Hello World!&quot; ); 
      $list ->add( FALSE ); 
      $list ->add( 1234567890 ); 
      
      foreach  ( $list  as  $key  =>  $value ) { 
      echo  &quot; $key   $value &quot; ; 
      }

      
       PHP apps  +  Java libraries 
      
     
      
       ,[object Object],

      
       Java apps  +  PHP scripting 
      
     
      
       
       
      
     
      
       ,[object Object],

      
       PHP in  WebSphere sMash 
      
     
      
       
       
      
     
      
       ,[object Object],
      
     
      
       
      
     
      
       
      
     
      
       ,[object Object],
      
     
      
       
      
     
      JVM 
      
      
      
      
      
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      Web Server 
      
     
      Application Code 
      
     
      Language Runtimes

      
       Sorry, one more bit of   Code ! 
      
     
      
       
      
     
      
       
      
     
      class Dynamic { 
      def  storage = [:] 
      def  invokeMethod(String name, args) { 
      println   &quot;Hello!&quot; 
      } 
      def  getProperty(String name) {  
      storage[name]  
      } 
      def  setProperty(String name, value) {  
      storage[name] = value  
      } 
      } 
      
     
      <?php 
      groovy_import( &quot;dynamic.groovy&quot; ); 
      $foo  =  new  Dynamic(); 
      $foo ->bar(); 
      $foo ->guff =  &quot;Hello World!&quot; ; 
      echo  $foo ->guff;

      
       PHP in  Message Broker 
      
     
      
       
       
      
     
      
       
       
      
     
      
       ,[object Object],

      
       PHP in  CICS 
      
     
      
       
       
      
     
      
       ,[object Object],
      
     
      
       
      
     
      
       
      
     
      Transaction Server 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      CICS assets: 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      RESTful API 
      to CICS assets  
      
     
      SupportPac CA1S 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      ... 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      DB2 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      COBOL 
      
       
       
       
       
       
       
       
       
       
       
       
       
      
     
      Java

      
       Learn  more & Try  it out: 
      
     
      
       
       
      
     
      
       
       
       http://projectzero.org/php 
      
     
      
       Thanks! 
       [email_address]   /  @rewbs

Weitere ähnliche Inhalte

Ähnlich wie PHP on Java (BarCamp London 7)

IBM IMPACT 2009 Conference Session 2078 - Extending and Integrating Popular P...
IBM IMPACT 2009 Conference Session 2078 - Extending and Integrating Popular P...IBM IMPACT 2009 Conference Session 2078 - Extending and Integrating Popular P...
IBM IMPACT 2009 Conference Session 2078 - Extending and Integrating Popular P...Robert Nicholson
 
An Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP ProgrammersAn Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP Programmersjphl
 
Phalcon / Zephir Introduction at PHPConfTW2013
Phalcon / Zephir Introduction at PHPConfTW2013Phalcon / Zephir Introduction at PHPConfTW2013
Phalcon / Zephir Introduction at PHPConfTW2013Rack Lin
 
IBM IMPACT 2009 Conference Session 2024 - WebSphere sMash Integration, PHP wi...
IBM IMPACT 2009 Conference Session 2024 - WebSphere sMash Integration, PHP wi...IBM IMPACT 2009 Conference Session 2024 - WebSphere sMash Integration, PHP wi...
IBM IMPACT 2009 Conference Session 2024 - WebSphere sMash Integration, PHP wi...Robert Nicholson
 
Avro - More Than Just a Serialization Framework - CHUG - 20120416
Avro - More Than Just a Serialization Framework - CHUG - 20120416Avro - More Than Just a Serialization Framework - CHUG - 20120416
Avro - More Than Just a Serialization Framework - CHUG - 20120416Chicago Hadoop Users Group
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming ParadigmsLi SUN
 
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for WindowsFord AntiTrust
 
Wakanda: NoSQL & SSJS for Model-driven Web Applications - SourceDevCon 2012
Wakanda: NoSQL & SSJS for Model-driven Web Applications - SourceDevCon 2012Wakanda: NoSQL & SSJS for Model-driven Web Applications - SourceDevCon 2012
Wakanda: NoSQL & SSJS for Model-driven Web Applications - SourceDevCon 2012Alexandre Morgaut
 
Florian adler minute project
Florian adler   minute projectFlorian adler   minute project
Florian adler minute projectDmitry Buzdin
 
Introduction to Apache Camel
Introduction to Apache CamelIntroduction to Apache Camel
Introduction to Apache CamelFuseSource.com
 
Wakanda: NoSQL for Model-Driven Web applications - NoSQL matters 2012
Wakanda: NoSQL for Model-Driven Web applications - NoSQL matters 2012Wakanda: NoSQL for Model-Driven Web applications - NoSQL matters 2012
Wakanda: NoSQL for Model-Driven Web applications - NoSQL matters 2012Alexandre Morgaut
 
What is new and cool j2se & java
What is new and cool j2se & javaWhat is new and cool j2se & java
What is new and cool j2se & javaEugene Bogaart
 
Na pomezi php a vue.js
Na pomezi php a vue.jsNa pomezi php a vue.js
Na pomezi php a vue.jsPeckaDesign.cz
 

Ähnlich wie PHP on Java (BarCamp London 7) (20)

Project Zero JavaOne 2008
Project Zero JavaOne 2008Project Zero JavaOne 2008
Project Zero JavaOne 2008
 
IBM IMPACT 2009 Conference Session 2078 - Extending and Integrating Popular P...
IBM IMPACT 2009 Conference Session 2078 - Extending and Integrating Popular P...IBM IMPACT 2009 Conference Session 2078 - Extending and Integrating Popular P...
IBM IMPACT 2009 Conference Session 2078 - Extending and Integrating Popular P...
 
An Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP ProgrammersAn Introduction to Websphere sMash for PHP Programmers
An Introduction to Websphere sMash for PHP Programmers
 
Phalcon / Zephir Introduction at PHPConfTW2013
Phalcon / Zephir Introduction at PHPConfTW2013Phalcon / Zephir Introduction at PHPConfTW2013
Phalcon / Zephir Introduction at PHPConfTW2013
 
IBM IMPACT 2009 Conference Session 2024 - WebSphere sMash Integration, PHP wi...
IBM IMPACT 2009 Conference Session 2024 - WebSphere sMash Integration, PHP wi...IBM IMPACT 2009 Conference Session 2024 - WebSphere sMash Integration, PHP wi...
IBM IMPACT 2009 Conference Session 2024 - WebSphere sMash Integration, PHP wi...
 
Avro - More Than Just a Serialization Framework - CHUG - 20120416
Avro - More Than Just a Serialization Framework - CHUG - 20120416Avro - More Than Just a Serialization Framework - CHUG - 20120416
Avro - More Than Just a Serialization Framework - CHUG - 20120416
 
Programming Paradigms
Programming ParadigmsProgramming Paradigms
Programming Paradigms
 
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows
/* pOrt80BKK */ - PHP Day - PHP Performance with APC + Memcached for Windows
 
Project Zero Php Quebec
Project Zero Php QuebecProject Zero Php Quebec
Project Zero Php Quebec
 
Wakanda: NoSQL & SSJS for Model-driven Web Applications - SourceDevCon 2012
Wakanda: NoSQL & SSJS for Model-driven Web Applications - SourceDevCon 2012Wakanda: NoSQL & SSJS for Model-driven Web Applications - SourceDevCon 2012
Wakanda: NoSQL & SSJS for Model-driven Web Applications - SourceDevCon 2012
 
DevOps for Developers
DevOps for DevelopersDevOps for Developers
DevOps for Developers
 
Florian adler minute project
Florian adler   minute projectFlorian adler   minute project
Florian adler minute project
 
Dev ops for developers
Dev ops for developersDev ops for developers
Dev ops for developers
 
Turbo charging v8 engine
Turbo charging v8 engineTurbo charging v8 engine
Turbo charging v8 engine
 
Introduction to Apache Camel
Introduction to Apache CamelIntroduction to Apache Camel
Introduction to Apache Camel
 
Guidelines php 8 gig
Guidelines php 8 gigGuidelines php 8 gig
Guidelines php 8 gig
 
Wakanda: NoSQL for Model-Driven Web applications - NoSQL matters 2012
Wakanda: NoSQL for Model-Driven Web applications - NoSQL matters 2012Wakanda: NoSQL for Model-Driven Web applications - NoSQL matters 2012
Wakanda: NoSQL for Model-Driven Web applications - NoSQL matters 2012
 
What is new and cool j2se & java
What is new and cool j2se & javaWhat is new and cool j2se & java
What is new and cool j2se & java
 
Na pomezi php a vue.js
Na pomezi php a vue.jsNa pomezi php a vue.js
Na pomezi php a vue.js
 
Web Dev 21-01-2024.pptx
Web Dev 21-01-2024.pptxWeb Dev 21-01-2024.pptx
Web Dev 21-01-2024.pptx
 

Kürzlich hochgeladen

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfsudhanshuwaghmare1
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...DianaGray10
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDropbox
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Jeffrey Haguewood
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxRustici Software
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...apidays
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businesspanagenda
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoffsammart93
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAndrey Devyatkin
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MIND CTI
 

Kürzlich hochgeladen (20)

GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
DBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor PresentationDBX First Quarter 2024 Investor Presentation
DBX First Quarter 2024 Investor Presentation
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 

PHP on Java (BarCamp London 7)

  • 1.
  • 2. PHP ? “ PHP isn't so much a language as a virtual explosion at the keyword and function factory .” - Jeff Atwood from “PHP sucks, but it doesn't matter”
  • 3. PHP ? in_array( $needle , $haystack ); strpos( $haystack , $needle ); ... IteratorIterator RecursiveIterator RecursiveIteratorIterator ... strip _ tags() strip s lashes() SDO _ Model _ Property::get C ontaining T ype() ReflectionClass::isItera tea ble()
  • 4. PHP ! tiobe.com
  • 5. PHP ! Photo from DragonBe
  • 6. PHP !
  • 7.
  • 8.
  • 9. How PHP runs on the JVM <?php echo 'hello' ; System. out .println( &quot;hello&quot; );
  • 10.
  • 11. Some Code ! <?php java_import( &quot;java.util.HashMap&quot; ); $map = new HashMap; $map ->put( &quot;stuff&quot; , array ( 1 , 2 , 3 , 4 , 5 )); var_dump( $map ->get( &quot;stuff&quot; )); // prints: array(5) { ...
  • 12. Some more Code ! <?php java_import( &quot;java.io.File&quot; ); class SubFile extends File { function isThisCool() { return TRUE ; // Way cool } } $file = new SubFile( &quot;/&quot; ); var_dump( $file ->isDirectory()); var_dump( $file ->isThisCool());
  • 13. Last bit of Code ! <?php java_import( &quot;java.util.ArrayList&quot; ); $list = new ArrayList(); $list ->add( &quot;Hello World!&quot; ); $list ->add( FALSE ); $list ->add( 1234567890 ); foreach ( $list as $key => $value ) { echo &quot; $key $value &quot; ; }
  • 14.
  • 15.
  • 16.
  • 17. Sorry, one more bit of Code ! class Dynamic { def storage = [:] def invokeMethod(String name, args) { println &quot;Hello!&quot; } def getProperty(String name) { storage[name] } def setProperty(String name, value) { storage[name] = value } } <?php groovy_import( &quot;dynamic.groovy&quot; ); $foo = new Dynamic(); $foo ->bar(); $foo ->guff = &quot;Hello World!&quot; ; echo $foo ->guff;
  • 18.
  • 19.
  • 20. Learn more & Try it out: http://projectzero.org/php Thanks! [email_address] / @rewbs