Skip to content

Instantly share code, notes, and snippets.

@gorkamu
Created November 8, 2016 19:16
Show Gist options
  • Select an option

  • Save gorkamu/ff4a0be97e0c2f654d1eaf4d3a765c52 to your computer and use it in GitHub Desktop.

Select an option

Save gorkamu/ff4a0be97e0c2f654d1eaf4d3a765c52 to your computer and use it in GitHub Desktop.
Ejemplo de paso de argumentos por valor
<?php
$nombre = 'Gorkamu';
function saluda($nombre) {
$nombre = 'Gorkamu eres un gandul!';
echo 'Hola '.$nombre.PHP_EOL;
}
echo $nombre; // Imprime 'Gorkamu'
echo saluda($nombre); // Imprime 'Hola Gorkamu eres un gandul!'
echo $nombre; // Imprime 'Gorkamu'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment