Arrays

Associative Arrays (hashes)

Numbers

Addition

Go

num := 3 + 1

PHP

<?php
$num = 3 + 1;
?>

Ruby

int = 3 + 5

SQL

SELECT 3 + 5;

Exponentiation

Go

import math

.
.

num := math.Pow(5.0, 2.0)

PHP

$num = pow(5, 2); // 5^2

Ruby

num = 5 ** 2

SQL

SELECT pow(5, 2);

Modulus

Go

num := 5%2

PHP

<?php
$int = 5 % 2;
?>

Ruby

int = 5 % 2

SQL

SELECT MOD(5, 2);

Strings

Concatenate Strings

Go

string := 'one' + 'two'

MySQL

SELECT CONCAT('one', 'two');

PHP

$string = 'one' . 'two';

PostgreSQL

SELECT 'one' || 'two';

Ruby

string = 'one' + 'two'

Convert String To Integer

PHP

$int = (int)'10';

PostgreSQL

SELECT '10'::integer;

Ruby

int = '10'.to_i