<?php $num = 10; function my_func() { global $num; $string = "20"; echo $num+$string -1 ; } my_func(); ?>