Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add S02.md

  • Loading branch information...
commit 767d911ffd01c939e2b0f7646ca94cc0d2f044d0 1 parent 429d29e
@c9s authored
Showing with 46 additions and 1 deletion.
  1. +46 −0 doc/synopsis/S02.md
  2. +0 −1  doc/synopsis/S06.md
View
46 doc/synopsis/S02.md
@@ -0,0 +1,46 @@
+Bits and Pieces
+===============
+
+## Variable
+
+### Integer, Float and Double
+
+ foo = 123
+ foo2 = 1.23
+
+### String
+
+ bar = '123'
+
+### String interpolation
+
+ person = 'John'
+ template = "Hi, {{ person }}. Good morning."
+
+will be transformed into:
+
+ <?
+ $person = 'John';
+ $template = 'Hi, ' . $person . '. Good morning.';
+
+## Hash (Associative Array)
+
+ list = 1..10
+
+ $list = range(1,10);
+
+ list = [1,2,3]
+ list[] = 4
+ list[] = 5
+ list[] = 6
+
+
+ zoo = "hack"
+ addresses = {
+ "foo" => 1,
+ :bar => 2,
+ zoo => 3,
+ }
+ addresses[:john] = 3
+
+NOTE, we have to solve the use of inserting hash with key by variable.
View
1  doc/synopsis/S06.md
@@ -126,7 +126,6 @@ To define a PHP class with inheritance:
new: ->
-
## Interface
To implement an interface for a class:
Please sign in to comment.
Something went wrong with that request. Please try again.