SlideShare uma empresa Scribd logo
1 de 22

      
       PHP on Java 
      
     
      
       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 by Michelangelo van Dam ( 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());

      
       Some more  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 on Java:  Challenges  
      
     
      
       ,[object Object],

      
       PHP on Java:  Challenges  
      
     
      
       ,[object Object],
      
     
      
       ✔ 
      
     
      
       ✔ 
      
     
      
       ✘ 
      
     
      
       ✘ 
      
     
      function  f() { 
      $a  =  1 ; 
      return  $a ; 
      } 
      echo  f();  //1 
      
     
      function  f( $name ) { 
      $a  =  1 ; 
      $ $name  =  2 ; 
      return  $a ; 
      } 
      echo  f( 'a' );  //2 
      
     
      function  f() { 
      $a  =  1 ; 
      extract( array ( 'a' => 3 )); 
      return  $a ; 
      } 
      echo  f();  //3 
      
     
      function  f() { 
      $a  =  1 ; 
      print_r( array ( 'a' => 3 )); 
      return  $a ; 
      } 
      echo  f();  //3

      
       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

      
       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: 
      
     
      
       
       
      
     
      
       Thanks! 
       [email_address]   /  @rewbs 
      
     
      
       http://projectzero.org/php 
       
       
       http://bit.ly/ibmCloud

Mais conteúdo relacionado

Semelhante a Php On Java (London Java Community Unconference)

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
 
Profiler Instrumentation Using Metaprogramming Techniques
Profiler Instrumentation Using Metaprogramming TechniquesProfiler Instrumentation Using Metaprogramming Techniques
Profiler Instrumentation Using Metaprogramming TechniquesRitu Arora
 
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
 
Florian adler minute project
Florian adler   minute projectFlorian adler   minute project
Florian adler minute projectDmitry Buzdin
 
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
 
Phalcon / Zephir Introduction at PHPConfTW2013
Phalcon / Zephir Introduction at PHPConfTW2013Phalcon / Zephir Introduction at PHPConfTW2013
Phalcon / Zephir Introduction at PHPConfTW2013Rack Lin
 
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
 
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
 
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
 
Graal VM: Multi-Language Execution Platform
Graal VM: Multi-Language Execution PlatformGraal VM: Multi-Language Execution Platform
Graal VM: Multi-Language Execution PlatformThomas Wuerthinger
 
/* 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
 
The Forces Driving Java
The Forces Driving JavaThe Forces Driving Java
The Forces Driving JavaSteve Elliott
 

Semelhante a Php On Java (London Java Community Unconference) (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
 
Profiler Instrumentation Using Metaprogramming Techniques
Profiler Instrumentation Using Metaprogramming TechniquesProfiler Instrumentation Using Metaprogramming Techniques
Profiler Instrumentation Using Metaprogramming Techniques
 
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...
 
Florian adler minute project
Florian adler   minute projectFlorian adler   minute project
Florian adler minute project
 
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
 
Project Zero Php Quebec
Project Zero Php QuebecProject Zero Php Quebec
Project Zero Php Quebec
 
Phalcon / Zephir Introduction at PHPConfTW2013
Phalcon / Zephir Introduction at PHPConfTW2013Phalcon / Zephir Introduction at PHPConfTW2013
Phalcon / Zephir Introduction at PHPConfTW2013
 
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
 
20070329 Tech Study
20070329 Tech Study 20070329 Tech Study
20070329 Tech Study
 
Introduction to Apache Camel
Introduction to Apache CamelIntroduction to Apache Camel
Introduction to Apache Camel
 
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
 
Turbo charging v8 engine
Turbo charging v8 engineTurbo charging v8 engine
Turbo charging v8 engine
 
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
 
Graal VM: Multi-Language Execution Platform
Graal VM: Multi-Language Execution PlatformGraal VM: Multi-Language Execution Platform
Graal VM: Multi-Language Execution Platform
 
/* 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
 
The Forces Driving Java
The Forces Driving JavaThe Forces Driving Java
The Forces Driving Java
 
Dev ops for developers
Dev ops for developersDev ops for developers
Dev ops for developers
 
DevOps for Developers
DevOps for DevelopersDevOps for Developers
DevOps for Developers
 

Último

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
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024The Digital Insurer
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUK Journal
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
🐬 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
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProduct Anonymous
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 

Último (20)

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
 
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
 
Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024Partners Life - Insurer Innovation Award 2024
Partners Life - Insurer Innovation Award 2024
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
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
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 

Php On Java (London Java Community Unconference)

  • 1. PHP on Java Robin Fernandes (ibm) [email_address] @rewbs
  • 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 by Michelangelo van Dam ( 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. Some more 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.
  • 18.
  • 19. 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;
  • 20.
  • 21.
  • 22. Learn more & Try it out: Thanks! [email_address] / @rewbs http://projectzero.org/php http://bit.ly/ibmCloud