Skip to content

Instantly share code, notes, and snippets.

@msztolcman
Created July 18, 2013 21:07
Show Gist options
  • Save msztolcman/6033099 to your computer and use it in GitHub Desktop.
Save msztolcman/6033099 to your computer and use it in GitHub Desktop.
<?php
error_reporting(E_ALL|E_STRICT);
ini_set('display_errors', 1);
class T {
public $dupa = 1;
}
$t = new T;
echo $t->dupa . PHP_EOL;
echo (isset($t->dupa) ? 'set' : 'non set') . PHP_EOL;
$t->dupa = '';
echo (isset($t->dupa) ? 'set' : 'non set') . PHP_EOL;
$t->dupa = 0;
echo (isset($t->dupa) ? 'set' : 'non set') . PHP_EOL;
$t->dupa = null;
echo (isset($t->dupa) ? 'set' : 'non set') . PHP_EOL;
$t->dupa = false;
echo (isset($t->dupa) ? 'set' : 'non set') . PHP_EOL;
# 1 1
# 2 set
# 3 set
# 4 set
# 5 non set
# 6 set
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment