SlideShare a Scribd company logo
Programming in Hack
Alejandro Marcu
Dutch PHP Conference 2016
2
 Started programming Logo at
8 years old
 Then moved to Basic, Turbo
Pascal, C++, Java
 2001 – 2004 Various
programming jobs in
Argentina
 2004 – 2008: TopCoder
 2009 – 2015: Facebook
Alejandro Marcu
3
1. Introduction
2. Hack Types
3. Collections
4. Async
5. XHP
6. Hack Codegen
What You Will Learn Today
Introduction
5
HHVM history
 2007 - Hackathon project: convert PHP to c++
 2009 – HipHop (HPHPc) in prod in Facebook
 2010 – Open sourced HipHop for PHP
 2010 – Started the HHVM project
 2013 – HHVM in prod in Facebook
 2013 – HHVM open sourced
6
 In 2014 Wikipedia migrated to HHVM:
 CPU load went from 50% to 10%
 Mean page save time went 6s to 3s
 Average page load time went from 1.3s to 0.9s
 PHP 7 performance is close to HHVM
Example of migration to HHVM
7
 Started in 2012 as “strict-mode” project
 Grew to be much more than that
 Open sourced in 2014
 As of now, HHVM is the only execution engine that
runs Hack
 Totally interoperable with PHP, allowing for a gradual
migration
Hack
8
 Analyzes Hack programs statically
 Monitors files changes in the background
 Extremely fast, even in huge code bases
 Can even be used by IDEs to autocomplete code
Typechecker
Typechecker
hacklang.org/tutorial/
10
 Type annotations
 Collections
 Async
 XHP
 Attributes
 Constructor parameter
Promotion
 Enums
 Generics
Hack only features
 Operators
 Lambda
 Null safe
 XHP attribute access
 Pipe operator
 Shapes
 Trait and interfaces
requirements
 Type aliases
11
 References
 Global statements
 Top level code
 Variable variables
 Dynamic properties
 Pseudo-functions
 isset
 empty
 Unset
 goto
 Etc..
Unsupported features in Hack
12
<?hh //strict  Type annotations required
 Can’t call PHP
 No top level code
 No references
<?hh // partial
or
<?hh
 The following is allowed but not checked:
• Calls to PHP
• Top level code
• References
 Type annotations not required but checked
if present
<?hh // decl  Not checked at all
 Functions and classes are indexed
 Use it only as the first step to migrate to
Hack
Typechecker modes
Type annotations
14
Types
 Primitive types
 bool
 int
 float
 string
 array
 resource
 Combined primitive types
 num (int or float)
 arraykey (int or string)
 Object types
 Name of classes or interfaces
Return types
void can be used only as a return type
Parameters
Nullable parameters
Local variables
Class attributes
Class attributes
Class attributes
Constructor argument promotion
Enums
Enums
Enums
Generics
Arrays with generics
Collections
Vector
0-indexed list
Map
Keys: int or str.
Values: anything
Set
Unique elements
Collections overview
Vector
Map
Set
Immutability
Immutability
Immutability
Async
37
 Single thread blocking
 Single thread non-blocking
 Multithread
Threads
Single Thread blocking example
Single Thread blocking example
Single Thread blocking example
Async example
Async example
Async example
44
 Use the keyword async before function
 The return type must be Awaitable<…>
 Call async from async using await
 Call async from non-async using HHAsiojoin
 Make parallel calls using helpers in HHAsio
(such as v,vm,m,mf, etc.)
Async
XHP
46
What is XHP?
 XHP is used to generate HTML in PHP or Hack
 No templating
 No string concatenating
 Represent HTML as a tree of objects
 Familiar XML syntax
 Secure
 Strong validations
 Extensible
Hello World
composer.json
xhp.php
Hello World
Adding children
Custom class definition
Inheriting and transferring attributes
Async components
53
XHP parser transforms it into regular Hack code:
 XHP class names are replaced:
 First char colon is replaced with xhp_
 Other colons are replaced with two underscores
 Hyphens are replaced with an underscore
 E.g. :ui:nav:header is replaced with
xhp_ui__nav__header
XHP internals
54
 XHP tags are replaced with constructors. E.g.
will be replaced with:
XHP internals
Hack Codegen
56
Why code generation?
 Code generation: writing code that writes code
 Higher level of abstraction
 Generate boilerplate code
 Generate code from almost static data in database
 Replace usage of __call
57
 Easy to create files, functions, classes, methods,
arrays, collections, etc
 Support for partially generated files
 Files can be signed
 No string concatenation
 No need to indent or add spaces
 https://github.com/facebook/hack-codegen/
 Composer: require facebook/hack-codegen
Hack Codegen
Hack Codegen example
Hack Codegen example output
ORM code generation
ORM code generation
ORM code generation
ORM code generation
Learning Resources
65
Learning resources
 http://hacklang.org/ : installation, tutorial, docs
 “Hack & HHVM” book
Contact Information
amarcu@gmail.com
/alejandro.marcu
/alejandromarcu
@AlejandroMarcu
/in/alejandromarcu

More Related Content

What's hot

C# and vb
C# and vbC# and vb
C# and vb
Enanin Saltarin
 
Lex
LexLex
Chap1introppt1php basic
Chap1introppt1php basicChap1introppt1php basic
Chap1introppt1php basic
monikadeshmane
 
C-Sharp 6.0 ver2
C-Sharp 6.0 ver2C-Sharp 6.0 ver2
C-Sharp 6.0 ver2
Tome Tomovski
 
Advanced c programming in Linux
Advanced c programming in Linux Advanced c programming in Linux
Advanced c programming in Linux
Mohammad Golyani
 
A la découverte de TypeScript
A la découverte de TypeScriptA la découverte de TypeScript
A la découverte de TypeScript
Denis Voituron
 
C#unit4
C#unit4C#unit4
C#unit4
raksharao
 
Golang 101
Golang 101Golang 101
Golang 101
宇 傅
 
Functional programming with Java 8
Functional programming with Java 8Functional programming with Java 8
Functional programming with Java 8
Talha Ocakçı
 
Rest style web services (google protocol buffers) prasad nirantar
Rest style web services (google protocol buffers)   prasad nirantarRest style web services (google protocol buffers)   prasad nirantar
Rest style web services (google protocol buffers) prasad nirantar
IndicThreads
 
Difference between Java and c#
Difference between Java and c#Difference between Java and c#
Difference between Java and c#
Sagar Pednekar
 
C# - Part 1
C# - Part 1C# - Part 1
C# - Part 1
Md. Mahedee Hasan
 
Python Intro
Python IntroPython Intro
Python Intro
koppenolski
 
Compilation and Execution
Compilation and ExecutionCompilation and Execution
Compilation and Execution
Chong-Kuan Chen
 
Experience protocol buffer on android
Experience protocol buffer on androidExperience protocol buffer on android
Experience protocol buffer on android
Richard Chang
 
ANTLR4 in depth
ANTLR4 in depthANTLR4 in depth
50 shades of PHP
50 shades of PHP50 shades of PHP
50 shades of PHP
Maksym Hopei
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010
Satish Verma
 
Using ANTLR on real example - convert "string combined" queries into paramete...
Using ANTLR on real example - convert "string combined" queries into paramete...Using ANTLR on real example - convert "string combined" queries into paramete...
Using ANTLR on real example - convert "string combined" queries into paramete...
Alexey Diyan
 
.Net passé, présent et futur
.Net passé, présent et futur.Net passé, présent et futur
.Net passé, présent et futur
Denis Voituron
 

What's hot (20)

C# and vb
C# and vbC# and vb
C# and vb
 
Lex
LexLex
Lex
 
Chap1introppt1php basic
Chap1introppt1php basicChap1introppt1php basic
Chap1introppt1php basic
 
C-Sharp 6.0 ver2
C-Sharp 6.0 ver2C-Sharp 6.0 ver2
C-Sharp 6.0 ver2
 
Advanced c programming in Linux
Advanced c programming in Linux Advanced c programming in Linux
Advanced c programming in Linux
 
A la découverte de TypeScript
A la découverte de TypeScriptA la découverte de TypeScript
A la découverte de TypeScript
 
C#unit4
C#unit4C#unit4
C#unit4
 
Golang 101
Golang 101Golang 101
Golang 101
 
Functional programming with Java 8
Functional programming with Java 8Functional programming with Java 8
Functional programming with Java 8
 
Rest style web services (google protocol buffers) prasad nirantar
Rest style web services (google protocol buffers)   prasad nirantarRest style web services (google protocol buffers)   prasad nirantar
Rest style web services (google protocol buffers) prasad nirantar
 
Difference between Java and c#
Difference between Java and c#Difference between Java and c#
Difference between Java and c#
 
C# - Part 1
C# - Part 1C# - Part 1
C# - Part 1
 
Python Intro
Python IntroPython Intro
Python Intro
 
Compilation and Execution
Compilation and ExecutionCompilation and Execution
Compilation and Execution
 
Experience protocol buffer on android
Experience protocol buffer on androidExperience protocol buffer on android
Experience protocol buffer on android
 
ANTLR4 in depth
ANTLR4 in depthANTLR4 in depth
ANTLR4 in depth
 
50 shades of PHP
50 shades of PHP50 shades of PHP
50 shades of PHP
 
Visual Studio .NET2010
Visual Studio .NET2010Visual Studio .NET2010
Visual Studio .NET2010
 
Using ANTLR on real example - convert "string combined" queries into paramete...
Using ANTLR on real example - convert "string combined" queries into paramete...Using ANTLR on real example - convert "string combined" queries into paramete...
Using ANTLR on real example - convert "string combined" queries into paramete...
 
.Net passé, présent et futur
.Net passé, présent et futur.Net passé, présent et futur
.Net passé, présent et futur
 

Viewers also liked

Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016
Colin O'Dell
 
Magento done right - PHP UK 2016
Magento done right  - PHP UK 2016Magento done right  - PHP UK 2016
Magento done right - PHP UK 2016
Ciaran Rooney
 
Security Theatre - PHP UK Conference
Security Theatre - PHP UK ConferenceSecurity Theatre - PHP UK Conference
Security Theatre - PHP UK Conference
xsist10
 
Debugging Effectively
Debugging EffectivelyDebugging Effectively
Debugging Effectively
Colin O'Dell
 
From Doctor to Coder: A Whole New World?
From Doctor to Coder: A Whole New World?From Doctor to Coder: A Whole New World?
From Doctor to Coder: A Whole New World?
Aisha Sie
 
Deploy to azure in less then 15 minutes
Deploy to azure in less then 15 minutesDeploy to azure in less then 15 minutes
Deploy to azure in less then 15 minutes
Michelangelo van Dam
 
Crafting beautiful software
Crafting beautiful softwareCrafting beautiful software
Crafting beautiful software
Jorn Oomen
 
Scaling your website
Scaling your websiteScaling your website
Scaling your website
Alejandro Marcu
 
DPC 2016 - 53 Minutes or Less - Architecting For Failure
DPC 2016 - 53 Minutes or Less - Architecting For FailureDPC 2016 - 53 Minutes or Less - Architecting For Failure
DPC 2016 - 53 Minutes or Less - Architecting For Failure
benwaine
 
Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016
Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016 Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016
Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016
Alexander Lisachenko
 
Feature Flags Are Flawed: Let's Make Them Better - DPC
Feature Flags Are Flawed: Let's Make Them Better - DPCFeature Flags Are Flawed: Let's Make Them Better - DPC
Feature Flags Are Flawed: Let's Make Them Better - DPC
Stephen Young
 
The treacherous road to microservices
The treacherous road to microservicesThe treacherous road to microservices
The treacherous road to microservices
goatcode
 
Driving Design through Examples
Driving Design through ExamplesDriving Design through Examples
Driving Design through Examples
CiaranMcNulty
 
Introducing Eager Design
Introducing Eager DesignIntroducing Eager Design
Introducing Eager Design
Marcello Duarte
 
Elasticsearch, the story so far
Elasticsearch, the story so farElasticsearch, the story so far
Elasticsearch, the story so far
Jordy Moos
 
Being functional in PHP (DPC 2016)
Being functional in PHP (DPC 2016)Being functional in PHP (DPC 2016)
Being functional in PHP (DPC 2016)
David de Boer
 
Integrating Bounded Contexts Tips - Dutch PHP 2016
Integrating Bounded Contexts Tips - Dutch PHP 2016Integrating Bounded Contexts Tips - Dutch PHP 2016
Integrating Bounded Contexts Tips - Dutch PHP 2016
Carlos Buenosvinos
 
OOP: Princípios e Padroes
OOP: Princípios e PadroesOOP: Princípios e Padroes
OOP: Princípios e Padroes
Nelson Senna do Amaral
 
Como programar melhor jogando game boy
Como programar melhor jogando game boyComo programar melhor jogando game boy
Como programar melhor jogando game boy
Gabriel Rodrigues Couto
 
The Road To Technical Team Lead
The Road To Technical Team LeadThe Road To Technical Team Lead
The Road To Technical Team Lead
benwaine
 

Viewers also liked (20)

Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016Hacking Your Way To Better Security - Dutch PHP Conference 2016
Hacking Your Way To Better Security - Dutch PHP Conference 2016
 
Magento done right - PHP UK 2016
Magento done right  - PHP UK 2016Magento done right  - PHP UK 2016
Magento done right - PHP UK 2016
 
Security Theatre - PHP UK Conference
Security Theatre - PHP UK ConferenceSecurity Theatre - PHP UK Conference
Security Theatre - PHP UK Conference
 
Debugging Effectively
Debugging EffectivelyDebugging Effectively
Debugging Effectively
 
From Doctor to Coder: A Whole New World?
From Doctor to Coder: A Whole New World?From Doctor to Coder: A Whole New World?
From Doctor to Coder: A Whole New World?
 
Deploy to azure in less then 15 minutes
Deploy to azure in less then 15 minutesDeploy to azure in less then 15 minutes
Deploy to azure in less then 15 minutes
 
Crafting beautiful software
Crafting beautiful softwareCrafting beautiful software
Crafting beautiful software
 
Scaling your website
Scaling your websiteScaling your website
Scaling your website
 
DPC 2016 - 53 Minutes or Less - Architecting For Failure
DPC 2016 - 53 Minutes or Less - Architecting For FailureDPC 2016 - 53 Minutes or Less - Architecting For Failure
DPC 2016 - 53 Minutes or Less - Architecting For Failure
 
Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016
Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016 Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016
Solving Cross-Cutting Concerns in PHP - DutchPHP Conference 2016
 
Feature Flags Are Flawed: Let's Make Them Better - DPC
Feature Flags Are Flawed: Let's Make Them Better - DPCFeature Flags Are Flawed: Let's Make Them Better - DPC
Feature Flags Are Flawed: Let's Make Them Better - DPC
 
The treacherous road to microservices
The treacherous road to microservicesThe treacherous road to microservices
The treacherous road to microservices
 
Driving Design through Examples
Driving Design through ExamplesDriving Design through Examples
Driving Design through Examples
 
Introducing Eager Design
Introducing Eager DesignIntroducing Eager Design
Introducing Eager Design
 
Elasticsearch, the story so far
Elasticsearch, the story so farElasticsearch, the story so far
Elasticsearch, the story so far
 
Being functional in PHP (DPC 2016)
Being functional in PHP (DPC 2016)Being functional in PHP (DPC 2016)
Being functional in PHP (DPC 2016)
 
Integrating Bounded Contexts Tips - Dutch PHP 2016
Integrating Bounded Contexts Tips - Dutch PHP 2016Integrating Bounded Contexts Tips - Dutch PHP 2016
Integrating Bounded Contexts Tips - Dutch PHP 2016
 
OOP: Princípios e Padroes
OOP: Princípios e PadroesOOP: Princípios e Padroes
OOP: Princípios e Padroes
 
Como programar melhor jogando game boy
Como programar melhor jogando game boyComo programar melhor jogando game boy
Como programar melhor jogando game boy
 
The Road To Technical Team Lead
The Road To Technical Team LeadThe Road To Technical Team Lead
The Road To Technical Team Lead
 

Similar to Programming in hack

Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPIntroduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHP
wahidullah mudaser
 
Basic of PHP
Basic of PHPBasic of PHP
Basic of PHP
Nisa Soomro
 
Hack and HHVM
Hack and HHVMHack and HHVM
Hack and HHVM
Ewere Diagboya
 
PHP
 PHP PHP
PHP Comprehensive Overview
PHP Comprehensive OverviewPHP Comprehensive Overview
PHP Comprehensive Overview
Mohamed Loey
 
chapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfchapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdf
burasyacob012
 
Php introduction
Php introductionPhp introduction
Php introduction
krishnapriya Tadepalli
 
Chap 4 PHP.pdf
Chap 4 PHP.pdfChap 4 PHP.pdf
Chap 4 PHP.pdf
HASENSEID
 
Materi Dasar PHP
Materi Dasar PHPMateri Dasar PHP
Materi Dasar PHP
Robby Firmansyah
 
Day1
Day1Day1
Day1
IRWAA LLC
 
Introduction to PHP.ppt
Introduction to PHP.pptIntroduction to PHP.ppt
Introduction to PHP.ppt
SanthiNivas
 
Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
pratik tambekar
 
PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
Vibrant Technologies & Computers
 
Basic php
Basic phpBasic php
Basic php
salissal
 
Basics PHP
Basics PHPBasics PHP
1336333055 php tutorial_from_beginner_to_master
1336333055 php tutorial_from_beginner_to_master1336333055 php tutorial_from_beginner_to_master
1336333055 php tutorial_from_beginner_to_master
jeeva indra
 
PHP
PHPPHP
Hack language
Hack languageHack language
Hack language
Ravindra Bhadane
 
Php Unit 1
Php Unit 1Php Unit 1
Php Unit 1
team11vgnt
 
Php manish
Php manishPhp manish
Php manish
Manish Jain
 

Similar to Programming in hack (20)

Introduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHPIntroduction to PHP - Basics of PHP
Introduction to PHP - Basics of PHP
 
Basic of PHP
Basic of PHPBasic of PHP
Basic of PHP
 
Hack and HHVM
Hack and HHVMHack and HHVM
Hack and HHVM
 
PHP
 PHP PHP
PHP
 
PHP Comprehensive Overview
PHP Comprehensive OverviewPHP Comprehensive Overview
PHP Comprehensive Overview
 
chapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdfchapter 5 Server-Side Scripting (PHP).pdf
chapter 5 Server-Side Scripting (PHP).pdf
 
Php introduction
Php introductionPhp introduction
Php introduction
 
Chap 4 PHP.pdf
Chap 4 PHP.pdfChap 4 PHP.pdf
Chap 4 PHP.pdf
 
Materi Dasar PHP
Materi Dasar PHPMateri Dasar PHP
Materi Dasar PHP
 
Day1
Day1Day1
Day1
 
Introduction to PHP.ppt
Introduction to PHP.pptIntroduction to PHP.ppt
Introduction to PHP.ppt
 
Php Tutorial
Php TutorialPhp Tutorial
Php Tutorial
 
PHP - Introduction to PHP Fundamentals
PHP -  Introduction to PHP FundamentalsPHP -  Introduction to PHP Fundamentals
PHP - Introduction to PHP Fundamentals
 
Basic php
Basic phpBasic php
Basic php
 
Basics PHP
Basics PHPBasics PHP
Basics PHP
 
1336333055 php tutorial_from_beginner_to_master
1336333055 php tutorial_from_beginner_to_master1336333055 php tutorial_from_beginner_to_master
1336333055 php tutorial_from_beginner_to_master
 
PHP
PHPPHP
PHP
 
Hack language
Hack languageHack language
Hack language
 
Php Unit 1
Php Unit 1Php Unit 1
Php Unit 1
 
Php manish
Php manishPhp manish
Php manish
 

Recently uploaded

Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Peter Caitens
 
Going AOT: Everything you need to know about GraalVM for Java applications
Going AOT: Everything you need to know about GraalVM for Java applicationsGoing AOT: Everything you need to know about GraalVM for Java applications
Going AOT: Everything you need to know about GraalVM for Java applications
Alina Yurenko
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
safelyiotech
 
Refactoring legacy systems using events commands and bubble contexts
Refactoring legacy systems using events commands and bubble contextsRefactoring legacy systems using events commands and bubble contexts
Refactoring legacy systems using events commands and bubble contexts
Michał Kurzeja
 
Streamlining End-to-End Testing Automation
Streamlining End-to-End Testing AutomationStreamlining End-to-End Testing Automation
Streamlining End-to-End Testing Automation
Anand Bagmar
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
Maitrey Patel
 
TheFutureIsDynamic-BoxLang-CFCamp2024.pdf
TheFutureIsDynamic-BoxLang-CFCamp2024.pdfTheFutureIsDynamic-BoxLang-CFCamp2024.pdf
TheFutureIsDynamic-BoxLang-CFCamp2024.pdf
Ortus Solutions, Corp
 
Flutter vs. React Native: A Detailed Comparison for App Development in 2024
Flutter vs. React Native: A Detailed Comparison for App Development in 2024Flutter vs. React Native: A Detailed Comparison for App Development in 2024
Flutter vs. React Native: A Detailed Comparison for App Development in 2024
dhavalvaghelanectarb
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
Reetu63
 
Hyperledger Besu 빨리 따라하기 (Private Networks)
Hyperledger Besu 빨리 따라하기 (Private Networks)Hyperledger Besu 빨리 따라하기 (Private Networks)
Hyperledger Besu 빨리 따라하기 (Private Networks)
wonyong hwang
 
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
kalichargn70th171
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio, Inc.
 
Microsoft-Power-Platform-Adoption-Planning.pptx
Microsoft-Power-Platform-Adoption-Planning.pptxMicrosoft-Power-Platform-Adoption-Planning.pptx
Microsoft-Power-Platform-Adoption-Planning.pptx
jrodriguezq3110
 
Orca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container OrchestrationOrca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container Orchestration
Pedro J. Molina
 
Ensuring Efficiency and Speed with Practical Solutions for Clinical Operations
Ensuring Efficiency and Speed with Practical Solutions for Clinical OperationsEnsuring Efficiency and Speed with Practical Solutions for Clinical Operations
Ensuring Efficiency and Speed with Practical Solutions for Clinical Operations
OnePlan Solutions
 
How GenAI Can Improve Supplier Performance Management.pdf
How GenAI Can Improve Supplier Performance Management.pdfHow GenAI Can Improve Supplier Performance Management.pdf
How GenAI Can Improve Supplier Performance Management.pdf
Zycus
 
Stork Product Overview: An AI-Powered Autonomous Delivery Fleet
Stork Product Overview: An AI-Powered Autonomous Delivery FleetStork Product Overview: An AI-Powered Autonomous Delivery Fleet
Stork Product Overview: An AI-Powered Autonomous Delivery Fleet
Vince Scalabrino
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
ervikas4
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid
 
What is Continuous Testing in DevOps - A Definitive Guide.pdf
What is Continuous Testing in DevOps - A Definitive Guide.pdfWhat is Continuous Testing in DevOps - A Definitive Guide.pdf
What is Continuous Testing in DevOps - A Definitive Guide.pdf
kalichargn70th171
 

Recently uploaded (20)

Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom KittEnhanced Screen Flows UI/UX using SLDS with Tom Kitt
Enhanced Screen Flows UI/UX using SLDS with Tom Kitt
 
Going AOT: Everything you need to know about GraalVM for Java applications
Going AOT: Everything you need to know about GraalVM for Java applicationsGoing AOT: Everything you need to know about GraalVM for Java applications
Going AOT: Everything you need to know about GraalVM for Java applications
 
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
Safelyio Toolbox Talk Softwate & App (How To Digitize Safety Meetings)
 
Refactoring legacy systems using events commands and bubble contexts
Refactoring legacy systems using events commands and bubble contextsRefactoring legacy systems using events commands and bubble contexts
Refactoring legacy systems using events commands and bubble contexts
 
Streamlining End-to-End Testing Automation
Streamlining End-to-End Testing AutomationStreamlining End-to-End Testing Automation
Streamlining End-to-End Testing Automation
 
ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.ACE - Team 24 Wrapup event at ahmedabad.
ACE - Team 24 Wrapup event at ahmedabad.
 
TheFutureIsDynamic-BoxLang-CFCamp2024.pdf
TheFutureIsDynamic-BoxLang-CFCamp2024.pdfTheFutureIsDynamic-BoxLang-CFCamp2024.pdf
TheFutureIsDynamic-BoxLang-CFCamp2024.pdf
 
Flutter vs. React Native: A Detailed Comparison for App Development in 2024
Flutter vs. React Native: A Detailed Comparison for App Development in 2024Flutter vs. React Native: A Detailed Comparison for App Development in 2024
Flutter vs. React Native: A Detailed Comparison for App Development in 2024
 
ppt on the brain chip neuralink.pptx
ppt  on   the brain  chip neuralink.pptxppt  on   the brain  chip neuralink.pptx
ppt on the brain chip neuralink.pptx
 
Hyperledger Besu 빨리 따라하기 (Private Networks)
Hyperledger Besu 빨리 따라하기 (Private Networks)Hyperledger Besu 빨리 따라하기 (Private Networks)
Hyperledger Besu 빨리 따라하기 (Private Networks)
 
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
The Power of Visual Regression Testing_ Why It Is Critical for Enterprise App...
 
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data PlatformAlluxio Webinar | 10x Faster Trino Queries on Your Data Platform
Alluxio Webinar | 10x Faster Trino Queries on Your Data Platform
 
Microsoft-Power-Platform-Adoption-Planning.pptx
Microsoft-Power-Platform-Adoption-Planning.pptxMicrosoft-Power-Platform-Adoption-Planning.pptx
Microsoft-Power-Platform-Adoption-Planning.pptx
 
Orca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container OrchestrationOrca: Nocode Graphical Editor for Container Orchestration
Orca: Nocode Graphical Editor for Container Orchestration
 
Ensuring Efficiency and Speed with Practical Solutions for Clinical Operations
Ensuring Efficiency and Speed with Practical Solutions for Clinical OperationsEnsuring Efficiency and Speed with Practical Solutions for Clinical Operations
Ensuring Efficiency and Speed with Practical Solutions for Clinical Operations
 
How GenAI Can Improve Supplier Performance Management.pdf
How GenAI Can Improve Supplier Performance Management.pdfHow GenAI Can Improve Supplier Performance Management.pdf
How GenAI Can Improve Supplier Performance Management.pdf
 
Stork Product Overview: An AI-Powered Autonomous Delivery Fleet
Stork Product Overview: An AI-Powered Autonomous Delivery FleetStork Product Overview: An AI-Powered Autonomous Delivery Fleet
Stork Product Overview: An AI-Powered Autonomous Delivery Fleet
 
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptxMigration From CH 1.0 to CH 2.0 and  Mule 4.6 & Java 17 Upgrade.pptx
Migration From CH 1.0 to CH 2.0 and Mule 4.6 & Java 17 Upgrade.pptx
 
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdfBaha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
Baha Majid WCA4Z IBM Z Customer Council Boston June 2024.pdf
 
What is Continuous Testing in DevOps - A Definitive Guide.pdf
What is Continuous Testing in DevOps - A Definitive Guide.pdfWhat is Continuous Testing in DevOps - A Definitive Guide.pdf
What is Continuous Testing in DevOps - A Definitive Guide.pdf
 

Programming in hack

Editor's Notes

  1. class Demo { public function bar(array $a): int { return $a[0]; } }
  2. echo <div>Hello World!!</div>;
  3. function render(string $name): XHPRoot { return <div>Hello World, {$name}!!</div>; } echo render('PHP Conference');
  4. $select = <select />; $options = Vector {'yes', 'no'}; foreach ($options as $value) { $select->appendChild(<option value={$value}>{$value}</option>); }
  5. class :year-picker extends :x:element { attribute int from @required; attribute int to @required; public function render(): XHPRoot { $select = <select />; for ($i = $this->:from; $i <= $this->:to; $i++) { $select->appendChild( <option value={(string) $i}>{$i}</option> ); } return $select; } } echo <year-picker from={1960} to={1990} />;
  6. class :year-picker extends :x:element { attribute :select; use XHPHelpers; attribute int from @required; attribute int to @required; public function render(): XHPRoot { $select = <select />; for ($i = $this->:from; $i <= $this->:to; $i++) { $select->appendChild( <option value={(string) $i}>{$i}</option> ); } return $select; } } echo <year-picker from={1960} to={1990} name="selector" class="mystyle" />;
  7. class :user:link extends :x:element { attribute int userid @required; use XHPAsync; protected async function asyncRender(): Awaitable<XHPRoot> { $user = await get_user_data($this->:userid); return <a href={$user['link']} class="myclass"> {$user['name']} </a>; } } echo <user:link userid={26}/>;
  8. echo <div class="myclass">Hello World!!</div>; Will be replaced with echo new xhp_div( array('class' => 'myclass'), array('Hello World!!') );