Skip to content

Instantly share code, notes, and snippets.

@szbl
Last active August 29, 2015 14:06
Show Gist options
  • Select an option

  • Save szbl/4e62d044aad8dfb9b566 to your computer and use it in GitHub Desktop.

Select an option

Save szbl/4e62d044aad8dfb9b566 to your computer and use it in GitHub Desktop.
<?php
$obj = new stdClass();
echo 'Object in var: ';
var_dump( $obj == true );
echo '<hr>';
echo 'Non-existent var: ';
@var_dump( $nonexistent_obj == true );
echo '<hr>';
$obj->property1 = 'something';
$obj->property2 = 0;
$obj->property3 = 45.9;
echo 'Object with properites: ';
var_dump( $obj == true );
echo '<hr>';
$obj = null;
echo 'Null var: ';
var_dump( $obj == true );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment