1<?php
2 $name = "Paul";
3 $age = 26;
4
5 echo "My name is {$name}, I'm {$age} years old ";
1public function getAvg(string $var) {
2 # A sample from a game I wrote.
3 # Concatenatin on the other side is just {stuff.$var}
4 # You can also concatenate multiple variables in a varaible:
5 # {$varA.$varb}
6 $min = $this->{$var._min};
7 # Assigns to $min object property matching $var + '_min' string.
8 $max = $this->{$var._max};
9 # Assigns to $max object property matching $var + '_max' string.
10 $avg = (($min + $max) / 2);
11 return round($avg);
12}