SlideShare une entreprise Scribd logo
1  sur  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

Contenu connexe

Similaire à 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
 

Similaire à 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
 

Dernier

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdfChristopherTHyatt
 
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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfhans926745
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking MenDelhi Call girls
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 

Dernier (20)

The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
Evaluating the top large language models.pdf
Evaluating the top large language models.pdfEvaluating the top large language models.pdf
Evaluating the top large language models.pdf
 
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
 
Tech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdfTech Trends Report 2024 Future Today Institute.pdf
Tech Trends Report 2024 Future Today Institute.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 

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