Skip to content

Instantly share code, notes, and snippets.

@gcorne
Forked from josephscott/object-vs.php
Last active December 14, 2015 07:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save gcorne/5050350 to your computer and use it in GitHub Desktop.
Save gcorne/5050350 to your computer and use it in GitHub Desktop.
<?php
class Test {
public $name;
public $city;
public $state;
public function __construct( $name, $city, $state ) {
$this->name = $name;
$this->city = $city;
$this->state = $state;
}
}
$init = memory_get_usage();
$test_me = new Test( 'Joseph Scott', 'Sandy', 'Utah' );
echo "MEM: " . ( memory_get_usage() - $init ) . "\n";
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment