1
0
Fork 0
mirror of https://github.com/YunoHost-Apps/z-push_ynh.git synced 2024-09-03 18:05:58 +02:00
z-push_ynh/sources/testing/testing-ternary.php
2014-12-18 18:08:26 +01:00

29 lines
547 B
PHP

<?php
function test_function(&$text) {
echo "Text is $text\n";
$text = "Something new";
}
$testing = "Something";
$existing = "Existing";
$nullset = null;
test_function(($testing === null ? $testing : $existing));
test_function(($nullset === null ? $existing : $nullset));
if ($testing === null) {
test_function($testing);
}
else {
test_function($existing);
// $existing should have a new value after this, but it doesn't
}
if ($nullset === null) {
test_function($existing);
}
else {
test_function($nullset);
}
?>